Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
VEVO KeyError: 'streams' #11719
VEVO KeyError: 'streams' #11719
Comments
|
@dstftw I can watch the file normally using a DNS service via a browser. Had the geo-restricted issue before and it was resolved. Hopefully a fix can be determined, thanks! |
|
I got the same problem with some clips. When I view this video online it plays normaly. My log is:
|
|
Any luck as of yet? |
|
Here's an updated log from a video I just tried to pull (new error message this time, just updated): youtube-dl -v http://www.vevo.com/watch/martin-solveig/Rejection/FRUV70500038 |
|
Those videos are unavailable with US proxies. Vevo said:
Where are those videos available? |
|
Strange..
But I can see it in the Browser. Tested with another video: Seems to work fine. I think the issue is that the video is somewhat old, and therefore the metadata extraction doesn't work like the newer ones? Edits: Yeah, it's failing here:
|
|
@yan12125 in the Netherlands. |
|
Thanks. Public Netherlands proxies are too slow for proper debugging... @Hrxn are you in Netherlands, too? |
|
Germany... |
|
Sorry, @Hrxn, I didn't notice your Github profile. I managed to create a fix from Netherlands/Germany proxies. Here's my patch: diff --git a/youtube_dl/extractor/vevo.py b/youtube_dl/extractor/vevo.py
index c4e37f694..6fe7fccf5 100644
--- a/youtube_dl/extractor/vevo.py
+++ b/youtube_dl/extractor/vevo.py
@@ -17,12 +17,12 @@ from ..utils import (
class VevoBaseIE(InfoExtractor):
- def _extract_json(self, webpage, video_id, item):
+ def _extract_json(self, webpage, video_id):
return self._parse_json(
self._search_regex(
r'window\.__INITIAL_STORE__\s*=\s*({.+?});\s*</script>',
webpage, 'initial store'),
- video_id)['default'][item]
+ video_id)
class VevoIE(VevoBaseIE):
@@ -193,7 +193,14 @@ class VevoIE(VevoBaseIE):
# https://github.com/rg3/youtube-dl/issues/9366)
if not video_versions:
webpage = self._download_webpage(url, video_id)
- video_versions = self._extract_json(webpage, video_id, 'streams')[video_id][0]
+ json_data = self._extract_json(webpage, video_id)
+ if 'streams' in json_data.get('default', {}):
+ video_versions = json_data['default']['streams'][video_id][0]
+ else:
+ video_versions = [
+ value
+ for key, value in json_data['apollo']['data'].items()
+ if key.startswith('%s.streams' % video_id)]
uploader = None
artist = None
@@ -207,7 +214,7 @@ class VevoIE(VevoBaseIE):
formats = []
for video_version in video_versions:
- version = self._VERSIONS.get(video_version['version'])
+ version = self._VERSIONS.get(video_version.get('version'), 'generic')
version_url = video_version.get('url')
if not version_url:
continue
@@ -339,7 +346,7 @@ class VevoPlaylistIE(VevoBaseIE):
if video_id:
return self.url_result('vevo:%s' % video_id, VevoIE.ie_key())
- playlists = self._extract_json(webpage, playlist_id, '%ss' % playlist_kind)
+ playlists = self._extract_json(webpage, playlist_id)['default']['%ss' % playlist_kind]
playlist = (list(playlists.values())[0]
if playlist_kind == 'playlist' else playlists[playlist_id])However, I can't commit it as I didn't really test it in Python. The proxy I use involves HTTP digest authentication, and Python is broken with that. |
|
it does work with this patch.
|
|
Thanks @remitamine. I've pushed my patch to master without a proper _TEST. |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2017.01.14. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
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
-vflag 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 ```):If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):
Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
Description of your issue, suggested solution and other information
This error is coming up on certain files Was working previously. Any help is appreciated, thank you!