Cache Goodreads data and slow down bulk requests
This commit is contained in:
1 parent
af73bb5b26
commit
7ef3a29ece
6 files changed
+162
-13
No files matched your search
@@ -143,9 +143,7 @@ def scrape_series(url: str) -> dict:
|
||||
if not identifier:
|
||||
raise ValueError(f"not a Goodreads series url: {url}")
|
||||
page = goodreads.download_page(url)
|
||||
reason = goodreads.blocked_reason(page.text)
|
||||
if reason:
|
||||
raise ValueError(reason)
|
||||
goodreads.raise_if_blocked(page)
|
||||
|
||||
entries = entries_from_react_props(page.text) or entries_from_next_data(page.text) or entries_from_links(page.text)
|
||||
entries = unique_entries(entries)
|
||||
|
||||
Reference in new issue
Block a user