Repository: yt-dlp/yt-dlp

Issue:
[TikTok] Failed to parse JSON/ No video formats found
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm asking a question and **not** reporting a bug or requesting a feature
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Please make sure the question is worded well enough to be understood

#### EDIT:

yt-dlp's TikTok extractor is failing to parse JSON from the feed API endpoint even on nightly/master or with passing `--extractor-args "tiktok:api_hostname=api22-normal-c-useast2a.tiktokv.com"`

<details><summary>original log for reference</summary>

```shell
yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" https://www.tiktok.com/@pouveronica/video/7322479967147740459
[TikTok] Extracting URL: https://www.tiktok.com/@pouveronica/video/7322479967147740459
[TikTok] 7322479967147740459: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7322479967147740459: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7322479967147740459: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7322479967147740459: Downloading video feed
WARNING: [TikTok] 7322479967147740459: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7322479967147740459: Downloading webpage
[info] 7322479967147740459: Downloading 1 format(s): download
ERROR: unable to open for writing: [Errno 2] No such file or directory: 'Replying to @Vy Puthny some key differences in finance and accounting 😃  #hr #humanresources #hrinsight #hrrole #hrtips #hrtrend #hrknowledge #learning #careergrowth #accounting #finance #manpoweroutsourcing #eor  @Nica - និកា  [7322479967147740459].mp4.part'
```

