projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
dfad3aa
)
[rutv] Fix preference
author
Sergey M․
<dstftw@gmail.com>
Mon, 4 May 2015 15:29:32 +0000
(21:29 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Mon, 4 May 2015 15:29:32 +0000
(21:29 +0600)
youtube_dl/extractor/rutv.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/rutv.py
b/youtube_dl/extractor/rutv.py
index 6b56b1d492226c0c2c06222cce517a8295ed2f01..a5e98415f340dedb7c1e7bc621c7a455bbdefb53 100644
(file)
--- a/
youtube_dl/extractor/rutv.py
+++ b/
youtube_dl/extractor/rutv.py
@@
-128,8
+128,10
@@
class RUTVIE(InfoExtractor):
elif video_path.startswith('index/iframe/cast_id'):
video_type = 'live'
elif video_path.startswith('index/iframe/cast_id'):
video_type = 'live'
+ is_live = video_type == 'live'
+
json_data = self._download_json(
json_data = self._download_json(
- 'http://player.rutv.ru/iframe/%splay/id/%s' % ('live-' if
video_type == 'live'
else '', video_id),
+ 'http://player.rutv.ru/iframe/%splay/id/%s' % ('live-' if
is_live
else '', video_id),
video_id, 'Downloading JSON')
if json_data['errors']:
video_id, 'Downloading JSON')
if json_data['errors']:
@@
-156,6
+158,7
@@
class RUTVIE(InfoExtractor):
for transport, links in media['sources'].items():
for quality, url in links.items():
for transport, links in media['sources'].items():
for quality, url in links.items():
+ preference = -1 if priority_transport == transport else -2
if transport == 'rtmp':
mobj = re.search(r'^(?P<url>rtmp://[^/]+/(?P<app>.+))/(?P<playpath>.+)$', url)
if not mobj:
if transport == 'rtmp':
mobj = re.search(r'^(?P<url>rtmp://[^/]+/(?P<app>.+))/(?P<playpath>.+)$', url)
if not mobj:
@@
-169,9
+172,11
@@
class RUTVIE(InfoExtractor):
'rtmp_live': True,
'ext': 'flv',
'vbr': int(quality),
'rtmp_live': True,
'ext': 'flv',
'vbr': int(quality),
+ 'preference': preference,
}
elif transport == 'm3u8':
}
elif transport == 'm3u8':
- formats.extend(self._extract_m3u8_formats(url, video_id, 'mp4'))
+ formats.extend(self._extract_m3u8_formats(
+ url, video_id, 'mp4', preference=preference, m3u8_id='hls'))
continue
else:
fmt = {
continue
else:
fmt = {
@@
-181,7
+186,6
@@
class RUTVIE(InfoExtractor):
'width': width,
'height': height,
'format_id': '%s-%s' % (transport, quality),
'width': width,
'height': height,
'format_id': '%s-%s' % (transport, quality),
- 'preference': -1 if priority_transport == transport else -2,
})
formats.append(fmt)
})
formats.append(fmt)
@@
-190,8
+194,6
@@
class RUTVIE(InfoExtractor):
self._sort_formats(formats)
self._sort_formats(formats)
- is_live = video_type == 'live'
-
return {
'id': video_id,
'title': self._live_title(title) if is_live else title,
return {
'id': video_id,
'title': self._live_title(title) if is_live else title,