Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡️ CamGear: Added a new YT_backend Internal Class with YT-DLP backend #274

Merged
merged 5 commits into from
Dec 4, 2021

Conversation

abhiTronix
Copy link
Owner

@abhiTronix abhiTronix commented Dec 3, 2021

Description

This PR implements YT_backend a new CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs.

Notable Changes:

  • ✨ Implemented YT_backend a new CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs.
  • ✨ Added support for pipeling (live) video-frames from all yt-dlp supported streaming sites: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md#supported-sites
  • ⚡️ Implemented algorithm from scratch for auto-extracting resolution specific streamable URLs for pipelineing.
  • ⚡️ Implemented logic for auto-calculating best and worst resolutions.
  • ✨ Added is_livestream global YT_backend parameters.
  • ✨ Added default options for yt-dlp for extracting info_dict(metadata) of the video as a single JSON line.
  • ✨ Added new ytv_metadata global parameter to CamGear for accessing video's metadata(such as duration, title, description) on-the-go.
  • 💥 Removed automatic enforcing of GStreamer backend for YouTube-livestreams and made it optional.
  • ⚰️ Completely removed old logic for extracting streams using pafy.
  • ⚠️ Playlists are still unsupported.
  • CamGear:
  • 💥 Removed streamlink backend support from stream_mode in favor of more reliable CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs.
  • ⚰️ Removed all dead code related to streamlink backend.
  • 🐛 Fixed KeyError Bug for missing attributed in meta_data json in some streaming sites.
  • 💥 CamGear will raise ValueError if streaming site URL is unsupported by yt-dlp backend.
  • 💥 CamGear will raise ImportError if yt-dlp isn't installed and stream_mode is enabled.
  • Docs:
    • 📝 Added complete usage docs with new CamGear's Internal Class with YT-DLP backend.
    • 🚩 Updated CamGear parameters.
    • 📝 Added instructions to extract video's metadata.
    • 📝 Updated Admonitions with related information.
    • 🔥 Removed any pafy and streamlink references.
    • 💄 Updated Functional Block Diagram(gears_fbd.png) image.
    • ♿️ Updated installation instructions.
  • ⚰️ Removed dead code.
  • 💡 Updated code comments.
  • Helper:
    • 💥 Removed restore_levelnames method.
    • 💥 Removed youtube_url_validator helper method.
  • Setup.py:
    • ➖ Removed streamlink dependency.
    • ➖ Removed pafy dependency.
    • 🎨 Removed pyzmq from latest_version group.
    • 🏷️ Updated SEO Keywords.
  • Maintenance:
    • 🔥 Removed unused imports.
    • 🔊 Updated logging messages.
    • 💡 Updated code comments.
  • CI:
    • 💚 Restored test_stream_mode CamGear test.
    • 👷 Updated Streaming Sites link.
    • 👷 Added more tests cases.

Requirements / Checklist

Related Issue

#273
#244
#133

Context

This PR is going to implement CamGear's Internal YT-DLP backend class based on yt-dlp backend for extracting metadata from YouTube API.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

…Fixes #273)

- ✨ Implemented `YT_backend` a new CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs.
- ✨ Added support for pipeling (live) video-frames from all yt-dlp supported streaming sites: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md#supported-sites
- ⚡️ Implemented algorithm from scratch for auto-extracting resolution specific streamable URLs for pipelineing.
- ⚡️ Implemented logic for auto-calculating `best` and `worst` resolutions.
- ✨ Added `is_livestream` and `is_valid_source` global YT_backend parameters.
- ✨ Added default options for yt-dlp for extracting info_dict(metadata) of the video as a single JSON line.
- ✨ Added new `ytv_metadata` global parameter to CamGear for accessing video's metadata(such as duration, title, description) on-the-go.
- 💥 Removed `STREAM_PARAMS` dict attribute and replaced it with `YT_STREAM_PARAMS` and `SL_STREAM_PARAMS` backend specific attributes.
- 💥 Removed automatic enforcing of GStreamer backend for YouTube-livestreams and made it optional.
- ⚰️ Completely removed old logic for extracting streams using pafy.
- ⚠️ Playlists are still unsupported.
- 🔊 Updated logging messages.
- 💡 Updated code comments.

