ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.2k stars 9.93k forks source link

TikTok - YouTube-dl does not handle redirect correctly #22850

Closed Qwerty-Space closed 3 years ago

Qwerty-Space commented 4 years ago

Checklist

Verbose log

>youtube-dl -v -f best http://vm.tiktok.com/apBv1J/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', 'best', 'http://vm.tiktok.com/apBv1J/']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2019.10.22
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3
[debug] Proxy map: {}
[generic] apBv1J: Requesting header
[redirect] Following redirect to https://www.tiktok.com/@samisillito/video/6751018132669877510?u_code=d1bea6gjb0307c&preview_pb=0&language=en&timestamp=1572037828&utm_source=copy&utm_campaign=client_share&utm_medium=android&share_app_name=musically&share_iid=6751462508722636550&enter_from=h5_m
[generic] 6751018132669877510?u_code=d1bea6gjb0307c&preview_pb=0&language=en&timestamp=1572037828&utm_source=copy&utm_campaign=client_share&utm_medium=android&share_app_name=musically&share_iid=6751462508722636550&enter_from=h5_m: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 6751018132669877510?u_code=d1bea6gjb0307c&preview_pb=0&language=en&timestamp=1572037828&utm_source=copy&utm_campaign=client_share&utm_medium=android&share_app_name=musically&share_iid=6751462508722636550&enter_from=h5_m: Downloading webpage
[generic] 6751018132669877510?u_code=d1bea6gjb0307c&preview_pb=0&language=en&timestamp=1572037828&utm_source=copy&utm_campaign=client_share&utm_medium=android&share_app_name=musically&share_iid=6751462508722636550&enter_from=h5_m: Extracting information
[debug] Invoking downloader on 'https://v19.muscdn.com/c182e2711373dba2f281187851675986/5db3c2a8/video/tos/maliva/tos-maliva-v-0068/01cb115b29234cde9c2f1c51342ecf9e/?a=1233&br=1876&cr=0&cs=0&dr=0&ds=3&er=&l=201910252150500101151311840A3E7807&lr=tiktok_m&qs=0&rc=M3VxOjV2Zzo5cDMzZjczM0ApODM8Njg6ZWQ6N2Y6OzQ2NmczNnNfYmRrcmxfLS0zMTZzczQ2NS4uLzRfNWA0NmEuMDU6Yw=='
ERROR: unable to open for writing: [Errno 2] No such file or directory: 'Samisillito (@samisillito) on TikTok - PRAY FOR ME-6751018132669877510u_code=d1bea6gjb0307c&preview_pb=0&language=en&timestamp=1572037828&utm_source=copy&utm_campaign=client_share&utm_medium=android&share_app_name=musically&share_iid=6751462508722636550&enter_from=h5_m.unknown_video.part'
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpifszpy0p\build\youtube_dl\downloader\http.py", line 250, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpifszpy0p\build\youtube_dl\utils.py", line 2042, in sanitize_open
FileNotFoundError: [Errno 2] No such file or directory: 'Samisillito (@samisillito) on TikTok - PRAY FOR ME-6751018132669877510u_code=d1bea6gjb0307c&preview_pb=0&language=en&timestamp=1572037828&utm_source=copy&utm_campaign=client_share&utm_medium=android&share_app_name=musically&share_iid=6751462508722636550&enter_from=h5_m.unknown_video.part'

Description

Try to download a link like http://vm.tiktok.com/apBv1J/, but it doesn't work. You have to use the redirected link https://www.tiktok.com/@samisillito/video/6751018132669877510

skyme5 commented 4 years ago

PR #22838 will fix this issue.