</details>

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [ ] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-v', '-U', '-o', '%(title).200B.%(ext)s', 'https://www.tiktok.com/@mix_editor_5/video/7342789941371571462']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version master@2024.03.20.232831 from yt-dlp/yt-dlp-master-builds [07f5b2f75] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 6.1.1-full_build-www.gyan.dev (setts), ffprobe 6.1.1-full_build-www.gyan.dev, phantomjs 2.5.0, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1806 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-master-builds/releases/latest
Latest version: master@2024.03.20.232831 from yt-dlp/yt-dlp-master-builds
yt-dlp is up to date (master@2024.03.20.232831 from yt-dlp/yt-dlp-master-builds)
[TikTok] Extracting URL: https://www.tiktok.com/@mix_editor_5/video/7342789941371571462
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] 7342789941371571462: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7342789941371571462: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7342789941371571462: Downloading 1 format(s): download
[debug] Invoking http downloader on "https://v16-webapp-prime.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c004/okMCLjLWAqjFQ5CIXaAfaAiMNgbSzfFCh48fSV/?a=1988&ch=0&cr=3&dr=0&lr=tiktok_m&cd=0%7C0%7C1%7C&cv=1&br=1800&bt=900&bti=ODszNWYuMDE6&cs=0&ds=3&ft=4fUEKMFx8Zmo0H.5Y94jV..7rpWrKsd.&mime_type=video_mp4&qs=0&rc=NGQ5OTY1NTdnaDM0Ojs1ZUBpMzs4N3Q5cnlncTMzNzczM0AzLi9gMi4vNjUxX14uLV4yYSNqZWpoMmQ0NWdgLS1kMTZzcw%3D%3D&btag=e00088000&expire=1711056619&l=20240321153003FA72D5DD8E2EFA514E6F&ply_type=2&policy=2&signature=eb207c9a24f5509f1e4668cbac840d00&tk=tt_chain_token"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: #CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻.mp4
[download] 100% of    1.62MiB in 00:00:00 at 14.79MiB/s
```


Discussion:
i have the latest nightly build version and facing this problem


 yt-dlp --cookies '5.txt' 'https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc'
[TikTok] Extracting URL: https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] 7342789941371571462: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7342789941371571462: Downloading webpage
[info] 7342789941371571462: Downloading 1 format(s): download
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (1/3)...
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (2/3)...
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (3/3)...
ERROR: unable to open for writing: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐 🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part"
nobody can share a verbose log?
> yt-dlp --cookies '5.txt' '[https://www.tiktok.com/@mix_editor_5/video/7342789941371571462](https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc)

Here's with traffic - or would you need some further debug prints around the problematic areas where the parser fails?

<details><summary>--print-traffic log</summary>

```
yt-dlp --print-traffic https://www.tiktok.com/@mix_editor_5/video/7342789941371571462
[TikTok] Extracting URL: https://www.tiktok.com/@mix_editor_5/video/7342789941371571462
[TikTok] 7342789941371571462: Downloading video feed
director: Handler preferences for this request: urllib=0, requests=100, websockets=0
director: Checking if "requests" supports this request.
director: Sending request via "requests"
requests: Starting new HTTPS connection (1): api22-normal-c-useast2a.tiktokv.com:443
send: b'GET /aweme/v1/feed/?aweme_id=7342789941371571462&version_name=26.1.3&version_code=260103&build_number=26.1.3&manifest_version_code=260103&update_version_code=260103&openudid=a278b796c4075c4f&uuid=3521220805091347&_rticket=1711034124680&ts=1711034124&device_brand=Google&device_type=Pixel+7&device_platform=android&resolution=1080%2A2400&dpi=420&os_version=13&os_api=29&carrier_region=US&sys_region=US&region=US&app_name=trill&app_language=en&language=en&timezone_name=America%2FNew_York&timezone_offset=-14400&channel=googleplay&ac=wifi&mcc_mnc=310260&is_my_cn=0&aid=1180&ssmix=a&as=a1qwert123&cp=cbfhckdckkde1 HTTP/1.1\r\nHost: api22-normal-c-useast2a.tiktokv.com\r\nConnection: keep-alive\r\nUser-Agent: com.ss.android.ugc.trill/260103 (Linux; U; Android 13; en_US; Pixel 7; Build/TD1A.220804.031; Cronet/58.0.2991.0)\r\nAccept: application/json\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: odin_tt=e21c6b4bc8a8e90409e1ea0752bb9e5aa15483da4046b7489d8653d12d520bde875aef007630ebcf5b3f49f69b50acb636a86e48df5e95e0c94e7dfab1484524594cb325f3a1efbbf95722eaf5cc91da\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Thu, 21 Mar 2024 15:15:25 GMT
header: Content-Type: application/json
header: Content-Length: 0
header: tt_stable: 1
header: tt_orcas_res: 1
header: x-tt-logid: 2024032115152407E836C61AB33B603694
header: tt-idc-switch: 10000@20240321035225
header: Access-Control-Expose-Headers: tt-idc-switch
header: server-timing: inner; dur=12, inner; dur=7
header: x-tt-trace-host: 01a18c0207eb1443e98b5f96c45cf1cd4373b0beb31656d916fb683f620bc0a0520cf0c260bb07ea0bce6ccf0dff603132b52d7f5824e1c91e7e43e0a98b7135c81ac10d25d74301a7eee80f589cff930a28dbc3168891aa304a8db11ab9825e0d
header: x-tt-trace-tag: id=22;cdn-cache=miss
header: x-tt-trace-id: 00-24032115152407E836C61AB33B603694-3A387E66998F413B-00
header: Server: TLB
header: Via: 1.1 google
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7342789941371571462: Downloading video feed
director: Handler preferences for this request: urllib=0, requests=100, websockets=0
director: Checking if "requests" supports this request.
director: Sending request via "requests"
send: b'GET /aweme/v1/feed/?aweme_id=7342789941371571462&version_name=26.1.2&version_code=260102&build_number=26.1.2&manifest_version_code=260102&update_version_code=260102&openudid=062eb56bad513444&uuid=0761932734663454&_rticket=1711034124985&ts=1711034124&device_brand=Google&device_type=Pixel+7&device_platform=android&resolution=1080%2A2400&dpi=420&os_version=13&os_api=29&carrier_region=US&sys_region=US&region=US&app_name=trill&app_language=en&language=en&timezone_name=America%2FNew_York&timezone_offset=-14400&channel=googleplay&ac=wifi&mcc_mnc=310260&is_my_cn=0&aid=1180&ssmix=a&as=a1qwert123&cp=cbfhckdckkde1 HTTP/1.1\r\nHost: api22-normal-c-useast2a.tiktokv.com\r\nConnection: keep-alive\r\nUser-Agent: com.ss.android.ugc.trill/260102 (Linux; U; Android 13; en_US; Pixel 7; Build/TD1A.220804.031; Cronet/58.0.2991.0)\r\nAccept: application/json\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: odin_tt=c81b37003864f4074bf472b245cf6d3fc73cc61f87029ff959630d9a07f6b289fbf63d94903dcb2586a28cb676bd92b0a8b055df8d602f42f715b52868d7385ce5b7e8e6dd8cec1ec11bc3a685a0738f\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Thu, 21 Mar 2024 15:15:25 GMT
header: Content-Type: application/json
header: Content-Length: 0
header: tt_stable: 1
header: tt_orcas_res: 1
header: x-tt-logid: 202403211515243AD6D49A723A5732C784
header: tt-idc-switch: 10000@20240321035225
header: Access-Control-Expose-Headers: tt-idc-switch
header: server-timing: inner; dur=17, inner; dur=10
header: x-tt-trace-host: 01a18c0207eb1443e98b5f96c45cf1cd4373b0beb31656d916fb683f620bc0a05251ee12e16f13c76cbbd6e5bd3e5160b1c238937517e2c940eb1539ab06d01a360f336af1a4d926a5da21fa9b17ed422005fbef6ab93f66cfb2cfe6827182d3a6
header: x-tt-trace-tag: id=22;cdn-cache=miss
header: x-tt-trace-id: 00-2403211515243AD6D49A723A5732C784-6628F157A8823DB3-00
header: Server: TLB
header: Via: 1.1 google
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7342789941371571462: Downloading video feed
director: Handler preferences for this request: urllib=0, requests=100, websockets=0
director: Checking if "requests" supports this request.
director: Sending request via "requests"
send: b'GET /aweme/v1/feed/?aweme_id=7342789941371571462&version_name=26.1.1&version_code=260101&build_number=26.1.1&manifest_version_code=260101&update_version_code=260101&openudid=69814748944065e4&uuid=3381622425895293&_rticket=1711034125189&ts=1711034125&device_brand=Google&device_type=Pixel+7&device_platform=android&resolution=1080%2A2400&dpi=420&os_version=13&os_api=29&carrier_region=US&sys_region=US&region=US&app_name=trill&app_language=en&language=en&timezone_name=America%2FNew_York&timezone_offset=-14400&channel=googleplay&ac=wifi&mcc_mnc=310260&is_my_cn=0&aid=1180&ssmix=a&as=a1qwert123&cp=cbfhckdckkde1 HTTP/1.1\r\nHost: api22-normal-c-useast2a.tiktokv.com\r\nConnection: keep-alive\r\nUser-Agent: com.ss.android.ugc.trill/260101 (Linux; U; Android 13; en_US; Pixel 7; Build/TD1A.220804.031; Cronet/58.0.2991.0)\r\nAccept: application/json\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: odin_tt=acc0322fb714d841c53466f8e84bfa87cae0da9ffba50dae5402cded9170fcf5a9eb8f23970271e226d4184c54e9a16d2a6586cd6a98dc03389b7f9eec285bfff3e484087954faa4b53fb82e3dd6d63d\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Thu, 21 Mar 2024 15:15:25 GMT
header: Content-Type: application/json
header: Content-Length: 0
header: tt_stable: 1
header: tt_orcas_res: 1
header: x-tt-logid: 20240321151524631C5A08E56FD227A8D2
header: tt-idc-switch: 10000@20240321035225
header: Access-Control-Expose-Headers: tt-idc-switch
header: server-timing: inner; dur=16, inner; dur=9
header: x-tt-trace-host: 01a18c0207eb1443e98b5f96c45cf1cd4373b0beb31656d916fb683f620bc0a0520747c23aba232ed4a1fa91dd81efc2d7760ab5e58d29f9b887d4b018c571de63bf10f30a61eb62e6fb767e4873eb3ac2427bced9d19423067570214e1477239c
header: x-tt-trace-tag: id=22;cdn-cache=miss
header: x-tt-trace-id: 00-240321151524631C5A08E56FD227A8D2-69B93CB981E102DA-00
header: Server: TLB
header: Via: 1.1 google
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7342789941371571462: Downloading video feed
director: Handler preferences for this request: urllib=0, requests=100, websockets=0
director: Checking if "requests" supports this request.
director: Sending request via "requests"
send: b'GET /aweme/v1/feed/?aweme_id=7342789941371571462&version_name=25.6.2&version_code=250602&build_number=25.6.2&manifest_version_code=250602&update_version_code=250602&openudid=1ae36d04e2456d1d&uuid=2020029002446497&_rticket=1711034125394&ts=1711034125&device_brand=Google&device_type=Pixel+7&device_platform=android&resolution=1080%2A2400&dpi=420&os_version=13&os_api=29&carrier_region=US&sys_region=US&region=US&app_name=trill&app_language=en&language=en&timezone_name=America%2FNew_York&timezone_offset=-14400&channel=googleplay&ac=wifi&mcc_mnc=310260&is_my_cn=0&aid=1180&ssmix=a&as=a1qwert123&cp=cbfhckdckkde1 HTTP/1.1\r\nHost: api22-normal-c-useast2a.tiktokv.com\r\nConnection: keep-alive\r\nUser-Agent: com.ss.android.ugc.trill/250602 (Linux; U; Android 13; en_US; Pixel 7; Build/TD1A.220804.031; Cronet/58.0.2991.0)\r\nAccept: application/json\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: odin_tt=8261b6f69ac3f90fbce1fdeaed3ab7f4f8274a468bf03af6f33b0895138cbe778c8ca35d7efbef921a460488856d400a2b3099e06cc8819c0dee6cf4a6f15ce1b8c4d4f34d54111caf9bb2a959fe7d98\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Thu, 21 Mar 2024 15:15:25 GMT
header: Content-Type: application/json
header: Content-Length: 0
header: tt_stable: 1
header: tt_orcas_res: 1
header: x-tt-logid: 202403211515247AE03E3D7D5F1F1E54D0
header: tt-idc-switch: 10000@20240321035225
header: Access-Control-Expose-Headers: tt-idc-switch
header: server-timing: inner; dur=12, inner; dur=6
header: x-tt-trace-host: 01a18c0207eb1443e98b5f96c45cf1cd4373b0beb31656d916fb683f620bc0a052bd661ba389b58c5afd0cacc2aa65725f6af3c3ea880e49c2fee06bfd45b0f9be302a9179399f8415cbbcacbb54717fe048b8518411d1c22f4792a401fd89608d
header: x-tt-trace-tag: id=22;cdn-cache=miss
header: x-tt-trace-id: 00-2403211515247AE03E3D7D5F1F1E54D0-7273C6018925BA71-00
header: Server: TLB
header: Via: 1.1 google
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
WARNING: [TikTok] 7342789941371571462: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7342789941371571462: Downloading webpage
director: Handler preferences for this request: urllib=0, requests=100, websockets=0
director: Checking if "requests" supports this request.
director: Sending request via "requests"
requests: Starting new HTTPS connection (1): www.tiktok.com:443
send: b'GET /@mix_editor_5/video/7342789941371571462 HTTP/1.1\r\nHost: www.tiktok.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: gzip, deflate, br\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: text/html; charset=utf-8
header: Content-Security-Policy: script-src 'unsafe-eval' sf16-website-login.neutral.ttwstatic.com s20.tiktokcdn.com *.tiktokcdn-us.com www.google.com recaptcha.google.com js.hcaptcha.com client-api.arkoselabs.com www.gstatic.com connect.facebook.net; frame-src *.tiktok.com accounts.google.com www.google.com recaptcha.google.com www.facebook.com *.kakao.com lf16-web.tiktokcdn.com assets.braintreegateway.com appleid.apple.com access.line.me api.twitter.com h.online-metrix.net bytedance: newassets.hcaptcha.com client-api.arkoselabs.com; worker-src https: blob:; report-to csp-endpoint; upgrade-insecure-requests ; default-src 'self' 'unsafe-eval' 'unsafe-inline' blob: bytedance: data: wss://*.tiktok.com wss://*.tiktokv.com wss://*.tiktokv.eu wss://tiktok.com wss://tiktokv.com *.adsco.re *.akamaized.net *.amazonaws.com *.bing.com *.bitssec.com *.bytedapm.com *.bytedgame.com *.bytehwm-row.com *.byteicdn.com *.byteintl.com *.byteintl.net *.byteintlapi.com *.byteintlstatic.com *.bytelemon.com *.byteoversea.com *.byteoversea.net *.bytevcloudapi.com *.capcut.com *.cloudflare.com *.ctfassets.net *.doubleclick.net *.facebook.com *.facebook.net *.fbsbx.com *.fcdnstatic-intl.com *.fdmstatic.com *.g-p-static.com *.gauthmath.com *.goofy-cdn.com *.goofy.app *.google-analytics.com *.google.ae *.google.at *.google.be *.google.bg *.google.bj *.google.by *.google.ca *.google.ch *.google.co.cr *.google.co.id *.google.co.il *.google.co.jp *.google.co.kr *.google.co.ma *.google.co.nz *.google.co.uk *.google.co.za *.google.com *.google.com.ar *.google.com.au *.google.com.bd *.google.com.br *.google.com.cy *.google.com.do *.google.com.ec *.google.com.gh *.google.com.lb *.google.com.mt *.google.com.my *.google.com.ng *.google.com.pe *.google.com.pk *.google.com.sa *.google.com.sg *.google.com.tr *.google.cz *.google.de *.google.dk *.google.dz *.google.ee *.google.es *.google.fi *.google.fr *.google.gr *.google.hr *.google.hu *.google.ie *.google.iq *.google.is *.google.it *.google.lt *.google.lu *.google.lv *.google.md *.google.nl *.google.no *.google.pl *.google.ps *.google.pt *.google.ro *.google.rs *.google.se *.google.si *.google.sk *.google.td *.google.tn *.googleapis.com *.googletagmanager.com *.gstatic.com *.hsforms.com *.hsforms.net *.ibytedtos.com *.ibyteimg.com *.isnssdk.com *.jumio.ai *.kakao.com *.lemon8-app.com *.lemon8cdn.com *.licdn.com *.linkedin.com *.muscdn.com *.musical.ly *.oecstatic.com *.omise.co *.pangle-ads.com *.paypal.com *.pipopay.com *.redditstatic.com *.resso.me *.sgsnssdk.com *.soundon.global *.tableau.com *.tiktok.com *.tiktok.ru *.tiktok.vn *.tiktokapis.com *.tiktokcdn-eu.com *.tiktokcdn-in.com *.tiktokcdn-us.com *.tiktokcdn.com *.tiktokforbusinessoutbound.com *.tiktokglobalshop.com *.tiktokmusic.me *.tiktokshop.com *.tiktokstaticb.com *.tiktokus.info *.tiktokv.com *.tiktokv.eu *.tiktokv.us *.tiktokw.eu *.tiktokw.us *.topbuzzcdn.com *.ttlivecdn.com *.ttlstatic.com *.ttwstatic.com *.twitter.com *.vimeo.com *.vodupload.com *.yahoo.co.jp *.yhgfb-static.com *.zhiliaoapp.com code.jquery.com facebook.com i.ticketweb.com images.universe.com media.ticketmaster.eu res.cloudinary.com s1.ticketm.net static-label.frontgatetickets.com t.co tikitoks.com tiktok.com tiktok.ua tiktok.vn tiktokfollowersfree.com tiktokv.com twitter.com unpkg.com; report-uri https://mon-i18n.tiktokv.com/monitor_browser/collect/batch/security/?bid=tiktok_pns&revision=083476f4-8c9d-4a06-a20a-349394c7e1b5
header: Feature-Policy: microphone 'none'; geolocation 'none'
header: Referrer-Policy: strict-origin-when-cross-origin
header: Strict-Transport-Security: max-age=31536000; includeSubdomains
header: X-Bytefaas-Execution-Duration: 259.11
header: X-Bytefaas-Request-Id: 202403211515245C8C1D90AA980B4E6732
header: X-Content-Type-Options: nosniff
header: X-Download-Options: noopen
header: X-Frame-Options: SAMEORIGIN
header: X-Gw-Dst-Psm: serverless.tiktok.desktop
header: X-Ms-Token: mbSf6ar-O8PKlAHRCyP9XHSgTY2A-VM6uXrC5KhIv7UwO7kEt5HGiMGdhumCsOmVYaV1lCGS4DsP-eKEeFqudBd5CzmD_2Nc8_8=
header: X-Powered-By: Goofy Node
header: X-Pumbaa-Web-Avail: 1
header: X-Tt-Logid: 202403211515245C8C1D90AA980B4E6732
header: X-Xss-Protection: 1; mode=block
header: Server-Timing: inner; dur=260
header: x-tt-trace-host: 015f26c1ffc64c474bea5b1456b221b90bd5a5e0f69cdac916a1e685fda56c37596aeb56271d525cb3d3a39333f2278ee707eeae4a22a405eadc25cd4b09a4604566de44f773e4f6e3f1608b2483f7bfcc6f6bfac1a41bb867878a6f57a3e31f33
header: x-tt-trace-id: 00-2403211515245C8C1D90AA980B4E6732-67D7BCC16D36A3A5-00
header: reporting-endpoints: csp-endpoint="https://mon-i18n.tiktokv.com/monitor_browser/collect/batch/security/?bid=tiktok_pns"
header: content-security-policy-report-only: report-uri https://mon-i18n.tiktokv.com/monitor_browser/collect/batch/security/?bid=tiktok_pns&revision=083476f4-8c9d-4a06-a20a-349394c7e1b5;report-to csp-endpoint;default-src 'self' 'unsafe-eval' 'unsafe-inline' blob: bytedance: data: wss://*.tiktok.com wss://*.tiktokv.com wss://*.tiktokv.eu wss://tiktok.com wss://tiktokv.com *.adsco.re *.akamaized.net *.amazonaws.com *.bing.com *.capcut.com *.cloudflare.com *.ctfassets.net *.doubleclick.net *.facebook.com *.facebook.net *.fbsbx.com *.fcdnstatic-intl.com *.fdmstatic.com *.g-p-static.com *.gauthmath.com *.google-analytics.com *.googleapis.com *.googletagmanager.com *.gstatic.com *.jumio.ai *.kakao.com *.lemon8-app.com *.lemon8cdn.com *.licdn.com *.linkedin.com *.muscdn.com *.musical.ly *.oecstatic.com *.omise.co *.pangle-ads.com *.paypal.com *.pipopay.com *.redditstatic.com *.resso.me *.sgsnssdk.com *.soundon.global *.tableau.com *.tiktok.com *.tiktok.ru *.tiktok.vn *.tiktokapis.com *.tiktokcdn-eu.com *.tiktokcdn-in.com *.tiktokcdn-us.com *.tiktokcdn.com *.tiktokforbusinessoutbound.com *.tiktokglobalshop.com *.tiktokmusic.me *.tiktokshop.com *.tiktokstaticb.com *.tiktokus.info *.tiktokv.com *.tiktokv.eu *.tiktokv.us *.tiktokw.eu *.tiktokw.us *.topbuzzcdn.com *.ttlivecdn.com *.ttlstatic.com *.ttwstatic.com *.twitter.com *.vimeo.com *.yahoo.co.jp facebook.com t.co tikitoks.com tiktok.com tiktok.ua tiktok.vn tiktokfollowersfree.com tiktokv.com twitter.com unpkg.com
header: Server: TLB
header: Content-Encoding: br
header: Expires: Thu, 21 Mar 2024 15:15:26 GMT
header: Cache-Control: max-age=0, no-cache, no-store
header: Pragma: no-cache
header: Date: Thu, 21 Mar 2024 15:15:26 GMT
header: Transfer-Encoding: chunked
header: X-Cache: TCP_MISS from a23-193-116-188.deploy.akamaitechnologies.com (AkamaiGHost/11.4.3-54729273) (-)
header: Connection: keep-alive
header: Connection: Transfer-Encoding
header: Set-Cookie: ttwid=1%7CerEP1e6NThhY6rk-sIqNOiJJf5pFfn6iZ2NqegIFnXM%7C1711034126%7Cfd2425f5cbe4959d725676d147653762c0b6b1d926993a1ce8365d6a199e882f; Domain=.tiktok.com; Path=/; Expires=Sun, 16 Mar 2025 15:15:26 GMT; HttpOnly
header: Set-Cookie: tt_csrf_token=YLGqKfoa-FROEMRRykhf4FqzXeIxM_PDafpw; path=/; domain=.tiktok.com; samesite=lax; secure; httponly
header: Set-Cookie: tt_chain_token=Srpv1GqLrXwj9vmuSLFCZw==; path=/; expires=Tue, 17 Sep 2024 15:15:26 GMT; domain=.tiktok.com; secure; httponly
header: Set-Cookie: msToken=mbSf6ar-O8PKlAHRCyP9XHSgTY2A-VM6uXrC5KhIv7UwO7kEt5HGiMGdhumCsOmVYaV1lCGS4DsP-eKEeFqudBd5CzmD_2Nc8_8=; Path=/; Expires=Sun, 31 Mar 2024 15:15:25 GMT; Secure; SameSite=None
header: x-tt-trace-tag: id=16;cdn-cache=miss;type=dyn
header: Server-Timing: cdn-cache; desc=MISS, edge; dur=0, origin; dur=347
header: X-Origin-Response-Time: 347,23.193.116.188
header: X-Akamai-Request-ID: 23ea698d
[info] 7342789941371571462: Downloading 1 format(s): download
director: Handler preferences for this request: urllib=0, requests=100, websockets=0
director: Checking if "requests" supports this request.
director: Sending request via "requests"
requests: Starting new HTTPS connection (1): v16-webapp-prime.tiktok.com:443
send: b'GET /video/tos/useast2a/tos-useast2a-ve-0068c004/okMCLjLWAqjFQ5CIXaAfaAiMNgbSzfFCh48fSV/?a=1988&ch=0&cr=3&dr=0&lr=tiktok_m&cd=0%7C0%7C1%7C&cv=1&br=1800&bt=900&bti=ODszNWYuMDE6&cs=0&ds=3&ft=4fUEKMFw8Zmo0D4~Y94jVe2xrpWrKsd.&mime_type=video_mp4&qs=0&rc=NGQ5OTY1NTdnaDM0Ojs1ZUBpMzs4N3Q5cnlncTMzNzczM0AzLi9gMi4vNjUxX14uLV4yYSNqZWpoMmQ0NWdgLS1kMTZzcw%3D%3D&btag=e00088000&expire=1711055740&l=202403211515245C8C1D90AA980B4E6732&ply_type=2&policy=2&signature=b6dddab574fbeeacf324e30b741818ae&tk=tt_chain_token HTTP/1.1\r\nHost: v16-webapp-prime.tiktok.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: identity\r\nReferer: https://www.tiktok.com/@mix_editor_5/video/7342789941371571462\r\nCookie: ttwid=1%7CerEP1e6NThhY6rk-sIqNOiJJf5pFfn6iZ2NqegIFnXM%7C1711034126%7Cfd2425f5cbe4959d725676d147653762c0b6b1d926993a1ce8365d6a199e882f; tt_csrf_token=YLGqKfoa-FROEMRRykhf4FqzXeIxM_PDafpw; tt_chain_token=Srpv1GqLrXwj9vmuSLFCZw==\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: video/mp4
header: Content-Length: 1703033
header: ETag: "c23977362524001dfce3a1ecb4dab423"
header: Last-Modified: Tue, 05 Mar 2024 08:15:20 GMT
header: X-Bdcdn-Cache-Status: TCP_HIT
header: X-Storagegw-Request-Id: 20240320183244A2E1BB648F3C04BF65BE
header: X-Storagegw-Response-Time: Wed, 20 Mar 2024 18:32:45 GMT
header: x-request-ip: fdbd:dc61:b:377::41
header: x-response-cinfo: fdbd:dc61:b:377::41
header: x-tt-trace-host: 01a77528bca0d1d95a185688d3d98daf71848bd655a19706a6446dae8bf4042c558e2596990db3c60c2a38c933d77f50b3b2a6b99c547e5c85b115a6de0d209bdf316676394e095703b7c3009169ca7513c9ae4c4fa86361fcd22b75c2f5cc6b5a9948ef49c9795645653983d2c2ba9fe5d7633064c9c34e024adee0d726671f6b
header: x-tt-trace-id: 00-240321100910A83962CC291EA9D3D9DE-5C215D7287A6ED38-00
header: Server: TLB
header: X-TT-LOGID: 20240321100910A83962CC291EA9D3D9DE
header: X-Expires-MS: 1711015752267
header: X-Origin-Response-Time: 11,23.193.39.145
header: X-Akamai-Request-ID: f0f05a1.2c03ca59.2e0d840
header: X-Parent-Response-Time: 414,23.55.160.136
header: Cache-Control: max-age=2592000
header: Date: Thu, 21 Mar 2024 15:15:27 GMT
header: X-Cache: TCP_MISS from a2-16-63-21.deploy.akamaitechnologies.com (AkamaiGHost/11.4.3-54729273) (-)
header: Connection: keep-alive
header: X-Cache-Remote: TCP_MISS from a23-55-160-136.deploy.akamaitechnologies.com (AkamaiGHost/11.4.3-54726453) (-)
header: x-response-cache: parent_hit
header: x-tt-trace-tag: id=16;cdn-cache=hit;type=static
header: Server-Timing: cdn-cache; desc=HIT, edge; dur=457, origin; dur=0
header: Server-Timing: inner; dur=2
header: X-Parent-Response-Time: 457,2.16.63.21
header: Access-Control-Expose-Headers: Content-Length,Content-Range,content-type,expires,last-modified,via,X-Cache,x-response-cache,x-response-sinfo,x-response-cinfo
header: Accept-Ranges: bytes
header: Access-Control-Allow-Headers: range
header: Access-Control-Allow-Credentials: true
header: Access-Control-Allow-Origin: https://www.tiktok.com
ERROR: unable to open for writing: [Errno 36] File name too long: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐 🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part"

