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

[TikTok] Add support #6708

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

CasualYT31
Copy link

@CasualYT31 CasualYT31 commented Dec 22, 2024

This PR adds support for TikTok slideshows.

List of supported URL formats:

  • /photo/
  • /video/
  • vm.tiktok.com
  • vt.tiktok.com
  • /t/
  • User profiles (tiktok.com/@username)

I haven't performed extensive testing yet so there could well be edge cases that aren't covered by the extractor as it stands right now. I have tested with cookies, however, and I am able to extract photos from private accounts (as well as detect when cookies are required to extract photo URLs).

Closes:
#3061
#4177

gallery_dl/text.py Outdated Show resolved Hide resolved
test/results/tiktok.py Outdated Show resolved Hide resolved
@CasualYT31
Copy link
Author

CasualYT31 commented Dec 23, 2024

Before merging, I'd like to try supporting user profile scraping.

I'll likely use yt-dlp to gather all of the links up and then feed them into the base extractor using urls(). Ideally I would replicate the logic in yt-dlp instead but it's quite a bit more work, plus I don't think it's unreasonable to make yt-dlp a requirement for this one feature seeing as users are likely to have it installed already.

I'll introduce a new tiktok-range option that can be used to prevent scraping more pages than necessary for huge accounts. This differs from the ordinary --range option as that dictates which extracted links to download, whereas -o tiktok-range will tell the TikTok extractor which links to extract.

I'll also think about supporting the download of profile pictures.

Once I've completed this, or decided that it's out of the scope of this PR, I'd say it's ready for merging, barring any additional feedback 👍

@CasualYT31 CasualYT31 requested a review from mikf December 23, 2024 17:28
In my limited experience, this doesn't mean that gallery-dl can't download the photo post (but this could mean that you can't download the audio)
},
{
"#url" : "https://www.tiktok.com/@chillezy",
"#comment" : "User profile",
Copy link
Author

@CasualYT31 CasualYT31 Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should admit that user profile extraction can be a tiny bit flakey. Very occasionally yt-dlp will fail to extract user profile information and there's not a lot gallery-dl can do about it. Is it okay to keep these tests in, or should they be skipped?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants