Closed ntegrals closed 3 years ago
theidel@DESKTOP-S2JEM09:/mnt/d/gitkraken/youtube-dl$ youtube-dlc "https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246" -v -F [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246', '-v', '-F'] [debug] Loading archive file None [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dlc version 2020.09.23-2 [debug] Python version 3.7.8 (CPython) - Linux-4.4.0-19041-Microsoft-x86_64-with-Ubuntu-16.04-xenial [debug] exe versions: ffmpeg 2.8.17, ffprobe 2.8.17 [debug] Proxy map: {} [TikTok] 6825028775323946246: Downloading video webpage [info] Available formats for 6825028775323946246: format code extension resolution note 0 mp4 576x1024
Try newest version
I upgraded to version "2020.09.23-2" but got the same error.
Same, still getting the error
We are also getting this issue and after doing some investigation I realise that the actual link to video which I've pasted a example here: https://v16-web-newkey.tiktokcdn.com/3f1f6b5bf3602463e630407dc86348c6/5f6b6381/video/tos/useast2a/tos-useast2a-pve-0068/0aa1a26227a04a5cab5f39e69c0a3ac4/?a=1988&br=2466&bt=1233&cr=0&cs=0&cv=1&dr=0&ds=3&er=&l=202009230901570101891950710F009361&lr=tiktok_m&mime_type=video_mp4&qs=0&rc=MzNkc3I0bjQ5dzMzODczM0ApNzY5Mzw2OWVoNzs8ZjdkOmdnZ141LTMtbWlfLS1iMTZzc15fMjE0Li4yLTYyMC80XjU6Yw%3D%3D&vl=&vr= is throwing a 403.
If this is related it could be the issue is TikTok has changed something on their side.
403 Forbidden can have multiple reasons actually. Either some bad request or some kind of geoblock related issue. Those two are the most common reasons.
I used no vpn (home connection in Germany). Maybe it's worth mentioning the location. Also does this happen with all tiktok videos or just some specific ones like the one mentioned by OP?
We need to investigate where the potential issues come from (root cause) since I have no problems. I already tried different python versions but they all seemed to work.
Furthermore I tried different vpn locations (UK, USA, Spain, Netherlands. South Korea) they all had no problems as well.
What I noticed is that your link @ntegrals and @bison-marvs contains useast2a
so something USA related (no clue whether that's related to this political thing going on).
Can you play those tiktoks in your browser just fine? You can check in Chrome Devtools under network tab what the video source is (what @bison-marvs basically did). You should be able to play it. If that won't work you can inspect the request and look if they send some additional payload or headers.
If it helps, i have vpn, and no matter what country I choose, even east USA, all Tiktok videos i tried give a 403 error.
I think the download request from the actual CDN link needs a referrer header of the public facing link due to CDN access being blocked by a lack of user rights, such as:
Referrer: https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246
I'm not a web programmer, so this is a little above me, but that's what I've gathered and I hope it helps.
EDIT: More info, I don't know what youtube-dl uses on the backend for downloading files, but I've figured out how to download TikTok videos with wget. Here is an example:
wget --referer="https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246" "https://v16-web-newkey.tiktokcdn.com/61c0401f02df0186e524b81cc5cd05a2/5f6fab55/video/tos/useast2a/tos-useast2a-pve-0068/dba9f8ab5d1b4f1b99855f335236f055/?a=1988&br=2784&bt=1392&cr=0&cs=0&cv=1&dr=0&ds=3&er=&l=202009261457480101890741453C21CC9E&lr=tiktok_m&mime_type=video_mp4&qs=0&rc=ajtsbDxqOXRvdDMzNjczM0ApaDVoMzY4aTw4NzQ7Zmc2N2dlLnNrZV5ecm9fLS1eMTZzcy4tYWIvYzQzM14wM19gYy06Yw%3D%3D&vl=&vr="
I have no clue. Everything is working totally fine for me all the time.
[debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246', '-v', '-F'] [debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252 [debug] youtube-dlc version 2020.09.16 [debug] Python version 3.6.5 (CPython) - Windows-10-10.0.19041-SP0 [debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1 [debug] Proxy map: {} [TikTok] 6825028775323946246: Downloading video webpage [info] Available formats for 6825028775323946246: format code extension resolution note 0 mp4 576x1024
Have any of you tried german vpn so far?
Yep it's true, you need a referer. like this: >youtube-dlc --referer=https://www.tiktok.com/@emma.cxmpbell/video/6866909240007691526?lang=sv https://www.tiktok.com/@emma.cxmpbell/video/6866909240007691526?lang=sv
It works with --referer=SAME AS LINK and then paste the LINK
I have no clue. Everything is working totally fine for me all the time.
[debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246', '-v', '-F'] [debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252 [debug] youtube-dlc version 2020.09.16 [debug] Python version 3.6.5 (CPython) - Windows-10-10.0.19041-SP0 [debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1 [debug] Proxy map: {} [TikTok] 6825028775323946246: Downloading video webpage [info] Available formats for 6825028775323946246: format code extension resolution note 0 mp4 576x1024
Have any of you tried german vpn so far?
So, using -F
will rightfully pull the format data, but you can't actually download the file. Perhaps try actually downloading the video file (without the referer param that @loveriusa suggested) and see if you don't get the same 403 error.
I get the same as you when including -F
:
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246', '-v', '-F']
[debug] Loading archive file None
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.23-2
[debug] Python version 3.8.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg 4.2.3, ffprobe 4.3.1
[debug] Proxy map: {}
[TikTok] 6825028775323946246: Downloading video webpage
[info] Available formats for 6825028775323946246:
format code extension resolution note
0 mp4 576x1024
But, if I try to actually download the video:
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246', '-v']
[debug] Loading archive file None
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dlc version 2020.09.23-2
[debug] Python version 3.8.5 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg 4.2.3, ffprobe 4.3.1
[debug] Proxy map: {}
[TikTok] 6825028775323946246: Downloading video webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://v19-web-newkey.tiktokcdn.com/ef363e8feea393e89482513e8544404d/5f6fb956/video/tos/useast2a/tos-useast2a-pve-0068/dba9f8ab5d1b4f1b99855f335236f055/?a=1988&br=2784&bt=1392&cr=0&cs=0&cv=1&dr=0&ds=3&er=&l=2020092615573301018907221617233CF6&lr=tiktok_m&mime_type=video_mp4&qs=0&rc=ajtsbDxqOXRvdDMzNjczM0ApaDVoMzY4aTw4NzQ7Zmc2N2dlLnNrZV5ecm9fLS1eMTZzcy4tYWIvYzQzM14wM19gYy06Yw%3D%3D&vl=&vr='
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "youtube_dlc\YoutubeDL.py", line 1987, in process_info
File "youtube_dlc\YoutubeDL.py", line 1850, in dl
File "youtube_dlc\downloader\common.py", line 366, in download
File "youtube_dlc\downloader\http.py", line 349, in real_download
File "youtube_dlc\downloader\http.py", line 114, in establish_connection
File "youtube_dlc\downloader\http.py", line 110, in establish_connection
File "youtube_dlc\YoutubeDL.py", line 2292, in urlopen
File "urllib\request.py", line 531, in open
File "urllib\request.py", line 640, in http_response
File "urllib\request.py", line 569, in error
File "urllib\request.py", line 502, in _call_chain
File "urllib\request.py", line 649, in http_error_default
urllib.error.HTTPError: HTTP Error 403: Forbidden
Indeed. A few days back then when I tried with different vpn locations I also downloaded the video just fine. Maybe not all cdn endoints were updated then. But you are right. Some simple referer will solve this issue. I believe I got the solution to that. Will have time tomorrow
@ntegrals
PS D:\gitkraken\youtube-dl> python3 -m youtube_dlc "https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246" -v [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246', '-v'] [debug] Loading archive file None [debug] Encodings: locale cp65001, fs utf-8, out utf-8, pref cp65001 [debug] youtube-dlc version 2020.09.23-1 [debug] Git HEAD: 1f6cf7548 [debug] Python version 3.6.5 (CPython) - Windows-10-10.0.19041-SP0 [debug] Proxy map: {} {'Referer': 'https://www.tiktok.com/@larayamilalebronluna/video/6825028775323946246'} [TikTok] 6825028775323946246: Downloading video webpage [debug] Default format spec: bestvideo+bestaudio/best [debug] Invoking downloader on 'https://v19-web-newkey.tiktokcdn.com/e3bf8161379e116b75e1bcedce1375fe/5f72c900/video/tos/useast2a/tos-useast2a-pve-0068/dba9f8ab5d1b4f1b99855f335236f055/?a=1988&br=2784&bt=1392&cr=0&cs=0&cv=1&dr=0&ds=3&er=&l=202009282341110101890482202511FBCB&lr=tiktok_m&mime_type=video_mp4&qs=0&rc=ajtsbDxqOXRvdDMzNjczM0ApaDVoMzY4aTw4NzQ7Zmc2N2dlLnNrZV5ecm9fLS1eMTZzcy4tYWIvYzQzM14wM19gYy06Yw%3D%3D&vl=&vr=' [download] Destination: Lara Yamila Lebron L on TikTok-6825028775323946246.mp4 [download] 100% of 1.55MiB in 00:00
Fix is coming soon with next release.
If you are curious this commit 8219ef642760c1f2db66c95c764879c5ef5f63c1 will deal with it.
Looking forward for some feedback when it's live in next release :)
Checklist
Verbose log
Description
When I try to download a TikTok video, I get an "HTTP Error 403: Forbidden" error.