From 3b4d0f7d21a3e817a7b8525062bb6b2840e245c3 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 31 Mar 2022 16:31:22 -0400 Subject: [PATCH] [48] more fixes --- VERSION | 2 +- modules/letterboxd.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 207dd692..c5a29148 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.2-develop47 +1.16.2-develop48 diff --git a/modules/letterboxd.py b/modules/letterboxd.py index 21953cd8..2f355d03 100644 --- a/modules/letterboxd.py +++ b/modules/letterboxd.py @@ -19,9 +19,9 @@ class Letterboxd: items = [] for letterboxd_id in letterboxd_ids: 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()") if list_url.endswith(("/detail", "/detail/")) - 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()") + 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/")) else None + ratings = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']//span[contains(@class, 'rating')]/@class") if list_url.endswith(("/detail", "/detail/")) else None + years = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/h2/small/a/text()") if list_url.endswith(("/detail", "/detail/")) else None rating = None if ratings: match = re.search("rated-(\\d+)", ratings[0])