Skip to content

feat: Google Drive downloads, ffmpeg resilience, per-task temp isolation - #2652

Open
AbdelazizBarhoumi wants to merge 1 commit into
JunkFood02:mainfrom
AbdelazizBarhoumi:feat/google-drive-downloads-ffmpeg-hardening
Open

AbdelazizBarhoumi wants to merge 1 commit into
JunkFood02:mainfrom
AbdelazizBarhoumi:feat/google-drive-downloads-ffmpeg-hardening

Conversation

@AbdelazizBarhoumi

Copy link
Copy Markdown

Google Drive support:

  • GoogleDriveUrl parses share/open/uc/usercontent links into typed DriveError failures (private, not found, quota, folder) localized via asUserFacing()
  • GoogleDriveResolver pre-resolves Drive files to a direct download URL with an OkHttp confirm-form follow; resolution runs at both info-fetch and download time because confirm tokens expire quickly
  • DownloadUtil rewrites the resolved URL onto VideoInfo so yt-dlp never sees the share page; original URL preserved for display

FFmpeg resilience:

  • FfmpegUtil self-tests the bundled libffmpeg.so before every download that needs it and fails fast with an actionable message instead of yt-dlp's opaque 'device not found' output
  • Troubleshooting page gains an FFmpeg status card with re-init
  • FFmpeg/Aria2c init failures no longer abort app startup

Thumbnail temp race fix (intermittent ENOENT on .jpg):

  • DownloaderV2 runs up to 3 concurrent tasks, all previously sharing Download/Seal/tmp via -P temp:; yt-dlp reuses files it finds there (existing_file), so same-named thumbnails/.part files were deleted or moved mid-run by sibling tasks
  • Each task now gets its own temp dir (task_<hash(taskId)>), removed on success and kept on failure so retries can still resume
  • Reproduced locally: shared temp loses cross-task thumbnails in 10/12 concurrent runs, isolated temp 0/6

Also: values-be video_count lint fix, release keystore ignored. 23 unit tests (FfmpegUtil, GoogleDriveResolver with local MiniHttpServer, GoogleDriveUrl) + lint 0 errors + release build green.

Google Drive support:
- GoogleDriveUrl parses share/open/uc/usercontent links into typed
  DriveError failures (private, not found, quota, folder) localized
  via asUserFacing()
- GoogleDriveResolver pre-resolves Drive files to a direct download
  URL with an OkHttp confirm-form follow; resolution runs at both
  info-fetch and download time because confirm tokens expire quickly
- DownloadUtil rewrites the resolved URL onto VideoInfo so yt-dlp
  never sees the share page; original URL preserved for display

FFmpeg resilience:
- FfmpegUtil self-tests the bundled libffmpeg.so before every download
  that needs it and fails fast with an actionable message instead of
  yt-dlp's opaque 'device not found' output
- Troubleshooting page gains an FFmpeg status card with re-init
- FFmpeg/Aria2c init failures no longer abort app startup

Thumbnail temp race fix (intermittent ENOENT on .jpg):
- DownloaderV2 runs up to 3 concurrent tasks, all previously sharing
  Download/Seal/tmp via -P temp:; yt-dlp reuses files it finds there
  (existing_file), so same-named thumbnails/.part files were deleted
  or moved mid-run by sibling tasks
- Each task now gets its own temp dir (task_<hash(taskId)>), removed
  on success and kept on failure so retries can still resume
- Reproduced locally: shared temp loses cross-task thumbnails in 10/12
  concurrent runs, isolated temp 0/6

Also: values-be video_count lint fix, release keystore ignored.
23 unit tests (FfmpegUtil, GoogleDriveResolver with local MiniHttpServer,
GoogleDriveUrl) + lint 0 errors + release build green.
Copilot AI balanced review requested due to automatic review settings September 30, 2026 03:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants