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

Python: Failed to parse JSON - Expecting value: char 0 #26907

Closed
HelpMeGame opened this issue Oct 17, 2020 · 0 comments
Closed

Python: Failed to parse JSON - Expecting value: char 0 #26907

HelpMeGame opened this issue Oct 17, 2020 · 0 comments
Labels

Comments

@HelpMeGame
Copy link

@HelpMeGame HelpMeGame commented Oct 17, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.09.20
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[debug] Encodings: locale cp1252, fs utf-8, out UTF-8, pref cp1252
[debug] youtube-dl version 2020.09.20
[debug] Python version 3.7.8 (CPython) - Windows-10-10.0.19041-SP0
[youtube:search] query "iron man 3 song": Downloading page 1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: query "iron man 3 song": Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

The bug seems to only happen every so often, or very often all at once, so I don't have a good way to replicate it. Some songs will work at one point in time, then they won't a couple minutes later.
The videos that fail seemingly have no correlation to one another.
I get the issues when attempting to extract the data from the video. Here is a snippet of the code I am using:

ydlOps = {
    'format': 'bestaudio/best',
    'outtmpl': './%(title)s.webm',
    'noplaylist': True,
    'extractaudio': True,
    'audioformat': 'webm',
    'default_search': 'ytsearch1',
    'quite': True,
    'verbose':True,
    'version': True
}
        with youtube_dl.YoutubeDL(ydlOps) as downloader:
            songData = downloader.extract_info(url, download=download)
@dstftw dstftw closed this Oct 17, 2020
@dstftw dstftw added the duplicate label Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.