Release TheMovieDB movie scraper - PYTHON version
a simple way to scrap imdb and tmdb in filename :
in your kodi directory modify the file (save it before just in case)

e:\kodi\portable_data\addons\metadata.themoviedb.org.python\python\lib\tmdbscraper\tmdb.py

in fist line add
python:
import re

then find the line
python:
def _parse_media_id(title):

and add just after
python:

    m=re.search(r'(tt\d+)',title)
    if m: return {'type': 'imdb', 'id':m.group(1)}
    m=re.search(r'tmdb[\/#](\d+)',title)
    if m: return {'type': 'tmdb', 'id':m.group(1)}

as you can see (lines after) the parse function only detect imdb and tmdb if it's in the beginning of the name. I just accept imdb and tmdb everywhere
python:

if title.startswith('tt') and title[2:].isdigit():
        return {'type': 'imdb', 'id':title} # IMDB ID works alone because it is clear
    title = title.lower()
    if title.startswith('tmdb/') and title[5:].isdigit(): # TMDB ID
        return {'type': 'tmdb', 'id':title[5:]}
    elif title.startswith('imdb/tt') and title[7:].isdigit(): # IMDB ID with prefix to match
        return {'type': 'imdb', 'id':title[5:]}
    return None
(don't forget to modify this file every time this addon is update. i made a script to do this automatically)
Reply


Messages In This Thread
RE: TheMovieDB movie scraper - PYTHON version - by michelb2 - 2023-02-12, 10:27
Unseen English Landscaps - by Bindou - 2023-01-26, 14:48
RE: Unseen English Landscaps - by Bindou - 2023-01-27, 15:29
Logout Mark Read Team Forum Stats Members Help
TheMovieDB movie scraper - PYTHON version0