- def _real_extract(self, url):
- video_id = self._match_id(url)
- webpage = self._download_webpage(
- 'http://docs.google.com/file/d/' + video_id, video_id, encoding='unicode_escape'
- )
- try:
- title = self._html_search_regex(
- r'"title"\s+,\s+"[^"]+',
- webpage,
- 'title'
- )
- fmt_stream_map = self._html_search_regex(
- r'"fmt_stream_map"\s+,\s+"[^"]+',
- webpage,
- 'fmt_stream_map'
- )
- fmt_list = self._html_search_regex(
- r'"fmt_list"\s+,\s+"[^"]+',
- webpage,
- 'fmt_list'
- )
-# timestamp = self._html_search_regex(
-# r'"timestamp"\s+,\s+"[^"]+',
-# webpage,
-# 'timestamp'
-# )
- length_seconds = self._html_search_regex(
- r'"length_seconds"\s+,\s+"[^"]+',
- webpage,
- 'length_seconds'
- )
- except RegexNotFoundError:
- try:
- reason = self._html_search_regex(
- r'"reason","[^"]+',
- webpage,
- 'reason'
- )
- self.report_warning(reason)
- return
- except RegexNotFoundError:
- self.report_warning('not a video')
- return
+ title = self._search_regex(r'"title"\s*,\s*"([^"]+)', webpage, 'title')
+ duration = int_or_none(self._search_regex(
+ r'"length_seconds"\s*,\s*"([^"]+)', webpage, 'length seconds', default=None))
+ fmt_stream_map = self._search_regex(
+ r'"fmt_stream_map"\s*,\s*"([^"]+)', webpage, 'fmt stream map').split(',')
+ fmt_list = self._search_regex(r'"fmt_list"\s*,\s*"([^"]+)', webpage, 'fmt_list').split(',')