aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/dailymotion.py
diff options
context:
space:
mode:
authorIsmael Mejia <iemejia@gmail.com>2013-08-08 08:54:10 +0200
committerIsmael Mejia <iemejia@gmail.com>2013-08-08 08:54:10 +0200
commit8377574c9cb8740e24d45e9b3d30921fd6ec846c (patch)
tree3cbe6f014c1322ae85f17daa919de7e86ba3d307 /youtube_dl/extractor/dailymotion.py
parent372297e713c92489c113bf8649ec4aa1d23511f9 (diff)
[internal] Improved subtitle architecture + (update in
youtube/dailymotion) The structure of subtitles was refined, you only need to implement one method that returns a dictionnary of the available subtitles (lang, url) to support all the subtitle options in a website. I updated the subtitle downloaders for youtube/dailymotion to show how it works.
Diffstat (limited to 'youtube_dl/extractor/dailymotion.py')
-rw-r--r--youtube_dl/extractor/dailymotion.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py
index eb2322d54..97003ee35 100644
--- a/youtube_dl/extractor/dailymotion.py
+++ b/youtube_dl/extractor/dailymotion.py
@@ -1,6 +1,5 @@
import re
import json
-import itertools
import socket
from .common import InfoExtractor
@@ -34,16 +33,12 @@ class DailyMotionSubtitlesIE(SubtitlesIE):
self._downloader.report_warning(u'video doesn\'t have subtitles')
return {}
- def _get_subtitle_url(self, sub_lang, sub_name, video_id, format):
- sub_lang_list = self._get_available_subtitles(video_id)
- return sub_lang_list[sub_lang]
-
def _request_automatic_caption(self, video_id, webpage):
- self._downloader.report_warning(u'Automatic Captions not supported by dailymotion')
+ self._downloader.report_warning(u'Automatic Captions not supported by this server')
return {}
-class DailymotionIE(DailyMotionSubtitlesIE): #,InfoExtractor):
+class DailymotionIE(DailyMotionSubtitlesIE):
"""Information Extractor for Dailymotion"""
_VALID_URL = r'(?i)(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/video/([^/]+)'
@@ -116,12 +111,6 @@ class DailymotionIE(DailyMotionSubtitlesIE): #,InfoExtractor):
self._list_available_subtitles(video_id)
return
- if 'length_seconds' not in info:
- self._downloader.report_warning(u'unable to extract video duration')
- video_duration = ''
- else:
- video_duration = compat_urllib_parse.unquote_plus(video_info['length_seconds'][0])
-
return [{
'id': video_id,
'url': video_url,