Req Detect tmdb#id in filename - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Information Providers (scrapers) (https://forum.kodi.tv/forumdisplay.php?fid=147) +----- Forum: Movie Scrapers (https://forum.kodi.tv/forumdisplay.php?fid=302) +----- Thread: Req Detect tmdb#id in filename (/showthread.php?tid=368420) Pages:
1
2
|
Detect tmdb#id in filename - Z3b2G - 2022-05-30 Hi world, I'm a kodi user since sooo long (a XBMC user on xbox1 to be precise !) ... and I'ml sooo grateful for the result now in 2022. Since some years, I have more and more movies not found by scrapper, even when I copy-paste the exact title from TMDB ... annoying ... So here is the idea : the scrapper could take the TMDB #id directly from filename when detected ... ie : "LotR - Two Towers (2002)(tmdb#122).mkv" Something like that already exist during movie searching but it's not really easy to use imo. Thanks for reading Z3b RE: Detect tmdb#id in filename - Karellen - 2022-05-30 (2022-05-30, 00:42)Z3b2G Wrote: Since some years, I have more and more movies not found by scrapper, even when I copy-paste the exact title from TMDBOther options are... 1. Use a Parsing NFO file... https://kodi.wiki/view/NFO_files/Parsing 2. Use the Search in Kodi... https://kodi.wiki/view/Add-on:The_Movie_Database_Python#Search RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30 (2022-05-30, 01:00)Karellen Wrote:Yes, I know ... but this is not really nice imho.(2022-05-30, 00:42)Z3b2G Wrote: Since some years, I have more and more movies not found by scrapper, even when I copy-paste the exact title from TMDBOther options are... Thanks RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30 The funy part is that looks already here ... from https://github.com/xbmc/metadata.themoviedb.org.python/blob/master/python/lib/tmdbscraper/tmdb.py Quote:def _parse_media_id(title): and if i rename my file "tt4574334.mkv" ... magic ... thie file is now a well known TV show ... ...work in progress ... RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30 I'm not a dev python, but I think something like that could work :
RE: Detect tmdb#id in filename - Karellen - 2022-05-30 @Z3b2G Someone has asked about this also a few days ago. See the reply by @rmrector ... https://forum.kodi.tv/showthread.php?tid=368312&pid=3098741#pid3098741 And code proposal a few posts further down. If you make the change to the code in your local files, you could test and if it works submit a pull request. rmrector is pretty busy these days, so I am sure he will appreciate the help. RE: Detect tmdb#id in filename - michelb2 - 2022-05-30 as i post 2 posts below, i hope my code works with imdb number (with the restrictition of the date position) if you want the tmbd number working the same way try to add in addons\metadata.themoviedb.org.python\python\lib\tmdbscraper\tmdb.py 368312 (thread) this works (i hope) with tmdb python scraper and this code will be erase when this scaper will be update by kodi updater addon RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30 soooo great ... I will test that asap. if this works as I think it will, I will finally have THE ultimate solution for movie scrapping ! ... perfect, ty for the help. Thanks to everyone Z3b RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30
fix : with tmdb, 'id' should only contain the id ... ( am I wrong ? ) RE: Detect tmdb#id in filename - michelb2 - 2022-05-30 have you try ? with m=re.search(r"tmdb[\/#](\d+)",title) m.group() return the numbers only. RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30 (2022-05-30, 11:59)michelb2 Wrote: have you try ? I have just test it in python online sandbox and it return the whole pattern ... but you are right : it should not ... https://pythonsandbox.com/code/pythonsandbox_u11010_giwwMruf6Vdk8Oghwn73jRUM_v0.py RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30 Dixit python doc : .group() returns the part of the string where there was a match So ... (Yes, i'm pure newbie to python ... 😁) RE: Detect tmdb#id in filename - Klojum - 2022-05-30 (2022-05-30, 14:03)Z3b2G Wrote: (Yes, i'm pure newbie to python ... 😁) I'm no developer either, but make sure you are using Python-3 compatible syntax. Python-2 is EOL. RE: Detect tmdb#id in filename - michelb2 - 2022-05-30 ok i try inside kodi200 , i agree with you m=re.search(r"tmdb[\/#](\d+)",title) if m: return {'type': 'tmdb', 'id':m.group()[5:]} is the good syntax m=re.search(r"tmdb[\/#](\d+)",title) if m: return {'type': 'tmdb', 'id':m.group(1)} is a good synax also (by i am not a python developper either) m.group() return the whole match m.group(1) return the first group match inside () RE: Detect tmdb#id in filename - Z3b2G - 2022-05-30 Quote:Match.group([group1, ...])ok, so we are noobs ... but we done it ! is far better imo. I will test that soon, you already test ? bye. |