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

NHL: Failed to parse JSON #7447

Closed
RingoTheDog opened this issue Nov 10, 2015 · 3 comments
Closed

NHL: Failed to parse JSON #7447

RingoTheDog opened this issue Nov 10, 2015 · 3 comments
Labels
bug

Comments

@RingoTheDog
Copy link

@RingoTheDog RingoTheDog commented Nov 10, 2015

Save video....

This URL does work:
http://video.canucks.nhl.com/videocenter/console?id=869769&catid=6

This URL does NOT work:
http://video.canucks.nhl.com/videocenter/console?catid=804&id=443912&lang=en&_ga=1.4300209.385542312.1447105087

youtube-dl.py -v "http://video.canucks.nhl.com/videocenter/console?catid=804&id=443912&lang=en&_ga=1.4300209.385542312.1447105087"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://video.canucks.nhl.com/videocenter/console?catid=804&id=443912&lang=en&ga=1.4300209.385542312.1447105087']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2015.11.10
[debug] Python version 2.7.5 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71727-g46778ab, rtmpdump 2.4
[debug] Proxy map: {}
[nhl.com] 443912: Downloading JSON metadata
ERROR: 443912: 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 late
outube-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 "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\common.py", line 483, in parse_json
return json.loads(json_string)
File "C:\Python27\lib\json__init
.py", line 338, in loads
return _default_decoder.decode(s)
File "C:\Python27\lib\json\decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python27\lib\json\decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\YoutubeDL.py", line 661, in extract_info
ie_result = ie.extract(url)
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\common.py", line 290, in extract
return self._real_extract(url)
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\nhl.py", line 146, in _real_extract
return self._real_extract_video(video_id)
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\nhl.py", line 29, in _real_extract_video
json_url, video_id, transform_source=self._fix_json)
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\common.py", line 477, in _download_json
json_string, video_id, transform_source=transform_source, fatal=fatal)
File "C:\Transmogrifier\youtube-dl.py\youtube_dl\extractor\common.py", line 487, in _parse_json
raise ExtractorError(errmsg, cause=ve)
ExtractorError: 443912: 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
; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Amazing as always...thanks
Ringo

@yan12125 yan12125 added the bug label Nov 14, 2015
@mickmister
Copy link

@mickmister mickmister commented Nov 24, 2015

The problem seems to be that the URL used to extract json metadata for the second video returns no json data, which causes an error when parsing the data.

The json URL for the video that downloads successfully is here:
http://video.nhl.com/videocenter/servlets/playlist?ids=869769&format=json

The json URL for the video that does not download successfully is here:
http://video.nhl.com/videocenter/servlets/playlist?ids=443912&format=json

So the problem may be on the NHL server's side. It may be the case that some videos have a different URL structure for retrieving json header data, or the NHL site maintainers failed to supply the json metadata for that specific video.

Ringo - Can you supply one or more URLs that you are experiencing this same error, or is this the only one you have encountered? I have tried several random URLs and very few of them have this same problem.

@RingoTheDog
Copy link
Author

@RingoTheDog RingoTheDog commented Nov 25, 2015

I believe this is the only example... well over 99% of the NHL URLs we have processed work perfectly.
I just posted this as I thought it might be an exception; However if you think there is just a bug with the json missing on the NHL site for this one specific clip/link then let's close the issue.

If we come across another example (which seems unlikely) then we can revisit it then.

Thanks very much for looking into this
Ringo

@mickmister
Copy link

@mickmister mickmister commented Sep 10, 2018

I think this should be closed

@remitamine remitamine closed this Sep 10, 2018
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
4 participants
You can’t perform that action at this time.