How lencodigitexer/yadisk-dl works
Project Type and Purpose
• This is a command-line utility (CLI) for mass-downloading photos from Yandex.Disk. It is composed of three sequential modules (authentication, link collection, download), each packaged as a standalone executable.
High-Level Components
a. User / CLI
• The human operator who invokes each executable in turn.
b. Auth Module (00auth.py → 01_ya_auth.exe)
• Uses Selenium and a real browser to log into Yandex.Disk.
• Outputs: session.pkl (serialized session credentials).
c. Link-Collection Module (01getlinks.py → 02_ya_getlinks.exe)
• Reads session.pkl.
• Crawls the user’s Yandex.Disk via HTTP requests (Requests library).
• Persists photo URLs into SQLite database links.db.
d. Download Module (02download.py → 03_ya_download.exe)
• Reads links.db.
• Spawns up to 10 worker threads to fetch each URL and write files into downloads/.
e. Data Stores
• session.pkl – authentication state.
• links.db – SQLite database of photo URLs.
• downloads/ – local filesystem directory for images.
f. External Service
• Yandex.Disk API / web endpoints (target of HTTP calls).
g. Build & CI Pipeline
• pyproject.toml / requirements.txt – dependency manifests.
• GitHub Actions (build.yml) – runs tests and pyinstaller packaging.
• PyInstaller – produces one-file executables for each module.
Interactions and Data Flow
• Step 1: User → Auth Module → Browser (Selenium) → Yandex.Disk → session.pkl
• Step 2: User → Link-Collection Module → session.pkl → Yandex.Disk API → links.db
• Step 3: User → Download Module → links.db → Yandex.Disk API → downloads/
• CI: Push to repo → GitHub Actions → PyInstaller → Release binaries
Architectural Patterns & Principles
• Pipeline / Chain of Responsibility: three distinct stages, each taking the output of the previous.
• Separation of concerns: authentication, metadata gathering, and file I/O are isolated.
• Offline data storage: use of session file and local SQLite cache to decouple external calls.
• Concurrency in download stage via thread pool to maximize throughput.
Detailed Items to Capture
• The exact file names of the executables (01_ya_auth.exe, etc.).
• The libraries involved (Selenium, Requests, SQLite3, threading/TQDM).
• The CI workflow file (.github/workflows/build.yml) and its purpose.
• The packaging step (PyInstaller) and where outputs go (releases).