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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ie/twitter:broadcast] Support --wait-for-video #8475

Merged
merged 5 commits into from Nov 11, 2023

Conversation

bashonly
Copy link
Member

@bashonly bashonly commented Oct 30, 2023

Closes #8473

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

Copilot Summary

馃 Generated by Copilot at e636a95

Summary

馃晵馃攧馃敡

Improved periscope and twitter extractors to handle live broadcasts better. Added live_status field to indicate the current state of the video, and skipped downloading videos that are not yet available.

Sing, O Muse, of the cunning code review
That made the TwitterBroadcastIE more wise
And taught it to avoid the videos due
That have not yet appeared before the eyes.

Walkthrough

  • Import traverse_obj function from utils.py to access nested values in a dictionary or a list (link)
  • Replace is_live field with live_status field in _parse_broadcast_data function to handle different states of broadcasts (link, link)
  • Update timestamp and release_timestamp fields in _parse_broadcast_data function to parse ISO 8601 date string and convert milliseconds to seconds (link)
  • Return early from _real_extract function in TwitterBroadcastIE class if live_status is is_upcoming to avoid unnecessary requests and errors (link)

@bashonly bashonly added the site-enhancement Feature request for some website label Oct 30, 2023
yt_dlp/extractor/periscope.py Outdated Show resolved Hide resolved
@bashonly bashonly added pending-review PR needs a review and removed pending-review PR needs a review labels Nov 11, 2023
@bashonly bashonly self-assigned this Nov 11, 2023
@bashonly bashonly merged commit f6e9709 into yt-dlp:master Nov 11, 2023
16 checks passed
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-enhancement Feature request for some website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add --wait-for-video suport twitter/x
2 participants