```

</details>
You get a verbose log by adding `--verbose` (or `-v` for short) to your command:
```
[debug] Command-line config: ['-v', '-U', '-o', '%(title).200B.%(ext)s', 'https://www.tiktok.com/@mix_editor_5/video/7342789941371571462']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version master@2024.03.20.232831 from yt-dlp/yt-dlp-master-builds [07f5b2f75] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 6.1.1-full_build-www.gyan.dev (setts), ffprobe 6.1.1-full_build-www.gyan.dev, phantomjs 2.5.0, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1806 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-master-builds/releases/latest
Latest version: master@2024.03.20.232831 from yt-dlp/yt-dlp-master-builds
yt-dlp is up to date (master@2024.03.20.232831 from yt-dlp/yt-dlp-master-builds)
[TikTok] Extracting URL: https://www.tiktok.com/@mix_editor_5/video/7342789941371571462
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] 7342789941371571462: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7342789941371571462: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7342789941371571462: Downloading 1 format(s): download
[debug] Invoking http downloader on "https://v16-webapp-prime.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c004/okMCLjLWAqjFQ5CIXaAfaAiMNgbSzfFCh48fSV/?a=1988&ch=0&cr=3&dr=0&lr=tiktok_m&cd=0%7C0%7C1%7C&cv=1&br=1800&bt=900&bti=ODszNWYuMDE6&cs=0&ds=3&ft=4fUEKMFx8Zmo0H.5Y94jV..7rpWrKsd.&mime_type=video_mp4&qs=0&rc=NGQ5OTY1NTdnaDM0Ojs1ZUBpMzs4N3Q5cnlncTMzNzczM0AzLi9gMi4vNjUxX14uLV4yYSNqZWpoMmQ0NWdgLS1kMTZzcw%3D%3D&btag=e00088000&expire=1711056619&l=20240321153003FA72D5DD8E2EFA514E6F&ply_type=2&policy=2&signature=eb207c9a24f5509f1e4668cbac840d00&tk=tt_chain_token"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: #CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻.mp4
[download] 100% of    1.62MiB in 00:00:00 at 14.79MiB/s
```
> yt-dlp --print-traffic https://www.tiktok.com/@mix_editor_5/video/7342789941371571462

Yes, but it doesn't give you much here - neither does maybe the traffic prints...
A verbose log is just about always required when reporting a bug, as it shows things such as the version of yt-dlp, device you are running on, proxies used, dependencies installed, extra setting from a config file...
this is the complete verbose log which i captured now
i get it on all tiktok videos urls

yt-dlp --cookies '5.txt' -v 'https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc'
[debug] Command-line config: ['--cookies', '5.txt', '-v', 'https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.03.20.232704 from yt-dlp/yt-dlp-nightly-builds [07f5b2f75] (pip)
[debug] Python 3.11.5 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 3.0.9 30 May 2023)
[debug] exe versions: ffmpeg 6.1-essentials_build-www.gyan.dev (setts), ffprobe 6.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.42.0, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1806 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] 7342789941371571462: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7342789941371571462: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7342789941371571462: Downloading 1 format(s): download
[debug] Invoking http downloader on "https://v16-webapp-prime.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c004/okMCLjLWAqjFQ5CIXaAfaAiMNgbSzfFCh48fSV/?a=1988&ch=0&cr=3&dr=0&lr=tiktok_m&cd=0%7C0%7C1%7C&cv=1&br=1800&bt=900&bti=ODszNWYuMDE6&cs=0&ds=3&ft=4fUEKMew8Zmo0XKfY94jVcw7ypWrKsd.&mime_type=video_mp4&qs=0&rc=NGQ5OTY1NTdnaDM0Ojs1ZUBpMzs4N3Q5cnlncTMzNzczM0AzLi9gMi4vNjUxX14uLV4yYSNqZWpoMmQ0NWdgLS1kMTZzcw%3D%3D&btag=e00088000&expire=1711060577&l=20240321163602A17C399F75225D1ED5CF&ply_type=2&policy=2&signature=bcb5fb0c4e36524740778dcc49cc94d1&tk=tt_chain_token"
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (1/3)...
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (2/3)...
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (3/3)...
ERROR: unable to open for writing: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐 🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part"

Traceback (most recent call last):
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 591, in sanitize_open
    raise LockingUnsupportedError()
yt_dlp.utils.LockingUnsupportedError: File locking is not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\http.py", line 265, in download
    ctx.stream, ctx.tmpfilename = self.sanitize_open(
                                  ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 238, in wrapper
    for retry in RetryManager(self.params.get('file_access_retries', 3), error_callback, fd=self):
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 5057, in __iter__
    self.error_callback(self.error, self.attempt, self.retries)
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 231, in error_callback
    return RetryManager.report_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 5065, in report_retry
    raise e
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 240, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 251, in sanitize_open
    f, filename = sanitize_open(filename, open_mode)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 594, in sanitize_open
    stream = open(filename, open_mode)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐 🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part"
this is the complete verbose log which i captured now
i get it on all tiktok videos urls

yt-dlp --cookies '5.txt' -v 'https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc'
[debug] Command-line config: ['--cookies', '5.txt', '-v', 'https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.03.20.232704 from yt-dlp/yt-dlp-nightly-builds [07f5b2f75] (pip)
[debug] Python 3.11.5 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 3.0.9 30 May 2023)
[debug] exe versions: ffmpeg 6.1-essentials_build-www.gyan.dev (setts), ffprobe 6.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.42.0, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1806 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@mix_editor_5/video/7342789941371571462?is_from_webapp=1&sender_device=pc
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7342789941371571462: Downloading video feed
WARNING: [TikTok] 7342789941371571462: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7342789941371571462: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7342789941371571462: Downloading 1 format(s): download
[debug] Invoking http downloader on "https://v16-webapp-prime.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c004/okMCLjLWAqjFQ5CIXaAfaAiMNgbSzfFCh48fSV/?a=1988&ch=0&cr=3&dr=0&lr=tiktok_m&cd=0%7C0%7C1%7C&cv=1&br=1800&bt=900&bti=ODszNWYuMDE6&cs=0&ds=3&ft=4fUEKMew8Zmo0XKfY94jVcw7ypWrKsd.&mime_type=video_mp4&qs=0&rc=NGQ5OTY1NTdnaDM0Ojs1ZUBpMzs4N3Q5cnlncTMzNzczM0AzLi9gMi4vNjUxX14uLV4yYSNqZWpoMmQ0NWdgLS1kMTZzcw%3D%3D&btag=e00088000&expire=1711060577&l=20240321163602A17C399F75225D1ED5CF&ply_type=2&policy=2&signature=bcb5fb0c4e36524740778dcc49cc94d1&tk=tt_chain_token"
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (1/3)...
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (2/3)...
[download] Unable to open file: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐  🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part". Retrying (3/3)...
ERROR: unable to open for writing: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐 🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part"

Traceback (most recent call last):
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 591, in sanitize_open
    raise LockingUnsupportedError()
yt_dlp.utils.LockingUnsupportedError: File locking is not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\http.py", line 265, in download
    ctx.stream, ctx.tmpfilename = self.sanitize_open(
                                  ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 238, in wrapper
    for retry in RetryManager(self.params.get('file_access_retries', 3), error_callback, fd=self):
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 5057, in __iter__
    self.error_callback(self.error, self.attempt, self.retries)
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 231, in error_callback
    return RetryManager.report_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 5065, in report_retry
    raise e
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 240, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\downloader\common.py", line 251, in sanitize_open
    f, filename = sanitize_open(filename, open_mode)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rizwa\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_dlp\utils\_utils.py", line 594, in sanitize_open
    stream = open(filename, open_mode)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: "#CapCut #🥺💔 #new #trending #plz #plz #😭😭 #viralvideo #plunfrezzmyaccount🙏🥺 #plzvirulvideo😥 #plzviral🥺🥺🙏🙏foryoupage ⧸⧸ 𝑫𝒆𝒂𝒓 𝑻𝒊𝒌𝒕𝒐𝒌 𝑻𝒆𝒂𝒎 𝑷𝒍𝒛 𝑫𝒐𝒏'𝒕 𝑼𝒏𝒅𝒆𝒓𝒓𝒆𝒗𝒊𝒆𝒘 𝑴𝒚 𝑽𝒊𝒅𝒆𝒐 🥺🙏😞💔 ⧸⧸#FORYOU #FORYOUPAGE#STANDWITHKASHMIR#dontunderreviewmyvideo #watsappstatus  [7342789941371571462].mp4.part"
yt-dlp should still be able to download the webpage version of the video in most cases. Try adding `-f 0` to your command to select the format without a watermark. The quality will not be quite as good as the mobile API feed formats, though.

> ERROR: unable to open for writing: [Errno 2] No such file or directory
> ERROR: unable to open for writing: [Errno 22] Invalid argument:

If you get an error like this, it just means the output filename is too long. Add `-o "%(title).100B [%(id)s].%(ext)s"` to your command
Also, should note that for 1 out of every ~30 attempts, I don't receive this error and I am still able to get the mobile API feed formats.
i want data in json and it returns but when i open the video url in my browser i get access deneid
Access Denied i try to open this url in different browsers but result is same
You don't have permission to access "http://v16-webapp-prime.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c003/o0lJmAxvtJdSiEIlb5FfBBQ0R1U7RYQQRfD1E8/?" on this server.
Reference #18.9584dead.1711040325.fc05b85
actually i think when ever i make request tiktok send a captcha with 403 response and ytdlp give me back this page 🤔 if i'm right than how can i solve this issue i also try proxy but nothing changed
> i want data in json and it returns but when i open the video url in my browser i get access deneid Access Denied i try to open this url in different browsers but result is same You don't have permission to access "http://v16-webapp-prime.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c003/o0lJmAxvtJdSiEIlb5FfBBQ0R1U7RYQQRfD1E8/?" on this server. Reference #18.9584dead.1711040325.fc05b85

~~That's because some specific cookies have to be passed with the request, which your browser obviously doesn't do. So it's not an actual problem in this case~~ Just checked the code, it isn't. Sorry for misinformation
Hello guys, Now can download video from tiktok without watermark with yt-dlp master

I tried but the one with format 0 still returns watermark.

```[debug] Command-line config: ['https://www.tiktok.com/@highwaycafe_th/video/7345036214791163138', '--verbose']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447]
[debug] Python 3.10.0 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1l  24 Aug 2021)
[debug] exe versions: ffmpeg 2023-07-19-git-efa6cec759-full_build-www.gyan.dev (setts), ffprobe 2023-07-19-git-efa6cec759-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1803 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@highwaycafe_th/video/7345036214791163138
[TikTok] 7345036214791163138: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7345036214791163138: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7345036214791163138: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7345036214791163138: Downloading video feed
WARNING: [TikTok] 7345036214791163138: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7345036214791163138: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7345036214791163138: Downloading 1 format(s): download
[debug] Invoking http downloader on "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/o8BQRKDo7Psf8GfFdUGrUtZEg0qFQEliBIgA67/?a=1988&ch=0&cr=3&dr=0&lr=tiktok&cd=0%7C0%7C1%7C&cv=1&br=2660&bt=1330&bti=ODszNWYuMDE6&cs=0&ds=3&ft=4fUEKMZj8Zmo0JGLY94jV~C3ypWrKsd.&mime_type=video_mp4&qs=0&rc=ODRlZDUzOWQ1Zmc4OTtlaUBpM3dlOG85cjlmcTMzODczNEAtMDY0MDBgNTExYmBjLWI0YSNxL2AyMmRjcmtgLS1kMTFzcw%3D%3D&btag=e00088000&expire=1711117107&l=202403220818089D1EA9E997746E309378&ply_type=2&policy=2&signature=1c0c0a2221935452ab930d1e17eaf8d8&tk=tt_chain_token"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: I love Highway Cafe #ลูกรักไฮเวย์  [7345036214791163138].mp4
[download] 100% of    3.08MiB in 00:00:01 at 2.47MiB/s```
format 0 but quality is not good

sorry for asking questions here but I need to know if there's ANY other way of downloading in full quality (watermarked or not) from the webpage. i'm not web literate, so I'm not sure if it's possible to manually access a video through your browser or something, but since i've never seen a mention of it i'm guessing it's not? just wanna be sure
> sorry for asking questions here but I need to know if there's ANY other way of downloading in full quality (watermarked or not) from the webpage. i'm not web literate, so I'm not sure if it's possible to manually access a video through your browser or something, but since i've never seen a mention of it i'm guessing it's not? just wanna be sure很抱歉在这里提问，但我需要知道是否有任何其他方法可以从网页下载全质量（水印或无水印）。我不懂网络，所以我不确定是否可以通过浏览器或其他东西手动访问视频，但由于我从未见过提及它，我猜它不是？只是想确定一下

try it, work well.

[https://www.tiktokarchive.com/](https://www.tiktokarchive.com/)
So are we thinking this is a major api rework from tiktok? All of the aweme api urls seem to be failing often now.

hello guys , who can help me to fix went me donwload video from tiktok with yt-dlp master , still watermark

This issue still happen on nightly and master right?
> This issue still happen on nightly and master right?

Yes it does
Anyone have any ideas on how to fix this?
 ‘Awame ’ this method is ineffective
I'm not very related to tiktok extractor. But I think that with this piece of code can solve the problem. The json response is identical to what the old api used to respond:

```
import requests

