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

crashes on SBS URLs #5725

Closed
pabs3 opened this issue May 16, 2015 · 1 comment
Closed

crashes on SBS URLs #5725

pabs3 opened this issue May 16, 2015 · 1 comment

Comments

@pabs3
Copy link

@pabs3 pabs3 commented May 16, 2015

SBS started including the plus operator (+) in their JSON to concatenate strings, which makes it invalid JSON, which makes youtube-dl crash. I found that adding this line to the SBS extractor fixes that crash:

release_urls_json = release_urls_json.replace('"+ "', '').replace('" +"','')
$ youtube-dl --verbose http://www.sbs.com.au/ondemand/video/351437891659/Apocalypto
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.sbs.com.au/ondemand/video/351437891659/Apocalypto']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.02.28
[debug] Python version 2.7.9 - Linux-4.0.0-1-amd64-x86_64-with-debian-stretch-sid
[debug] exe versions: avconv 11.3-6, avprobe 11.3-6, rtmpdump 2.4
[debug] Proxy map: {}
[SBS] 351437891659: Downloading webpage
{
    "progressive": "",
    "html": "http://link.theplatform.com/s/Bgtm9B/bdlbKcELrGUX?feed=Video%20-%20Single&mbr=true&manifest=m3u&ord=2358717&policy=22428&d1=video.film.sbs.com.au&d2=sec30htmlweb&d3=preroll&dm1=video.film.sbs.com.au&dm2=sec30midrollhtmlweb&dm3=midroll",
    "standard": "http://link.theplatform.com/s/Bgtm9B/bdlbKcELrGUX?feed=Video%20-%20Single&manifest=f4m&mbr=true&ord=9866337&policy=11929623&dfptag=sz%3D530x298%26iu%3D%2F4117%2Fvideo.film.sbs.com.au%2Fsec30%26ciu_szs%26impl%3Ds%26gdfp_req%3D1%26env%3Dvp%26output%3Dxml_vast3%26unviewed_position_start%3D1%26url%3Dwww.sbs.com.au%26description_url%3DSBS%26cust_params%3Dtype%253Dpreroll%26ad_rule%3D1%26cmsid%3D531%26url%3Dhttp%253A%252F%252Fwww.sbs.com.au%252Fondemand%252Fvideo%252F351437891659%252FApocalypto%26description_url%3DSBS%26correlator%3D"+ "ord" +"%26vid%3D351437891659"
}
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 9, in <module>
    load_entry_point('youtube-dl==2015.02.28', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 397, in main
    _real_main(argv)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 387, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1442, in download
    res = self.extract_info(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 643, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 275, in extract
    return self._real_extract(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/sbs.py", line 45, in _real_extract
    release_urls = json.loads(release_urls_json)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting ',' delimiter: line 4 column 552 (char 826)
@dstftw dstftw closed this in ef2dcbe May 16, 2015
@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 16, 2015

Will be fixed in the next version. Thanks for the report.

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.