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

[extractor/tiktok] Fix and improve metadata extraction #6777

Merged
merged 6 commits into from Apr 13, 2023

Conversation

bashonly
Copy link
Member

@bashonly bashonly commented Apr 11, 2023

  • Fixes metadata extraction from video webpages (_parse_aweme_video_web):

    • creator was failing to be extracted (addresses #6483 (comment))
    • thumbnails were failing to be extracted
    • id extraction was not fatal, and the value always matched from the URL could easily be passed as an argument to _parse_aweme_video_web
  • Fixes some potentially fatal metadata extraction from mobile API responses (_parse_aweme_video_app):

    • thumbnails extraction KeyErrored if a Douyin API response was received
    • author_info = aweme_detail.get('author', {}) should be aweme_detail.get('author') or {} since author can be None, etc
  • Extracts the secondary user ID as channel_id from both web and app, which will be useful/necessary for a TikTokUserIE fix (it already would be useful for [extractor/tiktok] Fix TikTokUserIE #4996)

  • Refactors and attempts to improve readability

  • Adds a webpage-only test case, updates tests

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?

@bashonly bashonly added the site-bug Issue with a specific website label Apr 11, 2023
yt_dlp/extractor/tiktok.py Outdated Show resolved Hide resolved
@bashonly bashonly merged commit 9259369 into yt-dlp:master Apr 13, 2023
11 checks passed
@bashonly bashonly deleted the fix/tiktok-meta branch April 18, 2023 02:46
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