video_id = 'ur video id'
headers = {'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36' }

tiktok_video_data_endpoint = 'https://api22-normal-c-alisg.tiktokv.com/aweme/v1/feed/'
params = {
            "iid": "7318518857994389254",
            "device_id": "7318517321748022790",
            "channel": "googleplay",
            "app_name": "musical_ly",
            "version_code": "300904",
            "device_platform": "android",
            "device_type": "ASUS_Z01QD",
            "os_version": "9",
            "aweme_id": video_id  # now video id is used here
        }

try:
    json_video_data = requests.get(tiktok_video_data_endpoint, params=params, headers=headers).json()
except Exception as e:
    raise SystemExit('connection error with api')

print(json_video_data)

```
```py
            "aweme_id": video_id  # now video id is used here
```
^ nah this is how we were always doing it

```py
            "iid": "7318518857994389254",
            "device_id": "7318517321748022790",
```
^ this is what is new, and what I've seen a couple other projects on github start doing today.

TikTok seems to be enforcing/checking the `iid` and `device_id` params now for the feed endpoint. The problem here, is that `iid` is the installation id of the mobile app and `device_id` is the accompanying id for the mobile device on which it is installed. These params [cannot be faked with random values](https://github.com/szdc/tiktok-api/issues/138). So since this `iid` and `device_id` belong to a real TikTok installation on someone's device, it's likely only a matter of time before it is banned for spam/scraping
> ```python
>             "aweme_id": video_id  # now video id is used here
> ```
> 
> ^ nah this is how we were always doing it
> 
> ```python
>             "iid": "7318518857994389254",
>             "device_id": "7318517321748022790",
> ```
> 
> ^ this is what is new, and what I've seen a couple other projects on github start doing today.
> 
> TikTok seems to be enforcing/checking the `iid` and `device_id` params now for the feed endpoint. The problem here, is that `iid` is the installation id of the mobile app and `device_id` is the accompanying id for the mobile device on which it is installed. These params [cannot be faked with random values](https://github.com/szdc/tiktok-api/issues/138). So since this `iid` and `device_id` belong to a real TikTok installation on someone's device, it's likely only a matter of time before it is banned for spam/scraping

mmm and looks like get the `iid` param from the device is not easy, understand. But you can fake `device_id` with a valid  `iid` and still works (which seems strange to me, many devices linked to the same installation id), probably not enough yet
I tried this and it works for now:

```
    def _build_api_query(self, query, app_version, manifest_app_version):
        return {
            **query,
            'version_name': app_version,
            'version_code': manifest_app_version,
            'build_number': app_version,
            'manifest_version_code': manifest_app_version,
            'update_version_code': manifest_app_version,
            'openudid': ''.join(random.choices('0123456789abcdef', k=16)),
            'uuid': ''.join(random.choices(string.digits, k=16)),
            '_rticket': int(time.time() * 1000),
            'ts': int(time.time()),
            #'device_brand': 'Google',
            #'device_type': 'Pixel 7',
            'device_platform': 'android',
            'resolution': '1080*2400',
            'dpi': 420,
            'os_version': '13',
            'os_api': '29',
            'carrier_region': 'US',
            'sys_region': 'US',
            'region': 'US',
            #'app_name': self._APP_NAME,
            'app_language': 'en',
            'language': 'en',
            'timezone_name': 'America/New_York',
            'timezone_offset': '-14400',
            'channel': 'googleplay',
            'ac': 'wifi',
            'mcc_mnc': '310260',
            'is_my_cn': 0,
            #'aid': self._AID,
            'ssmix': 'a',
            'as': 'a1qwert123',
            'cp': 'cbfhckdckkde1',

            "iid": "7318518857994389254",
            "device_id": "7318517321748022790",
            "device_type": "ASUS_Z01QD",
        }
