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

[redbull.com] Not working Failed to parse JSON #28770

Closed
5 tasks done
someziggyman opened this issue Apr 16, 2021 · 1 comment
Closed
5 tasks done

[redbull.com] Not working Failed to parse JSON #28770

someziggyman opened this issue Apr 16, 2021 · 1 comment

Comments

@someziggyman
Copy link

someziggyman commented Apr 16, 2021

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2021.04.07
  • 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 issues including closed ones

Verbose log

youtube-dl -v -F https://www.redbull.com/gb-en/films/kriss-kyle-out-of-season
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.redbull.com/gb-en/films/kriss-kyle-out-of-season']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.04.07
[debug] Python version 2.7.16 (CPython) - Darwin-20.3.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[RedBull] kriss-kyle-out-of-season: Downloading JSON metadata
[RedBullEmbed] rrn:content:films:6d72aae4-d724-40ff-b627-912a2be1fb7d:en-GB: Downloading JSON metadata
ERROR: rrn:content:films:6d72aae4-d724-40ff-b627-912a2be1fb7d:en-GB: Failed to parse JSON  (caused by ValueError('No JSON object could be decoded',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 906, in _parse_json
    return json.loads(json_string)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 827, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/redbulltv.py", line 143, in _real_extract
    }''' % (rrn_id, self._VIDEO_ESSENSE_TMPL % 'LiveVideo', self._VIDEO_ESSENSE_TMPL % 'VideoResource'),
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 899, in _download_json
    expected_status=expected_status)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 883, in _download_json_handle
    fatal=fatal), urlh
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 910, in _parse_json
    raise ExtractorError(errmsg, cause=ve)
ExtractorError: rrn:content:films:6d72aae4-d724-40ff-b627-912a2be1fb7d:en-GB: Failed to parse JSON  (caused by ValueError('No JSON object could be decoded',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

Test link:
https://www.redbull.com/gb-en/films/kriss-kyle-out-of-season

@rbasoalto
Copy link

I'm having the same issue with 2021.05.16. The request to https://edge-graphql.crepo-production.redbullaws.com/v1/graphql gets HTML as response. I fired mitmproxy to snoop at the requests, and the request headers include Accept: text/html, ... where it should be Accept: application/json. With a mitmproxy script I forced the Accept header to application/json and it works perfectly.

For reference, the mitmproxy script is

def request(flow):
    flow.request.headers['accept'] = 'application/json'

which then is loaded with mitmproxy -s script.py, and then ytdl can pick up the proxy + cert with SSL_CERT_FILE=~/.mitmproxy/mitmproxy-ca-cert.pem youtube-dl --proxy http://localhost:8080 https://www.redbull.com/int-en/live/...

I'm not familiar enough with python or the ytdl codebase, but I hope some other dev can pick this one up. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants