-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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.com - New URL #23264
Comments
There is already a PR #22838 that fixes this issue. PR working status for youtube-dl |
No it does not. |
@yan12125 this one is closed... |
For anybody wondering: (Inspect changes here. If you don't use pipx yet, give it a try! Plain pip should work fine too.) |
@bpenven #22838 actually does fix this, I've built 2020.07.28 with the changes to extractors.py and tiktok.py patched in. @skyme5 I'm not sure if it's just my setup but in TikTokBaseIE/tiktok.py this doesn't work, the url variable ends up empty:
I've solved that by doing this:
I don't really code in python so I'm not really sure why your code wouldn't work to begin with, it seems perfectly valid to me. If referencing the 0th element of a list like that doesn't work you've done the same thing here as well: 'thumbnail': try_get(video_info, lambda x: x['covers'][0], str), but you probably just end up with no thumbnail whereas url being empty causes the below: WARNING: "url" field is missing or empty - skipping format, there is an error in extractor File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 464, in _real_main File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2019, in download |
Doesn't that mean that pull won't be merged because the youtube-dl project supports python 2.6/2.7? From the project page:
[debug] Python version 2.7.16 (CPython) |
I think this is due to comparison of Removing the formats.append({
'url': try_get(video_info, lambda x: x['video']['urls'][0]),
... Fixed in #22838 |
That has nothing to do with downloading the video. |
Still have issues with this (using ver 2020.07.28). Any other info I can add to help?
|
@lihuelworks, PR #22838, fixes this issue which is still not merged yet, you can install this PR described here or you can replace the |
I 'm not sure I'm getting you @llacb47 . The download fails because of the captcha but that has nothing to do with downloading the video? |
@skyme5 have tried @lihuelworks url before posting? The very reason of my first post is that I was under the impression that it doesn't work either. Best regards |
Look at the source code, the video URL is literally there. There is no captcha bypass needed to get the video. |
My bad (or not) I had to checkout the tiktok branch to make it work and didn't know it existed. git clone https://github.com/skyme5/youtube-dl.git
cd youtube-dl/youtube_dl
git checkout origin/tiktok
python __main__.py url |
can it be used to download all user videos ? |
@MohamedElashri yes it worked afterwards |
It works! Hope it gets implemented soon, I'm really missing that functionality on mpv. |
I got the error |
Try using pip instead of pipx. |
The command worked with pip3 (python3-pip). Thank you! |
But watermarkless fork of @runraid do not works now ( |
@Al-Muhandis It did work for older videos (before July 2020 I think) last time I checked 🤔 |
Yes, I noticed. It doesn't work for new videos ( |
@notpushkin the solution for that is to clone the current ytdl-org/youtube-dl repo and replace youtube_dl/extractor/tiktok.py with skyme5's one and then make/install. |
@dtaust Makes sense, but I'm too lazy personally :') (which is the reason I came up with the one-liners above) |
@blackjack4494 why can't it be merged here? The recent youtube-dl version was released just recently and the tiktok support is not fixed in it. |
@VasiliPupkin256 that PR has been opened for nearly 328 days and still not merged by @dstftw. youtube-dl with tiktok download support is available at blackjack4494/youtube-dlc |
Really confused about why tiktok remains broken for so long. Can Sergey @dstftw @remitamine or any of the other maintainers give us some visibility into what's happening and why? Let's make it easy, check one of the following:
|
Hi! I downloaded link https://v16-web-newkey.tiktokcdn.com/blabla in browser and I got error 403. After I added header "Referer: https://www.tiktok.com/blabla" in my curl downloader example and I can downloaded tiktok video. We need to add header Referer when you download media link |
|
For others as a workaround, here are
|
Where does "https://v16-web-newkey.tiktokcdn.com/....." come from ? |
With the TikTok video open in the browser, right click it and inspect the element. Look for an element with |
If installing via But if |
@sjmueller It is just a script file pointing to main installation of youtube-dl, Yes, you can directly make changes to |
Issue fixed as well in haruhi-dl, a libre fork of youtube-dl. |
@selfisekai @sjmueller I think tiktok.com is using CAPTCHA to prevent scraping. |
@skyme5 they do use some 'verify' tokens for API requests, and user profiles are unavailable on hdl for this reason, but the JSON video metadata are contained inside the HTML document, probably this thing: https://nextjs.org/docs/api-reference/data-fetching/getInitialProps Also, for some reason, using the new URL scheme (https://www.tiktok.com/@puczirajot/video/6878766755280440578) didn't work, but https://www.tiktok.com/share/video/6878766755280440578 sets 3 cookies and does a redirect to the same page (+ My logs for downloading a video:
haruhi-dl tiktok extractor source code: https://git.sakamoto.pl/laudom/haruhi-dl/-/blob/master/haruhi_dl/extractor/tiktok.py |
This new URL scheme is supported as of version 2020.11.29, see fb626c0. I was able to successfully download a video using a URL like I think this issue should be closed in favour of opening specific issues like about code 403, or supporting other URLs like profiles. This new TikTok URL scheme is supported in general. |
Checklist
Verbose log
for profiles, playlists and songs:
for videos:
Description
There is a new format of TikTok URLs that was recently introduced. None of them work in youtube-dl.
The "Discover" page on TikTok.com (https://www.tiktok.com/discover) features the following - and none of them work:
The text was updated successfully, but these errors were encountered: