Skip to content

Fix download only one, randomize user agents#188

Merged
NotJoeMartinez merged 3 commits intomainfrom
fix-download-only-one
Jul 4, 2025
Merged

Fix download only one, randomize user agents#188
NotJoeMartinez merged 3 commits intomainfrom
fix-download-only-one

Conversation

@NotJoeMartinez
Copy link
Owner

This pull request introduces several enhancements to the yt-fts project, including version updates, improved handling of HTTP headers, and better error messaging. The most significant changes involve adding dynamic user-agent selection for HTTP requests, refining error handling, and improving subtitle extraction logic.

Version Update:

  • Updated the project version from 0.1.61 to 0.1.62 in pyproject.toml and src/yt_fts/__init__.py. [1] [2]

HTTP Header Enhancements:

  • Introduced a _user_agents property in src/yt_fts/download/download_handler.py to provide a list of user agents, enabling dynamic selection for HTTP headers.
  • Updated get_videos_list, get_playlist_data, and get_vtt methods to use the dynamic user-agent selection via HTTP headers instead of a static 'random' value. [1] [2] [3]

Error Handling Improvements:

  • Enhanced error messaging for scenarios such as missing subtitles and failed attempts, using colored console output for better readability.
  • Updated warning messages to clarify errors during subtitle extraction, replacing "Error" with "Warning".

Subtitle Extraction Logic:

  • Added logic to check for available subtitles and automatic captions before attempting downloads, ensuring better handling of cases where subtitles are unavailable.

Code Cleanup and Import Organization:

  • Reorganized imports in src/yt_fts/download/download_handler.py for better readability and maintainability.

@NotJoeMartinez NotJoeMartinez merged commit a1f28de into main Jul 4, 2025
3 checks passed
@NotJoeMartinez NotJoeMartinez deleted the fix-download-only-one branch July 4, 2025 05:46
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.

1 participant