Skip to content

Commit

Permalink
add logs to letterboxd
Browse files Browse the repository at this point in the history
  • Loading branch information
mzrimsek committed Feb 28, 2024
1 parent 394e39b commit 77b849b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions letterboxd_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ def get_collection_data_from_letterboxd_list(list_id: str):
list_name = None

while True:
print(f"Getting page {page_number} of {list_id}")
request_base = f'https://letterboxd.com/{list_id}/detail/by/release-earliest/page/{page_number}/'
res = requests.get(request_base)

if list_name is None:
list_name = html.unescape(res.text.split('<h1 class="title-1 prettify">')[1].split("</h1>")[0]).strip()

page_movies = res.text.split('film-detail-content">')[1:]
print(f"Found {len(page_movies)} movies")

if len(page_movies) == 0:
return {"list_name": list_name, "movies": movies}
Expand Down

0 comments on commit 77b849b

Please sign in to comment.