```

Otherwise, I change the `_APP_NAME` field to `"musical_ly"` and it works.
> > 
> 
> try it, work well.
> 
> https://www.tiktokarchive.com/

it does not work, bro.
> > > 
> > 
> > 
> > try it, work well.
> > https://www.tiktokarchive.com/
> 
> it does not work, bro.

This one does https://musicaldown.com
https://github.com/Evil0ctal/Douyin_TikTok_Download_API/commit/1db94fc8ad144abacb344e6f3a7ab471e0ecee46
> [Evil0ctal/Douyin_TikTok_Download_API@1db94fc](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/commit/1db94fc8ad144abacb344e6f3a7ab471e0ecee46)

This still uses the same `iid`, `device_id` and `device_type` data that's floating around already.
> > [Evil0ctal/Douyin_TikTok_Download_API@1db94fc](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/commit/1db94fc8ad144abacb344e6f3a7ab471e0ecee46)
> 
> This still uses the same `iid`, `device_id` and `device_type` data that's floating around already.

Does that mean there's still a risk of access to the TikTok API endpoint being down again in the future?
> Does that mean there's still a risk of access to the TikTok API endpoint being down again in the future?

The endpoint hasn't been down. It has become more restricted. One solution to these increased restrictions is to pass an `iid` & `device_id` pair.

Each installation of the TT mobile app is assigned a unique `iid` value, presumably for security and tracking purposes. If we were to add this 1 `iid` value to yt-dlp's TT extractor, then due to the volume of yt-dlp users, there is a high probability that this `iid` would be blocked by TT shortly after the next stable release (if not sooner). IMO this is not a viable solution. It would be fairly easy to create a plugin that utilizes this solution, though
while I am against hardcoding someone else's `iid` into the extractor, perhaps a "bring your own `iid`" approach would be acceptable until a better/proper solution is found.

here's a patch with a minimal diff that would allow you to pass `--extractor-args "tiktok:iid=VALUE"`, replacing `VALUE` with an actual working `iid` value
```diff
diff --git a/yt_dlp/extractor/tiktok.py b/yt_dlp/extractor/tiktok.py
index 02545bc79..e7d0c2063 100644
--- a/yt_dlp/extractor/tiktok.py
+++ b/yt_dlp/extractor/tiktok.py
@@ -32,8 +32,8 @@
 class TikTokBaseIE(InfoExtractor):
     _APP_VERSIONS = [('26.1.3', '260103'), ('26.1.2', '260102'), ('26.1.1', '260101'), ('25.6.2', '250602')]
     _WORKING_APP_VERSION = None
-    _APP_NAME = 'trill'
-    _AID = 1180
+    _APP_NAME = 'musical_ly'
+    _AID = 0
     _UPLOADER_URL_FORMAT = 'https://www.tiktok.com/@%s'
     _WEBPAGE_HOST = 'https://www.tiktok.com/'
     QUALITIES = ('360p', '540p', '720p', '1080p')
@@ -41,7 +41,7 @@ class TikTokBaseIE(InfoExtractor):
     @property
     def _API_HOSTNAME(self):
         return self._configuration_arg(
-            'api_hostname', ['api22-normal-c-useast2a.tiktokv.com'], ie_key=TikTokIE)[0]
+            'api_hostname', ['api22-normal-c-alisg.tiktokv.com'], ie_key=TikTokIE)[0]
 
     @staticmethod
     def _create_url(user_id, video_id):
@@ -106,6 +106,8 @@ def _build_api_query(self, query, app_version, manifest_app_version):
             'ssmix': 'a',
             'as': 'a1qwert123',
             'cp': 'cbfhckdckkde1',
+            'iid': self._configuration_arg('iid', ['0'], ie_key=TikTokIE)[0],
+            'device_id': ''.join(random.choices(string.digits, k=16)),
         }
 
     def _call_api(self, ep, query, video_id, fatal=True,
```
@bashonly Seems like a decent workaround. Is there an easy way to get our own iid from the iOS tiktok app? 
> @bashonly Seems like a decent workaround. Is there an easy way to get our own iid from the iOS tiktok app?

https://medium.com/@szdc/reverse-engineering-the-musical-ly-api-662331008eb3 describes the steps needed to do this, but uses Android. Bottom line - you need to capture the unencrypted traffic between your phone and the server. It's of course possible that this value is also stored in the app's persistent storage somewhere but I don't think anybody's explored that so far.
@dylanpdx
Thank boss for fixed this issue❤
https://github.com/JunkFood02/Seal/issues/1376
The same problem occurs with [tiktok:tag], even though this problem has already been fixed for downloading a single video on tiktok.

```
[debug] Command-line config: ['-vU', '--flat-playlist', 'https://www.tiktok.com/tag/asmr']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.04.03.233315 from yt-dlp/yt-dlp-nightly-builds [0ae16ceb1] (pip)
[debug] Python 3.10.8 (CPython arm64 64bit) - macOS-14.4-arm64-arm-64bit (OpenSSL 1.1.1w  11 Sep 2023)
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.15.0, brotlicffi-1.1.0.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.41.2, urllib3-1.26.18, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1809 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.04.03.233315 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.04.03.233315 from yt-dlp/yt-dlp-nightly-builds)
WARNING: The program functionality for this site has been marked as broken, and will probably not work.
[tiktok:tag] Extracting URL: https://www.tiktok.com/tag/asmr
[tiktok:tag] asmr: Downloading webpage
[download] Downloading playlist: asmr
[debug] [tiktok:tag] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351153174894626592'}
[tiktok:tag] asmr: Downloading video list page 1
WARNING: [tiktok:tag] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 3)
[debug] [tiktok:tag] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351144126450059040'}
[tiktok:tag] asmr: Downloading video list page 1
WARNING: [tiktok:tag] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 3)
[debug] [tiktok:tag] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351149742343391009'}
[tiktok:tag] asmr: Downloading video list page 1
WARNING: [tiktok:tag] Expecting value in '': line 1 column 1 (char 0). Retrying (1/3)...
[debug] [tiktok:tag] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351149742343391009'}
[tiktok:tag] asmr: Downloading video list page 1
WARNING: [tiktok:tag] Expecting value in '': line 1 column 1 (char 0). Retrying (2/3)...
[debug] [tiktok:tag] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351149742343391009'}
[tiktok:tag] asmr: Downloading video list page 1
WARNING: [tiktok:tag] Expecting value in '': line 1 column 1 (char 0). Retrying (3/3)...
[debug] [tiktok:tag] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351149742343391009'}
[tiktok:tag] asmr: Downloading video list page 1
ERROR: asmr: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/Users/quinera/anaconda3/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 553, in decode
    return super().decode(s)
  File "/Users/quinera/anaconda3/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/quinera/anaconda3/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/quinera/anaconda3/lib/python3.10/site-packages/yt_dlp/extractor/common.py", line 1066, in _parse_json
    return json.loads(
  File "/Users/quinera/anaconda3/lib/python3.10/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
  File "/Users/quinera/anaconda3/lib/python3.10/site-packages/yt_dlp/utils/_utils.py", line 561, in decode
    raise type(e)(f'{e.msg} in {s[e.pos - 10:e.pos + 10]!r}', s, e.pos)
json.decoder.JSONDecodeError: Expecting value in '': line 1 column 1 (char 0)

[tiktok:tag] Playlist asmr: Downloading 1 items
[debug] The information of all playlist entries will be held in memory
[download] Finished downloading playlist: asmr
```
@Quinera #4952

I still get the error (location: Russia):

```
[debug] Command-line config: ['--get-url', 'https://www.tiktok.com/@filmuniversum/video/7324768015743028486', '-vvvvvvvvvvvvvvv']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447]
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.8.2-arch2-1-x86_64-with-glibc2.39 (OpenSSL 3.2.1 30 Jan 2024, glibc 2.39)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.12.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.45.2, urllib3-1.26.18
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1809 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@filmuniversum/video/7324768015743028486
[debug] [TikTok] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351149742343391009'}
[TikTok] 7324768015743028486: Downloading video feed
WARNING: [TikTok] 7324768015743028486: Unable to find video in feed; trying with webpage
[TikTok] 7324768015743028486: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
ERROR: [TikTok] 7324768015743028486: Video not available, status code 10204; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/usr/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 734, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/yt_dlp/extractor/tiktok.py", line 790, in _real_extract
    raise ExtractorError(f'Video not available, status code {status}', video_id=video_id)
```

<details>
  <summary>Everything works with VPN</summary>

```
[debug] Command-line config: ['--get-url', 'https://www.tiktok.com/@filmuniversum/video/7324768015743028486', '-vvvvvvvvvvvvvvv']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447]
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.8.2-arch2-1-x86_64-with-glibc2.39 (OpenSSL 3.2.1 30 Jan 2024, glibc 2.39)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.12.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.45.2, urllib3-1.26.18
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1809 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@filmuniversum/video/7324768015743028486
[debug] [TikTok] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351144126450059040'}
[TikTok] 7324768015743028486: Downloading video feed
[debug] Sort order given by extractor: quality, codec, size, br
[debug] Formats sorted by: hasvid, ie_pref, quality, vcodec, acodec, size, br, lang, res, fps, hdr:12(7), channels, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7324768015743028486: Downloading 1 format(s): bytevc1_540p_877905-2
https://v16m.byteicdn.com/d02dde65b4f87fc19ca283bbc89dc171/660ecc50/video/tos/useast2a/tos-useast2a-ve-0068c001/oQYymACg2kPvqiEyG0ifgAoYh4EwbuI7IbB8CK/?a=0&bti=Ozk3QGo4dik3OjlmMzAuYCM6bTQ0MDo%3D&ch=0&cr=13&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=1714&bt=857&cs=2&ds=6&ft=pK~tdMUx8Zmo0i8tz-4jV.PlWGWrKsd.&mime_type=video_mp4&qs=11&rc=NjpnaTQ0aWk0NzplZmRoM0BpMzQ7cHY5cjhmcDMzNzczM0BhNWJiMWAvX2IxNWJeYi0yYSNrMjJxMmRjb2dgLS1kMTZzcw%3D%3D&vvpl=1&l=202404040950280A1AD7055CB70E92EC67&btag=e00088000&cc=10
```

</details>

Although TikTok [partially restricted content in Russia back in 2022](https://en.wikipedia.org/wiki/Censorship_of_TikTok#Russia), banned videos were accessible via yt-dlp before this TikTok API change. However, they are no longer accessible. Is there any fix for this, if possible?
@oifj34f34f try running `yt-dlp --update-to master`
@gamer191 

```
$ ./yt-dlp --update-to master
Latest version: master@2024.04.03.233435 from yt-dlp/yt-dlp-master-builds
yt-dlp is up to date (master@2024.04.03.233435 from yt-dlp/yt-dlp-master-builds)

