Commit graph

14 commits

Author SHA1 Message Date
6a570f2f12 Fail backup when a fresh export cannot be requested 2026-10-08 09:39:49 +01:00
56dff875e7 Fix bot detection causing blank page from Goodreads
Goodreads returns an empty HTML page to headless browsers it identifies
as automated (navigator.webdriver=true, AutomationControlled feature).
This caused the Export Library button to never be found.

- Launch Chromium with --disable-blink-features=AutomationControlled
- Set a realistic user agent and viewport on the browser context
- Strip navigator.webdriver via an init script
- Guard the logged_in check so a blank page isn't mistaken for a session
- Wait for networkidle before querying the export button, and use
  wait_for(visible) instead of is_visible() to tolerate JS render delay
- Add CSS class fallback (button.js-LibraryExport) if role lookup fails
- Add AGENTS.md documenting the bot detection pattern and export flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 11:53:42 +00:00
ae932b26b9 Improve backup flow to wait for export readiness instead of fixed delay
Replace the old fixed 10-minute wait with readiness-based waits on the export link state, so exports start downloading as soon as Goodreads marks them ready.

Also harden login selectors/timeouts, add fallback CSV fetching when browser download events do not fire, and add CLI modes for --check-login, --login-only, --no-headless, and --har-path.

Closes #3
2026-02-17 13:14:57 +00:00
497e04a26f Add docstring 2024-04-17 10:05:05 +01:00
99844005d6 Update code style 2024-04-17 10:02:26 +01:00
c1cbfd5f79 Split code into smaller functions 2024-04-17 09:55:24 +01:00
4ac90301d5 Backup should run headless 2024-04-17 09:55:00 +01:00
777ede64f8 Reformat code with black 2024-04-17 09:12:11 +01:00
0ba43ea993 Add old code for downloading recommendations 2024-04-17 09:11:41 +01:00
271251c1f4 Fix login
Closes: #2
2024-04-17 08:59:36 +01:00
b678e6fa68 First attempt, seems to work
Closes: #1
2023-12-22 15:53:55 +00:00
1ac3228959 Add gitignore 2023-12-22 10:56:05 +00:00
d26c9fcd2f Fix line endings 2023-12-22 10:55:55 +00:00
68ff0ae66a Initial commit 2023-12-19 10:14:38 +00:00