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

[extractor/twitcasting] Twitcasting Live webpage changed #8574

Merged
merged 10 commits into from Nov 15, 2023

Conversation

JC-Chung
Copy link
Contributor

@JC-Chung JC-Chung commented Nov 13, 2023

The old _search_regex in TwitCastingLiveIE is no longer available.

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

r'data-type="movie" data-id="(\d+)">',
r'tw-sound-flag-open-link" data-id="(\d+)" style=',
r'(?s)(<span\s*class="tw-movie-thumbnail-badge"\s*data-status="live">\s*LIVE)' and
r'(?s)<a\s+class="tw-movie-thumbnail"\s*href="/[^/]+/movie/(?P<video_id>\d+)"\s*>.+?</a>' now no available in webpage.

Fixes #

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 06c1eb6

Summary

馃悰馃毃馃摵

Improve live stream extraction and error handling for twitcasting extractor. Use HTML attributes instead of regexes to get stream status and id.

Sing, O Muse, of the skillful twitcasting extractor
That deftly discerns the live streams from the silent ones
And gracefully handles the errors of offline users
With attributes more trustworthy than the old regexes

Walkthrough

  • Add a check for the data-is-onlive attribute to determine the live status of the user (link, link)
  • Raise a UserNotLive exception if the user is not live, instead of returning an empty playlist (link)
  • Add another regex to match the data-movie-id attribute as a possible source of the live ID (link)

The old `_search_regex` in TwitCastingLiveIE is no longer available.
yt_dlp/extractor/twitcasting.py Outdated Show resolved Hide resolved
yt_dlp/extractor/twitcasting.py Outdated Show resolved Hide resolved
@bashonly bashonly added site-bug Issue with a specific website pending-fixes PR has had changes requested labels Nov 13, 2023
JC-Chung and others added 2 commits November 13, 2023 22:41
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
@bashonly bashonly added pending-review PR needs a review and removed pending-fixes PR has had changes requested pending-review PR needs a review labels Nov 13, 2023
@bashonly bashonly self-assigned this Nov 13, 2023
yt_dlp/extractor/twitcasting.py Outdated Show resolved Hide resolved
yt_dlp/extractor/twitcasting.py Outdated Show resolved Hide resolved
JC-Chung and others added 4 commits November 13, 2023 23:57
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
@bashonly bashonly self-requested a review November 14, 2023 23:32
@bashonly bashonly merged commit 2325d03 into yt-dlp:master Nov 15, 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-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants