Draft
Conversation
- Automate login, product setup, PDF upload, and checkout navigation - Fix card dimensions to 2.73" x 3.71" for Premium Euro Poker with bleed - Use Ghostscript -dNOSAFER flag for PDF/X-1a conversion - Add placeholder cover image for product form - Replace sleep timers with dynamic element waits
Author
Collaborator
|
thanks - i haven't looked at the code yet but this sounds exciting! i'll look into the PDF formatting issue a bit and will report back if i find anything. not very keen to bundle/install a third-party command tool alongside autofill, i'd much prefer for the autofill binary to be totally standalone. |
JPEG has a 64KB limit for XMP data in a single APP1 segment. Some source images have XMP data exceeding this limit, causing "XMP data is too long" errors when saving. Since XMP is purely metadata and doesn't affect the visual content, we strip it before saving.
- Replace standard selenium Chrome driver with undetected-chromedriver - Add aggressive polling (500ms) for Cloudflare challenge detection - Add auto-click attempt for Turnstile checkbox in iframe - Fix login modal selector to target correct link - Remove set_network_conditions calls (potential detection vector) - Add setuptools dependency for Python 3.13 compatibility
- Remove unused ChromeOptions import - Add _detect_chrome_version() to query installed Chrome version - Support macOS, Windows, and Linux version detection - Pass detected version to undetected-chromedriver to fix version mismatch
- Add JavaScript patches to hide automation traces (webdriver property, chrome object, plugins, languages, ChromeDriver detection variables) - Add --disable-blink-features=AutomationControlled flag - Remove ineffective focus workaround that caused unnecessary delays
…ring polling Selenium's implicit wait (5s) was causing long delays between solving the Cloudflare CAPTCHA and clicking the login button. Fixed by temporarily disabling implicit wait in polling methods: - _try_click_turnstile_checkbox() - _is_cloudflare_challenge_active() - _is_site_loaded() - is_dtc_user_authenticated() - click_element_polling()
These methods were part of a failed attempt to bypass bot detection by triggering visibility/focus events. They are no longer called: - _simulate_human_behavior() - _trigger_visibility_change_via_minimize() - _perform_tab_switch_workaround() - _perform_login_focus_workaround() Also added commit/cleanup workflow guidance to CLAUDE.md.
The 'Click here after uploading your files' button starts with an onclick handler that shows an error and returns false. After server-side upload validation, the page JS replaces this with the actual form submit handler. Previously the click fired before this replacement, causing the page to not navigate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for automating card orders on DriveThruCards, including PDF generation and browser-based order submission. It's not fully polished yet. I still plan to clean up the Selenium automation and add more tests and better documentation. I started the PR now because it is in an MVP state and I wanted to prompt discussion on the methods I used.
Important
This PR adds a free Command Line Tool called Ghostscript as a dependency to convert PDFs to DriveThruCards' desired format: "PDF/X-1a 2003". This format is typically only producible by Adobe Acrobat and other such professional applications. To avoid this paid and inconsistent dependency, I instead opted to use Ghostscript to convert the existing PDF output to something DTC compatible. To avoid having to bundle OS-specific binaries of Ghostscript with autofill, I instead elected to add a step at the beginning of the DriveThruCards option in the CLI to download and install the Ghostscript command line for the user. Unfortunately, there are no Python libraries that can do the same job.
Summary
Changes
PDF Generation:
Browser Automation:
Checklist
pre-commitand installed the hooks withpre-commit installbefore creating any commits.