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

[ie/triller] Fix unlisted video extraction #7670

Merged
merged 2 commits into from
Jul 23, 2023

Conversation

bashonly
Copy link
Member

@bashonly bashonly commented Jul 22, 2023

Triller's brilliant API started returning a string (not boolean) value of "true"/"false" in the followed_by_me field, which made the error handling for private profiles useless.

This PR also removes the private check from video extraction, since apparently "private" actually means "unlisted", and private videos can be watched/downloaded as long as the video URL is known.

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 3d55bfe

Summary

🔀🛡️🧰

Refactored the Triller extractor to handle privacy and block checks in the specific subclasses. Simplified the user info extraction with traverse_obj.

Sing, O Muse, of the skillful coder who refined
The Triller extractor, and from the base class removed
The _check_user_info method, that no longer suited
The subclasses, where the privacy and block status he proved.

Walkthrough

  • Remove _check_user_info method from TrillerBaseIE class, as it is no longer used by subclasses (link)
  • Simplify logic for checking user info in _real_extract method of TrillerIE class, using API response fields directly (link)
  • Improve error handling and field parsing in _real_extract method of TrillerUserIE class, using traverse_obj utility function and converting string values to booleans (link)

@bashonly bashonly added the site-bug Issue with a specific website label Jul 22, 2023
yt_dlp/extractor/triller.py Outdated Show resolved Hide resolved
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
@bashonly bashonly merged commit 39837ae into yt-dlp:master Jul 23, 2023
13 checks passed
@bashonly bashonly deleted the fix/triller-private branch December 7, 2023 15:12
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