Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TikTok] Failed to parse JSON - Can't download videos without watermark #9441

Closed
10 of 11 tasks
Neurotoxin001 opened this issue Mar 14, 2024 · 16 comments · Fixed by #9444
Closed
10 of 11 tasks

[TikTok] Failed to parse JSON - Can't download videos without watermark #9441

Neurotoxin001 opened this issue Mar 14, 2024 · 16 comments · Fixed by #9444
Labels
site-bug Issue with a specific website

Comments

@Neurotoxin001
Copy link

Neurotoxin001 commented Mar 14, 2024

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

Netherlands

Provide a description that is worded well enough to be understood

Yesterday videos without watermarks were downloading fine, but today videos are only downloading with watermarks. I see that there were issues here about "Failed to parse JSON", but they are all locked and I can't reply in them.

Provide verbose output that clearly demonstrates the problem

  • 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

[debug] Command-line config: ['https://www.tiktok.com/@elias_filmz/video/7344534749551070506', '-vU']
[debug] Encodings: locale cp1251, fs utf-8, pref cp1251, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp-nightly-builds [8463fb510] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg n6.1.1-1-g61b88b4dda-20240118 (setts), ffprobe n6.1.1-1-g61b88b4dda-20240118
[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
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp-nightly-builds)
[TikTok] Extracting URL: https://www.tiktok.com/@elias_filmz/video/7344534749551070506
[TikTok] 7344534749551070506: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 1 of 4)
[TikTok] 7344534749551070506: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 2 of 4)
[TikTok] 7344534749551070506: Downloading video feed
WARNING: [TikTok] Expecting value in '': line 1 column 1 (char 0). Retrying... (attempt 3 of 4)
[TikTok] 7344534749551070506: Downloading video feed
WARNING: [TikTok] 7344534749551070506: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); trying with webpage
[TikTok] 7344534749551070506: 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] 7344534749551070506: Downloading 1 format(s): download
[debug] Invoking http downloader on "https://v16-webapp-prime.tiktok.com/video/tos/maliva/tos-maliva-ve-0068c799-us/osDtSSfFIBS7HQEH6fRBEHnD5cmYQgX8gRAQFl/?a=1988&ch=0&cr=3&dr=0&lr=tiktok_m&cd=0%7C0%7C1%7C&cv=1&br=1958&bt=979&bti=ODszNWYuMDE6&cs=0&ds=3&ft=-Csk_mIRPD12NTGunf-Ux412SYKW3wv25NcAp&mime_type=video_mp4&qs=0&rc=aWhlNmdoZDM5ZTU2OGY5M0BpM2VoaW05cjRqcTMzZzczNEA1YS4tNWMuXy0xMTYvLS0tYSNqZmRoMmRjYmpgLS1kMS9zcw%3D%3D&btag=e00090000&expire=1710420583&l=20240314064834E1772D870274A3041055&ply_type=2&policy=2&signature=d63e05bc6e4a2807447d63823426f55f&tk=tt_chain_token"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: Trying to eat breakfast with Bruce! #cow #brucethecow #food #snack #first #animals #foodreview  [7344534749551070506].mp4
[download] 100% of    8.15MiB in 00:00:01 at 4.90MiB/s
@Neurotoxin001 Neurotoxin001 added site-bug Issue with a specific website triage Untriaged issue labels Mar 14, 2024
@bashonly
Copy link
Member

I see that there were issues here about "Failed to parse JSON", but they are all locked and I can't reply in them.

This is a legit new issue, though with a familiar error message.

Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)"))

In the past, this problem has manifested due to either the _APP_VERSIONS being out-of-date, the _API_HOSTNAME needing to be changed/updated, or the endpoint we use adding extra param/header requirements. I've tried some alternatives to our current _APP_VERSIONS and _API_HOSTNAME without any success. Any help is welcome.

@bashonly bashonly added help-wanted Extra attention is needed and removed triage Untriaged issue labels Mar 14, 2024
@bashonly bashonly changed the title Can't download TikTok videos without watermark [TikTok] Failed to parse JSON - Can't download videos without watermark Mar 14, 2024
@Okashichan
Copy link

Okashichan commented Mar 14, 2024

@bashonly Definitely a problem with _API_HOSTNAME. It's just down/broken at the moment.
If "useast1a" in the API link represents a region, it might even be due to the latest news about the USA wanting to ban Tiktok if they would not sell it to them.

@ThePiousDragon
Copy link

As a temporary workaround -f 0 downloads videos without watermark.

@AbdallhMAbd
Copy link

AbdallhMAbd commented Mar 14, 2024

Hi
Replace old _API_HOSTNAME with api22-normal-c-useast2a.tiktokv.com

@Okashichan
Copy link

Hi Replace old _API_HOSTNAME with api22-normal-c-useast2a.tiktokv.com

Seems to work fine from my end. Thanks for the suggestion!

@bashonly bashonly removed the help-wanted Extra attention is needed label Mar 14, 2024
@bashonly
Copy link
Member

@AbdallhMAbd Thanks!

Until this is fixed in master/nightly/stable,

--extractor-args "tiktok:api_hostname=api22-normal-c-useast2a.tiktokv.com"

can be passed to yt-dlp as a workaround

@nodata168

This comment was marked as duplicate.

bashonly added a commit to bashonly/yt-dlp that referenced this issue Mar 14, 2024
Closes yt-dlp#9441
Authored by: bashonly
@GSMelford
Copy link

Hi Replace old _API_HOSTNAME with api22-normal-c-useast2a.tiktokv.com

Hello! And how did you find a working domain?

@cguess
Copy link

cguess commented Mar 14, 2024

@ThePiousDragon Thanks for this, it does indeed fix the problem.

@theChampionOne
Copy link

As a temporary workaround -f 0 downloads videos without watermark.

works perfectly) Where did u find information about this keys?

@ThePiousDragon
Copy link

works perfectly) Where did u find information about this keys?

Using -F gives you a list with all the available formats for your link. The format called 0 is the only alternative to the default download when the API is unavailable, so I just assumed it's without watermark.

@yuyoiuyoiu
Copy link

--extractor-args "tiktok:api_hostname=api22-normal-c-useast2a.tiktokv.com" is not working

@Rizwan-Basheer
Copy link

yes now it's not working --extractor-args "tiktok:api_hostname=api22-normal-c-useast2a.tiktokv.com"

@nodata168
Copy link

hello sire, what is wrong with yt-dlp went download video from tiktok, How to fix?
photo_2024-03-21_06-41-23

@Neurotoxin001
Copy link
Author

Can you reopen this issue? It's broken again

@bashonly
Copy link
Member

@yt-dlp yt-dlp locked as resolved and limited conversation to collaborators Mar 21, 2024
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this issue Apr 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging a pull request may close this issue.