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

Tik Tok failed to parse JSON in US #2135

Closed
7 tasks done
darktrend opened this issue Dec 27, 2021 · 5 comments · Fixed by #2161
Closed
7 tasks done

Tik Tok failed to parse JSON in US #2135

darktrend opened this issue Dec 27, 2021 · 5 comments · Fixed by #2161
Labels
site-bug Issue with a specific website

Comments

@darktrend
Copy link

Checklist

Region

USA

Description

Tiktok having issues, in the US, using VPN or not it throws the same error.

Verbose log

yt-dlp --verbose https://www.tiktok.com/@therock
[debug] Command-line config: ['--verbose', 'https://www.tiktok.com/@therock']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2021.12.27 [6223f67] (win_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19042-SP0
[debug] exe versions: ffmpeg 4.2.3
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [tiktok:user] Extracting URL: https://www.tiktok.com/@therock
[tiktok:user] therock: Downloading webpage
[download] Downloading playlist: therock
[tiktok:user] therock: Downloading user video list page 1
WARNING: [tiktok:user] Expecting value: line 1 column 1 (char 0). Retrying...
[tiktok:user] therock: Downloading user video list page 1 (attempt 1)
WARNING: [tiktok:user] Expecting value: line 1 column 1 (char 0). Retrying...
[tiktok:user] therock: Downloading user video list page 1 (attempt 2)
WARNING: [tiktok:user] Expecting value: line 1 column 1 (char 0). Retrying...
[tiktok:user] therock: Downloading user video list page 1 (attempt 3)
ERROR: therock: Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; type  yt-dlp -U  to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "yt_dlp\extractor\common.py", line 990, in _parse_json
  File "json\__init__.py", line 357, in loads
  File "json\decoder.py", line 337, in decode
  File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "yt_dlp\extractor\common.py", line 990, in _parse_json
  File "json\__init__.py", line 357, in loads
  File "json\decoder.py", line 337, in decode
  File "json\decoder.py", line 355, in raw_decode
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 "yt_dlp\YoutubeDL.py", line 1353, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1640, in <lambda>
  File "yt_dlp\utils.py", line 2620, in __getitem__
  File "yt_dlp\extractor\tiktok.py", line 438, in _entries_api
  File "yt_dlp\extractor\tiktok.py", line 75, in _call_api
  File "yt_dlp\extractor\common.py", line 979, in _download_json
  File "yt_dlp\extractor\common.py", line 965, in _download_json_handle
  File "yt_dlp\extractor\common.py", line 994, in _parse_json
yt_dlp.utils.ExtractorError: therock: Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; type  yt-dlp -U  to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
@darktrend darktrend added site-bug Issue with a specific website triage Untriaged issue labels Dec 27, 2021
@rajatvermaiam
Copy link

i think tiktok changed the way they give response of aweme API.

@aidenmitchell
Copy link

Same issue in Canada.

@pukkandan pukkandan removed the triage Untriaged issue label Dec 28, 2021
@matthewladams
Copy link

I'm not sure if the API changes just happen to correlate with it, but the fallback to the webpage failing seems to be due to a change in framework that's being rolled out from NextJS to Sigi. I haven't got this working fully yet but seems to work for individual videos matthewladams@c494f57

@jb2170
Copy link

jb2170 commented Dec 28, 2021

Same in the UK

pukkandan pushed a commit that referenced this issue Dec 29, 2021
Closes #2133, #2135
Authored by: MinePlayersPE, llacb47
@pukkandan
Copy link
Member

@MinePlayersPE @llacb47 While this is fixed via the API, it might be best to look into how to fix this also in the webpage extraction. According to ytdl-org/youtube-dl#30251, the website has been experimenting with Sigi for a while now

Ashish0804 added a commit to Ashish0804/yt-dlp that referenced this issue Jan 1, 2022
commit 8efffaf
Author: MinePlayersPE <mineplayerspealt@gmail.com>
Date:   Sat Jan 1 13:12:33 2022 +0700

    [XVideos] Check HLS formats (yt-dlp#2193)

    Closes yt-dlp#1823
    Authored by; MinePlayersPE

commit 26f2aa3
Author: Ashish Gupta <39122144+Ashish0804@users.noreply.github.com>
Date:   Sat Jan 1 02:32:23 2022 +0530

    [hotstar] Add extractor args to ignore tags (yt-dlp#2116)

    Authored by: Ashish0804

commit 3464a27
Author: pgaig <87302379+pgaig@users.noreply.github.com>
Date:   Fri Dec 31 21:58:23 2021 +0100

    [VrtNU] Handle empty title (yt-dlp#2147)

    Closes yt-dlp#2146
    Authored by: pgaig

commit 497d77e
Author: Ashish Gupta <Ashish08@protonmail.com>
Date:   Fri Dec 31 10:41:42 2021 +0530

    [KelbyOne] Add extractor (yt-dlp#2181)

    Closes yt-dlp#2170
    Authored by: Ashish0804

commit 9040e2d
Author: LE <llacb47@users.noreply.github.com>
Date:   Fri Dec 31 15:11:35 2021 -0500

    [mixcloud] Detect restrictions (yt-dlp#2169)

    Authored by; llacb47

commit 6134fbe
Author: MinePlayersPE <mineplayerspealt@gmail.com>
Date:   Sat Jan 1 03:10:46 2022 +0700

    [TikTok] Pass cookies to formats (yt-dlp#2171)

    Closes yt-dlp#2166
    Authored by: MinePlayersPE

commit cfcf60e
Author: MinePlayersPE <mineplayerspealt@gmail.com>
Date:   Sat Jan 1 03:09:30 2022 +0700

    [BiliIntl] Add login (yt-dlp#2172)

    and misc improvements

    Authored by: MinePlayersPE

commit 4afa3ec
Author: Felix S <felix.von.s@posteo.de>
Date:   Fri Dec 31 20:06:45 2021 +0000

    [extractor] Detect more subtitle codecs in MPD manifests (yt-dlp#2174)

    Authored by: fstirlitz

commit 11aa91a
Author: MinePlayersPE <mineplayerspealt@gmail.com>
Date:   Thu Dec 30 11:20:17 2021 +0700

    [TikTok] Fix extraction for sigi-based webpages (yt-dlp#2164)

    Fixes: yt-dlp#2133
    Authored by: MinePlayersPE

commit abbeeeb
Author: pukkandan <pukkandan.ytdlp@gmail.com>
Date:   Thu Dec 30 08:43:40 2021 +0530

    [outtmpl] Alternate form for `D` and fix suffix's case

    Fixes: yt-dlp#2085 (comment), https://github.com/yt-dlp/yt-dlp/pull/2132/files#r775729811

commit 2c539d4
Author: pukkandan <pukkandan.ytdlp@gmail.com>
Date:   Thu Dec 30 08:15:48 2021 +0530

    [cookies] Fix bug when keyring is unspecified

    Closes yt-dlp#2167

commit 042931a
Author: pukkandan <pukkandan.ytdlp@gmail.com>
Date:   Thu Dec 30 08:15:07 2021 +0530

    Allow escaped `,` in `--extractor-args`

    Closes yt-dlp#2152

commit 96f13f0
Author: MinePlayersPE <mineplayerspealt@gmail.com>
Date:   Thu Dec 30 05:00:44 2021 +0700

    [TikTok] Change app version (yt-dlp#2161)

    Closes yt-dlp#2133, yt-dlp#2135
    Authored by: MinePlayersPE, llacb47

commit 4b93532
Author: u-spec-png <54671367+u-spec-png@users.noreply.github.com>
Date:   Tue Dec 28 20:42:14 2021 +0000

    [Drooble] Add extractor (yt-dlp#1547)

    Closes yt-dlp#1527
    Authored by: u-spec-png

commit dd5e60b
Author: u-spec-png <54671367+u-spec-png@users.noreply.github.com>
Date:   Tue Dec 28 18:58:06 2021 +0000

    [Instagram] Add story/highlight extractor (yt-dlp#2006)

    Fixes ytdl-org/youtube-dl#25575
    Authored by: u-spec-png

commit e540c56
Author: MinePlayersPE <mineplayerspealt@gmail.com>
Date:   Tue Dec 28 09:38:23 2021 +0700

    [TikTok] Fallback to feed API endpoint (yt-dlp#2142)

    Authored by: MinePlayersPE
    Workaround for yt-dlp#2133

commit 45d86ab
Author: pukkandan <pukkandan.ytdlp@gmail.com>
Date:   Tue Dec 28 04:21:13 2021 +0530

    Allow unicode characters in `info.json`

    Closes yt-dlp#2139

commit f02d24d
Author: Pierre Mdawar <pierre@mdawar.dev>
Date:   Tue Dec 28 03:38:31 2021 +0530

    [utils] Fix `format_bytes` output for Bytes (yt-dlp#2132)

    Authored by: pukkandan, mdawar

commit ceb9832
Author: pukkandan <pukkandan.ytdlp@gmail.com>
Date:   Tue Dec 28 02:52:11 2021 +0530

    Don't treat empty containers as `None` in `sanitize_info`

commit 7537e35
Author: pukkandan <pukkandan.ytdlp@gmail.com>
Date:   Tue Dec 28 02:49:02 2021 +0530

    [gfycat] Fix `uploader`
@rsamay rsamay mentioned this issue Feb 6, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants