[videos] Fix imdb lookups with new library
This commit is contained in:
5141
poetry.lock
generated
5141
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@ description = ""
|
|||||||
authors = ["Colin Powell <colin@unbl.ink>"]
|
authors = ["Colin Powell <colin@unbl.ink>"]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.9,<3.12"
|
python = ">=3.11,<3.14"
|
||||||
Django = "^4.0.3"
|
Django = "^4.0.3"
|
||||||
django-extensions = "^3.1.5"
|
django-extensions = "^3.1.5"
|
||||||
python-dateutil = "^2.8.2"
|
python-dateutil = "^2.8.2"
|
||||||
@ -16,8 +16,8 @@ httpx = "<=0.27.2"
|
|||||||
djangorestframework = "^3.13.1"
|
djangorestframework = "^3.13.1"
|
||||||
Markdown = "^3.3.6"
|
Markdown = "^3.3.6"
|
||||||
django-filter = "^21.1"
|
django-filter = "^21.1"
|
||||||
Pillow = "^9.0.1"
|
Pillow = "^10.0.0"
|
||||||
psycopg2 = "^2.9.3"
|
psycopg2 = "2.9.10"
|
||||||
dj-database-url = "^0.5.0"
|
dj-database-url = "^0.5.0"
|
||||||
django-mathfilters = "^1.0.0"
|
django-mathfilters = "^1.0.0"
|
||||||
django-allauth = "^0.50.0"
|
django-allauth = "^0.50.0"
|
||||||
@ -28,7 +28,7 @@ django-markdownify = "^0.9.1"
|
|||||||
gunicorn = "^20.1.0"
|
gunicorn = "^20.1.0"
|
||||||
django-simple-history = "^3.1.1"
|
django-simple-history = "^3.1.1"
|
||||||
musicbrainzngs = "^0.7.1"
|
musicbrainzngs = "^0.7.1"
|
||||||
cinemagoer = "^2022.12.27"
|
cinemagoerng = {git = "https://github.com/cinemagoer/cinemagoerng"}
|
||||||
pysportsdb = "^0.1.0"
|
pysportsdb = "^0.1.0"
|
||||||
pytz = "^2022.7.1"
|
pytz = "^2022.7.1"
|
||||||
django-redis = "^5.2.0"
|
django-redis = "^5.2.0"
|
||||||
@ -41,11 +41,11 @@ beautifulsoup4 = "^4.11.2"
|
|||||||
django-storages = "^1.13.2"
|
django-storages = "^1.13.2"
|
||||||
stream-sqlite = "^0.0.41"
|
stream-sqlite = "^0.0.41"
|
||||||
ipython = "^8.14.0"
|
ipython = "^8.14.0"
|
||||||
pendulum = "^2.1.2"
|
pendulum = "^3"
|
||||||
trafilatura = "^1.6.3"
|
trafilatura = "^1.6.3"
|
||||||
django-imagekit = "^5.0.0"
|
django-imagekit = "^5.0.0"
|
||||||
thefuzz = "^0.22.1"
|
thefuzz = "^0.22.1"
|
||||||
dataclass-wizard = "0.22.0"
|
dataclass-wizard = "^0.35.0"
|
||||||
webdavclient3 = "^3.14.6"
|
webdavclient3 = "^3.14.6"
|
||||||
boto3 = "^1.35.37"
|
boto3 = "^1.35.37"
|
||||||
urllib3 = "<2"
|
urllib3 = "<2"
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from imdb import Cinemagoer, helpers
|
from cinemagoerng import web as imdb
|
||||||
from videos.metadata import VideoMetadata, VideoType
|
from videos.metadata import VideoMetadata, VideoType
|
||||||
|
|
||||||
imdb_client = Cinemagoer()
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -27,11 +25,12 @@ def lookup_video_from_imdb(
|
|||||||
video_metadata = VideoMetadata(imdb_id=imdb_id)
|
video_metadata = VideoMetadata(imdb_id=imdb_id)
|
||||||
imdb_result: dict = {}
|
imdb_result: dict = {}
|
||||||
|
|
||||||
imdb_result = imdb_client.get_movie(name_or_id)
|
imdb_result = imdb.get_title(name_or_id)
|
||||||
|
logger.debug(f"Found result from IMDB: {imdb_result.title}")
|
||||||
|
|
||||||
if not imdb_result:
|
if not imdb_result:
|
||||||
imdb_result = {}
|
imdb_result = {}
|
||||||
imdb_results: list = imdb_client.search_movie(name_or_id)
|
imdb_results: list = imdb.search_movie(name_or_id)
|
||||||
if len(imdb_results) > 1:
|
if len(imdb_results) > 1:
|
||||||
for result in imdb_results:
|
for result in imdb_results:
|
||||||
if result["kind"] == kind:
|
if result["kind"] == kind:
|
||||||
|
|||||||
Reference in New Issue
Block a user