aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/m6.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-06-30 13:50:49 +0100
committerRemita Amine <remitamine@gmail.com>2016-06-30 13:50:49 +0100
commit93ad6c6bfaae8f1ce87a832ece92fa099f0e2095 (patch)
tree3d89311a65999d98d3a2224d0b393f267ee1b5ca /youtube_dl/extractor/m6.py
parent329179073b93e37ab76e759d1fe96d8f984367f3 (diff)
[sixplay] Add new extractor(closes #2183)
Diffstat (limited to 'youtube_dl/extractor/m6.py')
-rw-r--r--youtube_dl/extractor/m6.py35
1 files changed, 2 insertions, 33 deletions
diff --git a/youtube_dl/extractor/m6.py b/youtube_dl/extractor/m6.py
index d5945ad66..39d2742c8 100644
--- a/youtube_dl/extractor/m6.py
+++ b/youtube_dl/extractor/m6.py
@@ -1,8 +1,6 @@
# encoding: utf-8
from __future__ import unicode_literals
-import re
-
from .common import InfoExtractor
@@ -23,34 +21,5 @@ class M6IE(InfoExtractor):
}
def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
-
- rss = self._download_xml('http://ws.m6.fr/v1/video/info/m6/bonus/%s' % video_id, video_id,
- 'Downloading video RSS')
-
- title = rss.find('./channel/item/title').text
- description = rss.find('./channel/item/description').text
- thumbnail = rss.find('./channel/item/visuel_clip_big').text
- duration = int(rss.find('./channel/item/duration').text)
- view_count = int(rss.find('./channel/item/nombre_vues').text)
-
- formats = []
- for format_id in ['lq', 'sd', 'hq', 'hd']:
- video_url = rss.find('./channel/item/url_video_%s' % format_id)
- if video_url is None:
- continue
- formats.append({
- 'url': video_url.text,
- 'format_id': format_id,
- })
-
- return {
- 'id': video_id,
- 'title': title,
- 'description': description,
- 'thumbnail': thumbnail,
- 'duration': duration,
- 'view_count': view_count,
- 'formats': formats,
- }
+ video_id = self._match_id(url)
+ return self.url_result('6play:%s' % video_id, 'SixPlay', video_id)