- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
- info_url = "https://dotsub.com/api/media/%s/metadata" % video_id
- info = self._download_json(info_url, video_id)
- date = time.gmtime(info['dateCreated'] / 1000) # The timestamp is in miliseconds
-
- return {
- 'id': video_id,
- 'url': info['mediaURI'],
- 'ext': 'flv',
+ video_id = self._match_id(url)
+
+ info = self._download_json(
+ 'https://dotsub.com/api/media/%s/metadata' % video_id, video_id)
+ video_url = info.get('mediaURI')
+
+ if not video_url:
+ webpage = self._download_webpage(url, video_id)
+ video_url = self._search_regex(
+ [r'<source[^>]+src="([^"]+)"', r'"file"\s*:\s*\'([^\']+)'],
+ webpage, 'video url', default=None)
+ info_dict = {
+ 'id': video_id,
+ 'url': video_url,
+ 'ext': 'flv',
+ }
+
+ if not video_url:
+ setup_data = self._parse_json(self._html_search_regex(
+ r'(?s)data-setup=([\'"])(?P<content>(?!\1).+?)\1',
+ webpage, 'setup data', group='content'), video_id)
+ info_dict = {
+ '_type': 'url_transparent',
+ 'url': setup_data['src'],
+ }
+
+ info_dict.update({