$ ./yt-dlp --get-url https://www.tiktok.com/@filmuniversum/video/7324768015743028486 -vvvvvvvvvvvvvvv
[debug] Command-line config: ['--get-url', 'https://www.tiktok.com/@filmuniversum/video/7324768015743028486', '-vvvvvvvvvvvvvvv']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version master@2024.04.03.233435 from yt-dlp/yt-dlp-master-builds [0ae16ceb1] (linux_exe)
[debug] Python 3.10.14 (CPython x86_64 64bit) - Linux-6.8.2-arch2-1-x86_64-with-glibc2.39 (OpenSSL 3.2.1 30 Jan 2024, glibc 2.39)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.45.2, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1809 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@filmuniversum/video/7324768015743028486
[debug] [TikTok] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351153174894626592'}
[TikTok] 7324768015743028486: Downloading video feed
WARNING: [TikTok] 7324768015743028486: Unable to find video in feed; trying with webpage
[TikTok] 7324768015743028486: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
ERROR: [TikTok] 7324768015743028486: Video not available, status code 10204; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp/extractor/common.py", line 734, in extract
  File "yt_dlp/extractor/tiktok.py", line 790, in _real_extract
```

Example of a random unbanned video (works without VPN):

<details>
  <summary>Show log</summary>

```
$ ./yt-dlp --get-url https://www.tiktok.com/@sable_tepa/video/7054974037893614849 -vvvvvvvvvvvvvvv
[debug] Command-line config: ['--get-url', 'https://www.tiktok.com/@sable_tepa/video/7054974037893614849', '-vvvvvvvvvvvvvvv']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version master@2024.04.03.233435 from yt-dlp/yt-dlp-master-builds [0ae16ceb1] (linux_exe)
[debug] Python 3.10.14 (CPython x86_64 64bit) - Linux-6.8.2-arch2-1-x86_64-with-glibc2.39 (OpenSSL 3.2.1 30 Jan 2024, glibc 2.39)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.45.2, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1809 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@sable_tepa/video/7054974037893614849
[debug] [TikTok] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351153174894626592'}
[TikTok] 7054974037893614849: Downloading video feed
[debug] Extractor gave empty title. Creating a generic title
[debug] Sort order given by extractor: quality, codec, size, br
[debug] Formats sorted by: hasvid, ie_pref, quality, vcodec, acodec, size, br, lang, res, fps, hdr:12(7), channels, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7054974037893614849: Downloading 1 format(s): bytevc1_720p_1156114-2
https://v16m.byteicdn.com/4b28543629983fe56760a6c0af4edc38/660ee4c3/video/tos/alisg/tos-alisg-pve-0037c001/920e2338fe384c20979e8b67691e9d26/?a=0&bti=OHYpOTY0Zik3OjlmOm01MzE6ZDQ0MDo%3D&ch=0&cr=13&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=2258&bt=1129&cs=2&ds=3&ft=teSL~8HWoJDr12Nvwas6hIxRoDwixQ_45SY&mime_type=video_mp4&qs=14&rc=OmY6NWY7NWlnZzRoOTppZEBpM3Q7eGY6ZnE3OjMzODczNEAtMDYyLzA2NS0xYV4yXjIxYSNobHNjcjRnbmhgLS1kMS1zcw%3D%3D&vvpl=1&l=202404041134462E816F02C49842FE41D6&btag=e00088000&cc=10
```

</details>


@oifj34f34f try adding this to your command:
```
--extractor-arg "tiktok:app_info=18403141793/trill/26.1.3/260103"
```
that will pass yt-dlp's old app name and version for use with the API. If that doesn't work, then AFAICT the only solution is VPN/proxy
@bashonly The error is still present. Anyway, thanks for the reply. I will be using [ProxiTok](https://proxitok.belloworld.it/@filmuniversum/video/7324768015743028486) for now.

Edit: It's worth noting that when using TikTok Revanced with the SIM spoof patch, all videos are accessible without VPN
@bashonly Passing `carrier_region=US` in the query fixes the problem:

```
[debug] Command-line config: ['--get-url', 'https://www.tiktok.com/@filmuniversum/video/7324768015743028486', '-vvvvvvvv']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447] (source)
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: 9073ae6
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.8.2-arch2-1-x86_64-with-glibc2.39 (OpenSSL 3.2.1 30 Jan 2024, glibc 2.39)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.12.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.2, urllib3-1.26.18
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1809 extractors
[TikTok] Extracting URL: https://www.tiktok.com/@filmuniversum/video/7324768015743028486
[debug] [TikTok] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': '7351153174894626592'}
[TikTok] 7324768015743028486: Downloading video feed
[debug] Sort order given by extractor: quality, codec, size, br
[debug] Formats sorted by: hasvid, ie_pref, quality, vcodec, acodec, size, br, lang, res, fps, hdr:12(7), channels, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7324768015743028486: Downloading 1 format(s): bytevc1_1080p_2037607-2
https://v16m.byteicdn.com/44f7a8d8c541be5ae2e78d76679118d6/66117a4d/video/tos/useast2a/tos-useast2a-pve-0068/ooImEQgPI4q0AmBy7iSjfh5Yub8CKiCokC20AL/?a=0&bti=OHYpOTY0Zik3OjlmOm01MzE6ZDQ0MDo%3D&ch=0&cr=13&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=3978&bt=1989&cs=2&ds=4&ft=teSL~8HWoJDr12NvidUAhIxRoDwixQ_45SY&mime_type=video_mp4&qs=15&rc=NDo8PDdpNDZpNDwzaDlkaUBpMzQ7cHY5cjhmcDMzNzczM0A2MTQuNWMxXjIxMC8xYi8uYSNrMjJxMmRjb2dgLS1kMTZzcw%3D%3D&vvpl=1&l=202404061037220CACA53DFC5482E759A6&btag=e00088000&cc=10
```

Can we add it to yt-dlp again?
@oifj34f34f nice find. #9637
[TikTok] Extracting URL: https://www.tiktok.com/@woodbrartwork/video/7355576988435795205
[TikTok] 7355576988435795205: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 3)
[TikTok] 7355576988435795205: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 3)
[TikTok] 7355576988435795205: Downloading video feed
WARNING: [TikTok] 7355576988435795205: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7355576988435795205: Downloading webpage
[info] 7355576988435795205: Downloading 1 format(s): download
[download] Destination: C:\Users\VID\Desktop\@woodbrartwork\TikTok video #7355576988435795205#2.mp4
[download] 100% of   12.58MiB in 00:00:01 at 7.12MiB/s
@nodata168 Update to nightly and **post verbose log**
@pukkandan okay wait, I will try but why master does not work

I mean: nightly or master. They are the same atm
@pukkandan or and how can we fix

> [TikTok] Extracting URL: https://www.tiktok.com/@woodbrartwork/video/7355576988435795205 [TikTok] 7355576988435795205: Downloading video feed WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 3) [TikTok] 7355576988435795205: Downloading video feed WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 3) [TikTok] 7355576988435795205: Downloading video feed WARNING: [TikTok] 7355576988435795205: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage [TikTok] 7355576988435795205: Downloading webpage [info] 7355576988435795205: Downloading 1 format(s): download [download] Destination: C:\Users\VID\Desktop@woodbrartwork\TikTok video #7355576988435795205#2.mp4 [download] 100% of 12.58MiB in 00:00:01 at 7.12MiB/s

I'm getting the same error with any video. Looks like the TikTok parser is broken again
Looks like TT has blocked the IIDs that are hardcoded in the extractor, and also possibly blocked its device fingerprint from `api22-normal-c-useast2a.tiktokv.com`.

A workaround is to pass:
```
--extractor-arg "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=INFO"
```
replacing `INFO` with the actual app info such as a working `iid`, or `iid/app_name` pair, etc

edit: fixed typo in original extractor-arg example
> Looks like TT has blocked the IIDs that are hardcoded in the extractor, and also possibly blocked its device fingerprint from `api22-normal-c-useast2a.tiktokv.com`.
> 
> A workaround is to pass:
> 
> ```
> --extractor-arg "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=INFO"
> ```
> 
> replacing `INFO` with the actual app info such as a working `iid`, or `iid/app_name` pair, etc
> 
> edit: fixed typo in original extractor-arg example

Where can I get the install ID from? Can I extract it on Android using a simple root file explorer?
![Screenshot 2024-04-13 210513](https://github.com/yt-dlp/yt-dlp/assets/162959903/e14fc919-5953-43d6-9ff1-444f8e36d2d1)

> Looks like TT has blocked the IIDs that are hardcoded in the extractor, and also possibly blocked its device fingerprint from `api22-normal-c-useast2a.tiktokv.com`.
> 
> A workaround is to pass:
> 
> ```
> --extractor-arg "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=INFO"
> ```
> 
> replacing `INFO` with the actual app info such as a working `iid`, or `iid/app_name` pair, etc
> 
> edit: fixed typo in original extractor-arg example

I'm still getting watermarks on all videos I download using this workaround. XXXXXXXXXXXXXXXXXXX is my working iid.

```
(yt-dlp -vU --extractor-args "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=XXXXXXXXXXXXXXXXXXX" https://www.tiktok.com/@herberttwins/video/7357488251264847122
[debug] Command-line config: ['-vU', '--extractor-args', 'tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=XXXXXXXXXXXXXXXXXXX', 'https://www.tiktok.com/@herberttwins/video/7357488251264847122']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.04.13.232802 from yt-dlp/yt-dlp-nightly-builds [315b35442] (pip)
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-102-generic-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2020.06.20, mutagen-1.45.1, pyxattr-0.7.2, requests-2.31.0, secretstorage-3.3.1, sqlite3-3.37.2, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Extractor Plugins: TTUser (TikTokUserIE)
[debug] Plugin directories: ['/home/USER/.local/lib/python3.10/site-packages/yt_dlp_plugins']
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.04.13.232802 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.04.13.232802 from yt-dlp/yt-dlp-nightly-builds)
[TikTok] Extracting URL: https://www.tiktok.com/@herberttwins/video/7357488251264847122
[debug] [TikTok] {'app_name': 'musical_ly', 'app_version': '34.1.2', 'manifest_app_version': '2023401020', 'aid': '0', 'iid': 'XXXXXXXXXXXXXXXXXXX'}
[TikTok] 7357488251264847122: Downloading video feed
WARNING: [TikTok] 7357488251264847122: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7357488251264847122: Downloading webpage
[debug] [TikTok] Found universal data for rehydration
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7357488251264847122: Downloading 1 format(s): download
[debug] Invoking http downloader on "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/oQOEhfvbFgiRDOKEQejEAVBUDBGFILIxmTyqMg/?a=1988&bti=ODszNWYuMDE6&ch=0&cr=3&dr=0&lr=tiktok_m&cd=0%7C0%7C1%7C&cv=1&br=2660&bt=1330&cs=0&ds=3&ft=4fUEKMP78Zmo0EC-u-4jVVp7ypWrKsd.&mime_type=video_mp4&qs=0&rc=OzxmZTlnOGk1ZDw8ZjxpZUBpam1ycGs5cjhpcjMzODczNEBjYzAzLTAtXzAxNjY1NTQuYSNkXjRuMmRjbWFgLS1kMTFzcw%3D%3D&btag=e00090000&expire=1713083818&l=20240414023555701463B217677068E3D0&ply_type=2&policy=2&signature=5fcbff231876064e4848b87b4270768a&tk=tt_chain_token"
[download] Destination: Day 1 coachella lets get ready 🎀🎀🎀 [7357488251264847122].mp4
[download] 100% of   10.20MiB in 00:00:01 at 5.54MiB/s)
```
@modelfe are you sure it is a `musical_ly` iid and not a `trill` iid? you could try appending `/trill` to your iid in the `app_info` arg

@1RandomDev I think you'd need to mitmproxy the app and examine the http requests

For a working example, see the iid posted by someone else further up this thread
@1RandomDev Try this: https://julien.duponchelle.info/android/use-proxy-with-waydroid

And then add the `iid` from the `https://api16-core-c-alisg.tiktokv.com/aweme/v2/feed/` request in mitmweb to `~/.config/yt-dlp/config` (or you can use mine):