Helper: 💥 Removed `youtube_url_validator` helper method.

Setup:
- ➖ Removed `pafy` dependency.
- 🎨 Removed `pyzmq` from latest_version group.
- 🔥 Removed `streamlink` backend support from `stream_mode` in favor of more reliable CamGear's Internal YT-DLP backend class for extracting metadata from Streaming URLs.
- ⚰️ Removed all dead code related to streamlink backend.
- 🚩 Removed `SL_STREAM_PARAMS` attribute support.
- 🚩 Removed `is_valid_source` global parameter from YT_backend class.
- ⏪️ Reverted `YT_STREAM_PARAMS` attribute to `STREAM_PARAMS` again.
- 🐛 Fixed KeyError Bug for missing attributed in meta_data json in some streaming sites.
- 💥 CamGear will raise `ValueError` if streaming site URL is unsupported by yt-dlp backend.
- 💥 CamGear will raise ImportError if `yt-dlp` isn't installed.

Helper:
- 💥 Removed `restore_levelnames` method.

Setup.py:
- ➖ Removed `streamlink` dependency.

Maintenance:
- 🔥 Removed unused imports.
- 👷 Updated Streaming Sites link.
- 👷 Added more tests cases.

CamGear:
- 🐛 Fixed KeyError Bug in Internal YT-DLP backend class.
@abhiTronix abhiTronix added ENHANCEMENT ⚡ New Feature/Addition/Improvement WORK IN PROGRESS 🚧 currently been worked on. DOCS : PENDING ✍🏻 Docs still pending for this Issue/PR! PENDING TESTS 🧪 Waiting for CI tests to complete successfully. labels Dec 3, 2021
@abhiTronix abhiTronix added this to the 0.2.4 milestone Dec 3, 2021
@abhiTronix abhiTronix self-assigned this Dec 3, 2021
@abhiTronix abhiTronix added this to In progress in VidGear v0.2.4 via automation Dec 3, 2021
@abhiTronix abhiTronix linked an issue Dec 3, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #274 (522aa02) into testing (cd481c1) will increase coverage by 0.56%.
The diff coverage is 93.50%.

Impacted file tree graph

@@             Coverage Diff             @@
##           testing     #274      +/-   ##
===========================================
+ Coverage    94.60%   95.16%   +0.56%     
===========================================
  Files           16       16              
  Lines         3040     3063      +23     
===========================================
+ Hits          2876     2915      +39     
+ Misses         164      148      -16     
Impacted Files Coverage Δ
vidgear/gears/helper.py 93.93% <ø> (-0.13%) ⬇️
vidgear/gears/camgear.py 95.58% <93.50%> (+10.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd481c1...522aa02. Read the comment docs.

- 📝 Added complete usage docs with new CamGear's Internal Class with YT-DLP backend.
- 🚩 Updated CamGear parameters.
- 📝 Added instructions to extract video's metadata.
- 📝 Updated Admonitions with related information.
- 🔥 Removed any `pafy` and `streamlink` references.
- 💄 Updated Functional Block Diagram(`gears_fbd.png`) image.
- ♿️ Updated installation instructions.
- ⚰️ Removed dead code.
- 💡 Updated code comments.

🏷️ Setup.py: Updated Keywords.
@abhiTronix abhiTronix removed the DOCS : PENDING ✍🏻 Docs still pending for this Issue/PR! label Dec 4, 2021
@abhiTronix abhiTronix merged commit dc26c00 into testing Dec 4, 2021
VidGear v0.2.4 automation moved this from In progress to Done Dec 4, 2021
@abhiTronix abhiTronix deleted the development branch December 4, 2021 06:31
@abhiTronix abhiTronix added SOLVED 🏁 This issue/PR is resolved now. Goal Achieved! and removed WORK IN PROGRESS 🚧 currently been worked on. labels Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment