fix letterboxd parser
This commit is contained in:
parent
e45980a85a
commit
a789f25505
1 changed files with 4 additions and 3 deletions
|
@ -43,16 +43,17 @@ class LetterboxdImporter(Task):
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_item_by_url(self, url):
|
@classmethod
|
||||||
|
def get_item_by_url(cls, url):
|
||||||
try:
|
try:
|
||||||
h = BasicDownloader(url).download().html()
|
h = BasicDownloader(url).download().html()
|
||||||
tu = h.xpath("//a[@data-track-action='TMDb']/@href")
|
tu = h.xpath("//a[@data-track-action='TMDB']/@href")
|
||||||
iu = h.xpath("//a[@data-track-action='IMDb']/@href")
|
iu = h.xpath("//a[@data-track-action='IMDb']/@href")
|
||||||
if not tu:
|
if not tu:
|
||||||
i = h.xpath('//span[@class="film-title-wrapper"]/a/@href')
|
i = h.xpath('//span[@class="film-title-wrapper"]/a/@href')
|
||||||
u2 = "https://letterboxd.com" + i[0] # type:ignore
|
u2 = "https://letterboxd.com" + i[0] # type:ignore
|
||||||
h = BasicDownloader(u2).download().html()
|
h = BasicDownloader(u2).download().html()
|
||||||
tu = h.xpath("//a[@data-track-action='TMDb']/@href")
|
tu = h.xpath("//a[@data-track-action='TMDB']/@href")
|
||||||
iu = h.xpath("//a[@data-track-action='IMDb']/@href")
|
iu = h.xpath("//a[@data-track-action='IMDb']/@href")
|
||||||
if not tu:
|
if not tu:
|
||||||
logger.error(f"Unknown TMDB for {url}")
|
logger.error(f"Unknown TMDB for {url}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue