aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2014-09-05 22:26:31 +0700
committerSergey M․ <dstftw@gmail.com>2014-09-05 22:26:31 +0700
commit70a1ecd2c1c602164b89512a3646ff4119349018 (patch)
treee8f2889ea11531f515d5e262e72655040ca35ecc /youtube_dl/extractor
parent88a23aef5a7d64ab4f4d682d6b336ac9eea2efba (diff)
parentaf8812bb9b50586dd228c624b1bc569639070254 (diff)
Merge branch 'unistra_hd' of https://github.com/Rudloff/youtube-dl into Rudloff-unistra_hd
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/unistra.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/youtube_dl/extractor/unistra.py b/youtube_dl/extractor/unistra.py
index 474610eec..bd5a258a5 100644
--- a/youtube_dl/extractor/unistra.py
+++ b/youtube_dl/extractor/unistra.py
@@ -16,17 +16,29 @@ class UnistraIE(InfoExtractor):
}
def _real_extract(self, url):
- id = re.match(self._VALID_URL, url).group(1)
- webpage = self._download_webpage(url, id)
- file = re.search(r'file: "(.*?)",', webpage).group(1)
+ video_id = re.match(self._VALID_URL, url).group(1)
+ webpage = self._download_webpage(url, video_id)
+ width = re.search(r'width: "(\d*?)",', webpage).group(1)
+ height = re.search(r'height: "(\d*?)",', webpage).group(1)
+ files = re.findall(r'file: "(.*?)"', webpage)
+ video_url = 'http://vod-flash.u-strasbg.fr:8080'
+ formats = [{
+ 'format_id': 'SD',
+ 'url': video_url + files[0],
+ 'ext': 'mp4',
+ 'resolution': width + 'x' + height
+ }]
+ if files[1] != files[0]:
+ formats.append({
+ 'format_id': 'HD',
+ 'url': video_url + files[1],
+ 'ext': 'mp4'
+ })
title = self._html_search_regex(r'<title>UTV - (.*?)</', webpage, u'title')
- video_url = 'http://vod-flash.u-strasbg.fr:8080/' + file
-
- return {'id': id,
+ return {'id': video_id,
'title': title,
- 'ext': 'mp4',
- 'url': video_url,
'description': self._html_search_regex(r'<meta name="Description" content="(.*?)"', webpage, u'description', flags=re.DOTALL),
'thumbnail': self._search_regex(r'image: "(.*?)"', webpage, u'thumbnail'),
+ 'formats': formats
}