aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/myvideo.py
diff options
context:
space:
mode:
authorIsmael Mejia <iemejia@gmail.com>2013-08-22 23:29:36 +0200
committerIsmael Mejia <iemejia@gmail.com>2013-08-22 23:29:36 +0200
commit18b4e04f1c663e0ea695f6501b860f85af9d7ca1 (patch)
treed60ebbf51b8c50f808c6c251fc6c02547052a9dc /youtube_dl/extractor/myvideo.py
parentd80a064eff4fe2416f9db36b07f1e2ca641f1334 (diff)
parent1865ed31b955795f9859df5c1c400d172ae9a28a (diff)
Merge branch 'master' into subtitles_rework
Diffstat (limited to 'youtube_dl/extractor/myvideo.py')
-rw-r--r--youtube_dl/extractor/myvideo.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/youtube_dl/extractor/myvideo.py b/youtube_dl/extractor/myvideo.py
index b2a7b1df0..0404e6e43 100644
--- a/youtube_dl/extractor/myvideo.py
+++ b/youtube_dl/extractor/myvideo.py
@@ -2,11 +2,13 @@ import binascii
import base64
import hashlib
import re
+import json
from .common import InfoExtractor
from ..utils import (
compat_ord,
compat_urllib_parse,
+ compat_urllib_request,
ExtractorError,
)
@@ -16,7 +18,7 @@ from ..utils import (
class MyVideoIE(InfoExtractor):
"""Information Extractor for myvideo.de."""
- _VALID_URL = r'(?:http://)?(?:www\.)?myvideo\.de/watch/([0-9]+)/([^?/]+).*'
+ _VALID_URL = r'(?:http://)?(?:www\.)?myvideo\.de/(?:[^/]+/)?watch/([0-9]+)/([^?/]+).*'
IE_NAME = u'myvideo'
_TEST = {
u'url': u'http://www.myvideo.de/watch/8229274/bowling_fail_or_win',
@@ -85,6 +87,20 @@ class MyVideoIE(InfoExtractor):
'ext': video_ext,
}]
+ mobj = re.search(r'data-video-service="/service/data/video/%s/config' % video_id, webpage)
+ if mobj is not None:
+ request = compat_urllib_request.Request('http://www.myvideo.de/service/data/video/%s/config' % video_id, '')
+ response = self._download_webpage(request, video_id,
+ u'Downloading video info')
+ info = json.loads(base64.b64decode(response).decode('utf-8'))
+ return {'id': video_id,
+ 'title': info['title'],
+ 'url': info['streaming_url'].replace('rtmpe', 'rtmpt'),
+ 'play_path': info['filename'],
+ 'ext': 'flv',
+ 'thumbnail': info['thumbnail'][0]['url'],
+ }
+
# try encxml
mobj = re.search('var flashvars={(.+?)}', webpage)
if mobj is None: