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

[Bloomberg] Broken site. #10630

Closed
adambuchbinder opened this issue Sep 12, 2016 · 3 comments
Closed

[Bloomberg] Broken site. #10630

adambuchbinder opened this issue Sep 12, 2016 · 3 comments
Labels
bug

Comments

@adambuchbinder
Copy link

@adambuchbinder adambuchbinder commented Sep 12, 2016

  • I've verified and I assure that I'm running youtube-dl 2016.09.11.1

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -v https://www.bloomberg.com/gadfly/articles/2016-09-01/tesla-what-big-oil-has-to-fear
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'https://www.bloomberg.com/gadfly/articles/2016-09-01/tesla-what-big-oil-has-to-fear']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2016.09.11.1
[debug] Python version 2.7.6 - Linux-4.2.0-42-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 9.18-6, avprobe 9.18-6, rtmpdump 2.4
[debug] Proxy map: {}
[Bloomberg] tesla-what-big-oil-has-to-fear: Downloading webpage
ERROR: tesla-what-big-oil-has-to-fear: Failed to parse JSON  (caused by ValueError('Expecting property name enclosed in double quotes: line 2 column 11 (char 12)',)); 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 "/home/abuchbinder/Downloads/youtube-dl/youtube_dl/extractor/common.py", line 549, in _parse_json
    return json.loads(json_string)
  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 property name enclosed in double quotes: line 2 column 11 (char 12)
Traceback (most recent call last):
  File "/home/abuchbinder/Downloads/youtube-dl/youtube_dl/YoutubeDL.py", line 691, in extract_info
    ie_result = ie.extract(url)
  File "/home/abuchbinder/Downloads/youtube-dl/youtube_dl/extractor/common.py", line 347, in extract
    return self._real_extract(url)
  File "/home/abuchbinder/Downloads/youtube-dl/youtube_dl/extractor/bloomberg.py", line 52, in _real_extract
    r'BPlayer\(null,\s*({[^;]+})\);', webpage, 'id'), name)
  File "/home/abuchbinder/Downloads/youtube-dl/youtube_dl/extractor/common.py", line 553, in _parse_json
    raise ExtractorError(errmsg, cause=ve)
ExtractorError: tesla-what-big-oil-has-to-fear: Failed to parse JSON  (caused by ValueError('Expecting property name enclosed in double quotes: line 2 column 11 (char 12)',)); 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 of your issue, suggested solution and other information

It looks like the problem is that json.loads only accepts double-quotes, but the source from Bloomberg looks like this:

...
        BPlayer(null, {
          'id': '303188263',
          'idType': 'AVMM',
          'htmlChildId': 'player-303188263',
          'autoplay': true,
...

Adding a .replace("'", '"') to the string would probably work, but I don't know what the local style is here. I'll see if I can figure out how to propose a patch.

@adambuchbinder
Copy link
Author

@adambuchbinder adambuchbinder commented Sep 12, 2016

I should have put this all in the same pull request; see #10631.

@adambuchbinder
Copy link
Author

@adambuchbinder adambuchbinder commented Sep 12, 2016

Or maybe the pull request is separate from the issue tracker; they just use the same numbers. I am bad at github. Sorry about that; please close this if necessary.

@yan12125 yan12125 added the bug label Sep 14, 2016
@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jan 4, 2020

works fine now with the latest version.

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