```sh
--extractor-args 'tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=7355728856979392262'
```
I apologize for the off-topic, but I have an idea.

Why not add to yt-dlp the ability to specify the login and password of my ticktock account? Because if I open the videos in my browser, they don't have watermarks on them. And in google chrome console there are such requests:

`https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-censored/censored/?a=censored&bti=censored&ch=0&cr=3&dr=0&lr=unwatermarked&cd=censored&cv=1&br=censored&bt=censored&cs=0&ds=6&ft=-censored&mime_type=video_mp4&qs=0&rc=censored&btag=censored&expire=censored&l=censored&ply_type=2&policy=2&signature=censored&tk=tt_chain_token&__vid=TT-vCache-censored`


And there is this parameter:

`lr=unwatermarked`.

But if I open the link from this query in a new tab, there will be 403 error. But maybe you can teach yt-dlp to download videos from such requests.
If a logon would help, couldn't yt-dlp just get the session info from the browser using "--cookies-from-browser [browser]", the same way it works for Youtube?  (using that doesn't seem to help with the issue currently)
With master fix #9548 it returns only a couple of formats. The urls return a "403 Access Denied" if opened on browser. Though yt-dlp is still able to download them directly. With the extractor-args provided by @oifj34f34f it works and returns all formats. Is it supposed to be like that or maybe donated IDs are not working?

````
λ yt-dlp -F "https://www.tiktok.com/@clipsdocoringada/video/7353063188956581126"
[TikTok] Extracting URL: https://www.tiktok.com/@clipsdocoringada/video/7353063188956581126
[TikTok] 7353063188956581126: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 3)
[TikTok] 7353063188956581126: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 3)
[TikTok] 7353063188956581126: Downloading video feed
WARNING: [TikTok] 7353063188956581126: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7353063188956581126: Downloading webpage
[info] Available formats for 7353063188956581126:
ID       EXT RESOLUTION │ PROTO │ VCODEC  ACODEC
─────────────────────────────────────────────────
0        mp4 576x1024   │ https │ unknown unknown
download mp4 576x1024   │ https │ unknown unknown
````

````
λ yt-dlp -F --extractor-args "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=7355728856979392262" "https://www.tiktok.com/@clipsdocoringada/video/7353063188956581126"
[TikTok] Extracting URL: https://www.tiktok.com/@clipsdocoringada/video/7353063188956581126
[TikTok] 7353063188956581126: Downloading video feed
[info] Available formats for 7353063188956581126:
ID                     EXT RESOLUTION │  FILESIZE   TBR PROTO │ VCODEC ACODEC MORE INFO
───────────────────────────────────────────────────────────────────────────────────────────────────────────────
download_addr-0        mp4 720x1280   │  10.96MiB       https │ h264   aac    Download video, watermarked (API)
download_addr-1        mp4 720x1280   │  10.96MiB       https │ h264   aac    Download video, watermarked
download_addr-2        mp4 720x1280   │  10.96MiB       https │ h264   aac    Download video, watermarked
h264_540p_1400133-0    mp4 576x1024   │  10.33MiB 1400k https │ h264   aac    Direct video (API)
h264_540p_1400133-1    mp4 576x1024   │  10.33MiB 1400k https │ h264   aac    Direct video
h264_540p_1400133-2    mp4 576x1024   │  10.33MiB 1400k https │ h264   aac    Direct video
bytevc1_540p_301807-0  mp4 576x1024   │   2.23MiB  301k https │ h265   aac    Playback video (API)
bytevc1_540p_301807-1  mp4 576x1024   │   2.23MiB  301k https │ h265   aac    Playback video
bytevc1_540p_301807-2  mp4 576x1024   │   2.23MiB  301k https │ h265   aac    Playback video
bytevc1_540p_387321-0  mp4 576x1024   │   2.86MiB  387k https │ h265   aac    Playback video (API)
bytevc1_540p_387321-1  mp4 576x1024   │   2.86MiB  387k https │ h265   aac    Playback video
bytevc1_540p_387321-2  mp4 576x1024   │   2.86MiB  387k https │ h265   aac    Playback video
bytevc1_540p_677047-0  mp4 576x1024   │   5.00MiB  677k https │ h265   aac    Direct video (API)
bytevc1_540p_677047-1  mp4 576x1024   │   5.00MiB  677k https │ h265   aac    Direct video
bytevc1_540p_677047-2  mp4 576x1024   │   5.00MiB  677k https │ h265   aac    Direct video
bytevc1_720p_734845-0  mp4 720x1280   │   5.42MiB  734k https │ h265   aac    Playback video (API)
bytevc1_720p_734845-1  mp4 720x1280   │   5.42MiB  734k https │ h265   aac    Playback video
bytevc1_720p_734845-2  mp4 720x1280   │   5.42MiB  734k https │ h265   aac    Playback video
bytevc1_1080p_964801-0 mp4 1080x1920  │   7.12MiB  964k https │ h265   aac    Playback video (API)
bytevc1_1080p_964801-1 mp4 1080x1920  │   7.12MiB  964k https │ h265   aac    Playback video
bytevc1_1080p_964801-2 mp4 1080x1920  │   7.12MiB  964k https │ h265   aac    Playback video
````
@renandecarlo 

> donated IDs are not working?

yes, as explained in https://github.com/yt-dlp/yt-dlp/issues/9506#issuecomment-2049741622

> The urls return a "403 Access Denied" if opened on browser

the webpage-extracted format URLs need cookies (and possibly the same UA?)

Hi, I am having the same issue mentioned in the thread where it says "Unable to extract webpage video data". I read through all the comments here, but was a bit confused on how to exactly fix it. This is the command I am entering right now: 
yt-dlp https://www.tiktok.com/@/video/7301727453909716267 -o 7301727453909716267.mp4.

What extra arguments do I need to add to it? What do I need to upgrade? It'll be helpful if someone could exactly tell me on what to do. Thank you!
@shreyakannan1205, 

it should be something like this
```
yt-dlp --extractor-args "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=7355728856979392262" "https://www.tiktok.com/@/video/7301727453909716267" -o 7301727453909716267.mp4
```
> @zulfiqarlaili ,
> 
> it should be something like this
> 
> ```
> yt-dlp --extractor-args "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=7355728856979392262" "https://www.tiktok.com/@/video/7301727453909716267" -o 7301727453909716267.mp4
> ```

Thank you!! You've included app_info=7355728856979392262, is this specific to a system? If so, how do I find it?

@renandecarlo, im using yt-dlp for my python code. I want to use the solution you gave
>yt-dlp -F --extractor-args "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=7355728856979392262" "https://www.tiktok.com/@clipsdocoringada/video/7353063188956581126"

I edit my code to add the `extractor-args` just like the above but i could not get the video
```
ydl_opts = {
        "skip_download": True,
        "format": "best",
        "extractor_args": {
            "youtube": {
                "player_client": ["android", "web"],
            },
            "youtube:tab": {
                "skip": ["ios"],
            },
            "tiktok": {
                "api_hostname": "api16-normal-c-useast1a.tiktokv.com",
                "app_info": "7355728856979392262",
            },
        },
    }

    try:
        with yt_dlp.YoutubeDL(ydl_opts) as ydl:
            info_dict = ydl.extract_info(url, download=True)
            return Response(
                content=json.dumps(
                    {
                        "title": info_dict.get("title"),
                        "thumbnail": info_dict.get("thumbnail"),
                        "download_url": info_dict.get("url"),
                    }
                ),
                media_type="application/json",
                status_code=200,
            )
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))
```

the error
```
[TikTok] Extracting URL: https://www.tiktok.com/@catplanet6/video/7309135341791792426?is_from_webapp=1
[TikTok] 7309135341791792426: Downloading video feed
WARNING: [TikTok] Unable to download video feed: <urllib3.connection.HTTPSConnection object at 0x106d41b10>: Failed to resolve 'a' ([Errno 8] nodename nor servname provided, or not known) (caused by TransportError("<urllib3.connection.HTTPSConnection object at 0x106d41b10>: Failed to resolve 'a' ([Errno 8] nodename nor servname provided, or not known)")); trying with webpage
[TikTok] 7309135341791792426: Downloading webpage
[info] 7309135341791792426: Downloading 1 format(s): download
```

It would be so helpful if you can show me what did i do wrong in this code
@shreyakannan1205 , I believe that is an `iid` but Im not sure how do they get it. You may ask @renandecarlo 
@zulfiqarlaili extractor arg values always need to be lists of strings, e.g.
```py
        "api_hostname": ["api16-normal-c-useast1a.tiktokv.com"],
```
do the same for `app_info`
Please read all of the comments that haven't been resolved/marked as duplicate in this issue before asking questions
> @zulfiqarlaili extractor arg values always need to be lists of strings, e.g.
> 
> ```python
>         "api_hostname": ["api16-normal-c-useast1a.tiktokv.com"],
> ```
> 
> do the same for `app_info`

@bashonly the above solution works! Thank you so much
> A workaround is to pass:
> 
> ```
> --extractor-arg "tiktok:api_hostname=api16-normal-c-useast1a.tiktokv.com;app_info=INFO"
> ```
> 
> replacing `INFO` with the actual app info such as a working `iid`, or `iid/app_name` pair, etc
> 
> edit: fixed typo in original extractor-arg example

Using this, and the `app_info=7355728856979392262` someone else provided, I'm able to download without watermarks, but when I compare the available formats and resulting downloads to a few existing files I'd downloaded previously, I'm finding they're lower quality - is this `iid` dependent? Is it api dependent?
> but when I compare the available formats and resulting downloads to a few existing files I'd downloaded previously, I'm finding they're lower quality - is this iid dependent? Is it api dependent?

not iid dependent. and we are using the same API endpoint. TikTok is a hostile moving target, it's not realistic to expect consistency
Not sure if others have mentioned, but detection of higher resolution formats is broken again.
this issue is still ongoing for me 
> [BurningAlfalfa](/BurningAlfalfa)

Now you need to get and add your own `iid` on extractor args from tiktok app. Read @oifj34f34f https://github.com/yt-dlp/yt-dlp/issues/9506#issuecomment-2053987537
> > [BurningAlfalfa](/BurningAlfalfa)
> 
> Now you need to get and add your own `iid` on extractor args from tiktok app. Read @oifj34f34f https://github.com/yt-dlp/yt-dlp/issues/9506#issuecomment-2053987537

But you cant use this with Seal (Android App) i think. It's there a way to make this work with Seal?
@sami155 https://github.com/JunkFood02/Seal/issues/1478
trying to grab my own iid with a mitm has been quite a frustrating endeavor, but I'm glad it at least exists as an option. now we need a marketplace of iids for people to purchase 😹 
> trying to grab my own iid with a mitm has been quite a frustrating endeavor, but I'm glad it at least exists as an option. now we need a marketplace of iids for people to purchase 😹

Easiest way is on PC with Android Emulator + HTTP Toolkit
> PC with Android Emulator + HTTP Toolkit

