$ show RileyXX/IMDB-Trakt-Syncer
IMDB-Trakt-Syncer is a Python CLI application that synchronizes user watchlists, ratings, reviews, and watch history bidirectionally between Trakt.tv and IMDb. The system uses the Trakt API (OAuth2) for all Trakt operations and Selenium WebDriver to automate browser interactions with IMDb, since IMDb lacks a public API for these operations. The architecture is a monolithic script with modular helper modules: credential management, Chrome/Chromedriver auto-download, Trakt data fetching, IMDb data scraping via CSV exports and page interaction, and robust error handling with retry logic. The main entry point is the `main()` function in `IMDBTraktSyncer/IMDBTraktSyncer.py`, which orchestrates the entire sync flow: version check, credential prompt, browser setup, data retrieval from both services, conflict resolution, and bidirectional sync execution. External dependencies include the `requests` library for Trakt API calls and `selenium` for browser automation; Chrome and Chromedriver binaries are automatically downloaded and cached. The tool supports optional features like removing watched items from watchlists, marking rated items as watched, and removing watchlist items older than a configurable number of days.
The LLM identified 2 files worth highlighting for reuse:
Provides robust retry mechanisms for HTTP requests (with exponential backoff and respect for Retry-After headers) and Selenium page loads (handling network errors, timeouts, and retryable HTTP status codes). Also includes reusable data filtering functions (deduplication by IMDB_ID, sorting by date, filtering by comment length) that could be extracted for other sync or ETL projects. The `make_request_with_retries` function is a standalone, well-structured HTTP client with configurable retries and timeouts.
Manages the lifecycle of Chrome and Chromedriver binaries: checks for the latest stable version from Google's JSON endpoint, downloads and extracts platform-specific archives, caches them by version, removes old versions, and grants proper file permissions. This pattern is reusable for any Selenium-based project that needs to manage browser dependencies without relying on system-installed browsers or Selenium Manager.