|
|
@ -15,13 +15,11 @@ class Letterboxd:
|
|
|
|
if self.config.trace_mode:
|
|
|
|
if self.config.trace_mode:
|
|
|
|
logger.debug(f"URL: {list_url}")
|
|
|
|
logger.debug(f"URL: {list_url}")
|
|
|
|
response = self.config.get_html(list_url, headers=util.header(language))
|
|
|
|
response = self.config.get_html(list_url, headers=util.header(language))
|
|
|
|
letterboxd_ids = response.xpath("//li[contains(@class, 'poster-container')]/div/@data-film-id")
|
|
|
|
letterboxd_ids = response.xpath("//li[contains(@class, 'poster-container') or contains(@class, 'film-detail')]/div/@data-film-id")
|
|
|
|
items = []
|
|
|
|
items = []
|
|
|
|
for letterboxd_id in letterboxd_ids:
|
|
|
|
for letterboxd_id in letterboxd_ids:
|
|
|
|
slugs = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/@data-film-slug")
|
|
|
|
slugs = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/@data-film-slug")
|
|
|
|
items.append((letterboxd_id, slugs[0]))
|
|
|
|
notes = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/div/p/text()") if list_url.endswith(("/detail", "/detail/"))
|
|
|
|
slugs = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/@data-film-slug")
|
|
|
|
|
|
|
|
notes = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/div/p/text()")
|
|
|
|
|
|
|
|
ratings = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']//span[contains(@class, 'rating')]/@class")
|
|
|
|
ratings = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']//span[contains(@class, 'rating')]/@class")
|
|
|
|
years = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/h2/small/a/text()")
|
|
|
|
years = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/h2/small/a/text()")
|
|
|
|
rating = None
|
|
|
|
rating = None
|
|
|
|