I'm currently trying this, I can see a gourp id and a trace id but no iid
adding `-f 0` worked for me
Update: TT has changed something and the workarounds given in this issue seem to no longer be effective
Looks like now tiktok backend actually verifies cryptographic signatures of API requests to /feed endpoint, such as X-Gorgon, X-Argus, X-Ladon, based on the rest of request information (url, query params, etc). That's why tiktok app still works, but your scrapers don't. You're cooked, unless someone drops reverse-engineered algorithms. Btw, there is outdated X-Gorgon generators on GitHub, if someone may find it useful

UPD: nevermind, they don't do it anymore
I wonder how those download sites still work, even with unwatermarked videos
It seems the webpage fallback is not accounting for the `video[bitrateInfo]` data in the json, which contains a few more format options. It returns only `video[playAddr]` and `video[downloadAddr]`
It should be useful now that the mobile API is gone
Adding the correct `device_id` and `host` worked for me (for now)

![2024-05-17 18_00_36-Window](https://github.com/yt-dlp/yt-dlp/assets/6974980/b73b53d2-b45c-4195-b8ac-eafa62f8614e)

> Adding the correct `device_id` and `host` worked for me (for now)
> 
> ![2024-05-17 18_00_36-Window](https://private-user-images.githubusercontent.com/6974980/331729800-b73b53d2-b45c-4195-b8ac-eafa62f8614e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5ODA1ODgsIm5iZiI6MTcxNTk4MDI4OCwicGF0aCI6Ii82OTc0OTgwLzMzMTcyOTgwMC1iNzNiNTNkMi1iNDVjLTQxOTUtYjhhYy1lYWZhNjJmODYxNGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MTdUMjExMTI4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjVhZDZmM2Y3Nzg0YjdlOTRkNzMzODFlZWY4ZjgyMWZkNjI2Nzg5NzdjZGJkNjEwNTgyNjU2NjExMzg2YzRhOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.FhSx7m4BrZXBML3Y12OGXURyXV6L9jxJcRSwmDtPD5A)

Can you show how the curl would look?

Resolving patch:
diff --git a/yt_dlp/extractor/tiktok.py b/yt_dlp/extractor/tiktok.py
--- a/yt_dlp/extractor/tiktok.py
+++ b/yt_dlp/extractor/tiktok.py
@@ -19,6 +19,8 @@
     int_or_none,
     join_nonempty,
     merge_dicts,
+    mimetype2ext,
+    parse_qs,
     qualities,
     remove_start,
     srt_subtitles_timecode,
@@ -239,23 +241,22 @@ def _get_subtitles(self, aweme_detail, aweme_id):
                 })
         return subtitles
 
+    def _parse_url_key(self, url_key):
+        format_id, codec, res, bitrate = self._search_regex(
+            r'v[^_]+_(?P<id>(?P<codec>[^_]+)_(?P<res>\d+p)_(?P<bitrate>\d+))', url_key,
+            'url key', default=(None, None, None, None), group=('id', 'codec', 'res', 'bitrate'))
+        if not format_id:
+            return {}, None
+        return {
+            'format_id': format_id,
+            'vcodec': 'h265' if codec == 'bytevc1' else codec,
+            'tbr': int_or_none(bitrate, scale=1000) or None,
+            'quality': qualities(self.QUALITIES)(res),
+        }, res
+
     def _parse_aweme_video_app(self, aweme_detail):
         aweme_id = aweme_detail['aweme_id']
         video_info = aweme_detail['video']
-
-        def parse_url_key(url_key):
-            format_id, codec, res, bitrate = self._search_regex(
-                r'v[^_]+_(?P<id>(?P<codec>[^_]+)_(?P<res>\d+p)_(?P<bitrate>\d+))', url_key,
-                'url key', default=(None, None, None, None), group=('id', 'codec', 'res', 'bitrate'))
-            if not format_id:
-                return {}, None
-            return {
-                'format_id': format_id,
-                'vcodec': 'h265' if codec == 'bytevc1' else codec,
-                'tbr': int_or_none(bitrate, scale=1000) or None,
-                'quality': qualities(self.QUALITIES)(res),
-            }, res
-
         known_resolutions = {}
 
         def audio_meta(url):
@@ -270,7 +271,7 @@ def audio_meta(url):
             } if ext == 'mp3' or '-music-' in url else {}
 
         def extract_addr(addr, add_meta={}):
-            parsed_meta, res = parse_url_key(addr.get('url_key', ''))
+            parsed_meta, res = self._parse_url_key(addr.get('url_key', ''))
             is_bytevc2 = parsed_meta.get('vcodec') == 'bytevc2'
             if res:
                 known_resolutions.setdefault(res, {}).setdefault('height', int_or_none(addr.get('height')))
@@ -284,7 +285,7 @@ def extract_addr(addr, add_meta={}):
                 'acodec': 'aac',
                 'source_preference': -2 if 'aweme/v1' in url else -1,  # Downloads from API might get blocked
                 **add_meta, **parsed_meta,
-                # bytevc2 is bytedance's proprietary (unplayable) video codec
+                # bytevc2 is bytedance's own custom h266/vvc codec, as-of-yet unplayable
                 'preference': -100 if is_bytevc2 else -1,
                 'format_note': join_nonempty(
                     add_meta.get('format_note'), '(API)' if 'aweme/v1' in url else None,
@@ -296,6 +297,7 @@ def extract_addr(addr, add_meta={}):
         formats = []
         width = int_or_none(video_info.get('width'))
         height = int_or_none(video_info.get('height'))
+        ratio = try_call(lambda: width / height) or 0.5625
         if video_info.get('play_addr'):
             formats.extend(extract_addr(video_info['play_addr'], {
                 'format_id': 'play_addr',
@@ -312,8 +314,8 @@ def extract_addr(addr, add_meta={}):
                 'format_id': 'download_addr',
                 'format_note': 'Download video%s' % (', watermarked' if video_info.get('has_watermark') else ''),
                 'vcodec': 'h264',
-                'width': dl_width or width,
-                'height': try_call(lambda: int(dl_width / 0.5625)) or height,  # download_addr['height'] is wrong
+                'width': dl_width,
+                'height': try_call(lambda: int(dl_width / ratio)),  # download_addr['height'] is wrong
                 'preference': -2 if video_info.get('has_watermark') else -1,
             }))
         if video_info.get('play_addr_h264'):
@@ -420,26 +422,88 @@ def _parse_aweme_video_web(self, aweme_detail, webpage_url, video_id):
         formats = []
         width = int_or_none(video_info.get('width'))
         height = int_or_none(video_info.get('height'))
+        ratio = try_call(lambda: width / height) or 0.5625
+        COMMON_FORMAT_INFO = {
+            'ext': 'mp4',
+            'vcodec': 'h264',
+            'acodec': 'aac',
+        }
+
+        for bitrate_info in traverse_obj(video_info, ('bitrateInfo', lambda _, v: v['PlayAddr']['UrlList'])):
+            format_info, res = self._parse_url_key(
+                traverse_obj(bitrate_info, ('PlayAddr', 'UrlKey', {str})) or '')
+            # bytevc2 is bytedance's own custom h266/vvc codec, as-of-yet unplayable
+            is_bytevc2 = format_info.get('vcodec') == 'bytevc2'
+            format_info.update({
+                'format_note': 'UNPLAYABLE' if is_bytevc2 else None,
+                'preference': -100 if is_bytevc2 else -1,
+                'filesize': traverse_obj(bitrate_info, ('PlayAddr', 'DataSize', {int_or_none})),
+            })
+
+            if dimension := (res and int(res[:-1])):
+                if dimension == 540:  # '540p' is actually 576p
+                    dimension = 576
+                if ratio < 1:  # portrait: res/dimension is width
+                    y = int(dimension / ratio)
+                    format_info.update({
+                        'width': dimension,
+                        'height': y - (y % 2),
+                    })
+                else:  # landscape: res/dimension is height
+                    x = int(dimension * ratio)
+                    format_info.update({
+                        'width': x - (x % 2),
+                        'height': dimension,
+                    })
+
+            for video_url in traverse_obj(bitrate_info, ('PlayAddr', 'UrlList', ..., {url_or_none})):
+                formats.append({
+                    **COMMON_FORMAT_INFO,
+                    **format_info,
+                    'url': self._proto_relative_url(video_url),
+                })
+
+        # We don't have res string for play formats, but need quality for sorting & de-duplication
+        play_quality = traverse_obj(formats, (lambda _, v: v['width'] == width, 'quality', any))
 
         for play_url in traverse_obj(video_info, ('playAddr', ((..., 'src'), None), {url_or_none})):
             formats.append({
+                **COMMON_FORMAT_INFO,
+                'format_id': 'play',
                 'url': self._proto_relative_url(play_url),
-                'ext': 'mp4',
                 'width': width,
                 'height': height,
+                'quality': play_quality,
             })
 
         for download_url in traverse_obj(video_info, (('downloadAddr', ('download', 'url')), {url_or_none})):
             formats.append({
+                **COMMON_FORMAT_INFO,
                 'format_id': 'download',
                 'url': self._proto_relative_url(download_url),
-                'ext': 'mp4',
-                'width': width,
-                'height': height,
             })
 
         self._remove_duplicate_formats(formats)
 
+        for f in traverse_obj(formats, lambda _, v: 'unwatermarked' not in v['url']):
+            f.update({
+                'format_note': join_nonempty(f.get('format_note'), 'watermarked', delim=', '),
+                'preference': f.get('preference') or -2,
+            })
+
+        # Is it a slideshow with only audio for download?
+        if not formats and traverse_obj(music_info, ('playUrl', {url_or_none})):
+            audio_url = music_info['playUrl']
+            ext = traverse_obj(parse_qs(audio_url), (
+                'mime_type', -1, {lambda x: x.replace('_', '/')}, {mimetype2ext})) or 'm4a'
+            formats.append({
+                'format_id': 'audio',
+                'url': self._proto_relative_url(audio_url),
+                'ext': ext,
+                'acodec': 'aac' if ext == 'm4a' else ext,
+                'vcodec': 'none',
+            })
+
         thumbnails = []
         for thumb_url in traverse_obj(aweme_detail, (
                 (None, 'video'), ('thumbnail', 'cover', 'dynamicCover', 'originCover'), {url_or_none})):
@@ -451,10 +515,17 @@ def _parse_aweme_video_web(self, aweme_detail, webpage_url, video_id):
 
         return {
             'id': video_id,
+            **traverse_obj(music_info, {
+                'track': ('title', {str}),
+                'album': ('album', {str}, {lambda x: x or None}),
+                'artists': ('authorName', {str}, {lambda x: [x] if x else None}),
+                'duration': ('duration', {int_or_none}),
+            }),
             **traverse_obj(aweme_detail, {
                 'title': ('desc', {str}),
                 'description': ('desc', {str}),
-                'duration': ('video', 'duration', {int_or_none}),
+                # audio-only slideshows have a video duration of 0 and an actual audio duration
+                'duration': ('video', 'duration', {int_or_none}, {lambda x: x or None}),
                 'timestamp': ('createTime', {int_or_none}),
             }),
             **traverse_obj(author_info or aweme_detail, {
@@ -469,11 +540,6 @@ def _parse_aweme_video_web(self, aweme_detail, webpage_url, video_id):
                 'repost_count': 'shareCount',
                 'comment_count': 'commentCount',
             }, expected_type=int_or_none),
-            **traverse_obj(music_info, {
-                'track': ('title', {str}),
-                'album': ('album', {str}, {lambda x: x or None}),
-                'artists': ('authorName', {str}, {lambda x: [x] if x else None}),
-            }),
             'channel_id': channel_id,
             'uploader_url': user_url,
             'formats': formats,


Test patch: