[video] Update how we get video metadata for YT add

This commit is contained in:
2025-01-20 09:13:18 -05:00
parent 89e5455b29
commit c109ed79eb
13 changed files with 317 additions and 159 deletions

View File

@ -1,11 +1,6 @@
import pytest
from videos.imdb import lookup_video_from_imdb
from videos.sources.imdb import lookup_video_from_imdb
@pytest.mark.skip(reason="Need to sort out third party API testing")
def test_lookup_imdb_bad_id(caplog):
data = lookup_video_from_imdb("3409324")
assert data is None
assert caplog.records[0].levelname == "WARNING"
assert caplog.records[0].msg == "IMDB ID should begin with 'tt' 3409324"
def test_lookup_imdb():
metadata = lookup_video_from_imdb("8946378")
assert metadata.title == "Knives Out"

View File

@ -0,0 +1,8 @@
import pytest
from videos.sources.youtube import lookup_video_from_youtube
@pytest.mark.django_db
def test_lookup_youtube_id():
metadata = lookup_video_from_youtube("RZxs9pAv99Y")
assert metadata.title == "No Pun Included's Board Game of the Year 2024"