1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-13 22:27:23 +08:00

[StreamMe]: flake8 checked

This commit is contained in:
sh!zeeg 2016-12-25 04:40:44 +03:00
parent 4666796c6c
commit 45a80c1b16

View File

@ -10,6 +10,7 @@ from ..utils import (
ExtractorError,
)
class StreamMeIE(InfoExtractor):
IE_NAME = 'StreamMe:video'
_API_CHANNEL = 'https://www.stream.me/api-user/v1/<channel_id>/channel'
@ -35,7 +36,6 @@ class StreamMeIE(InfoExtractor):
video_id = self._match_id(url)
apiurl = self._API_ARCHIVE.replace('<channel_id>', m.group('channel_id'))
# webpage = self._download_webpage(url, video_id)
data = json.loads(self._download_webpage(apiurl, video_id))
for vod in data.get('_embedded').get('vod'):
@ -50,7 +50,6 @@ class StreamMeIE(InfoExtractor):
.get('href'), video_id)
formats = self._extract_formats(manifest_json.get('formats'))
self._sort_formats(formats, 'vbr')
info = self._extract_info(vod_info)
info['formats'] = formats
@ -79,7 +78,8 @@ class StreamMeIE(InfoExtractor):
formats = []
for fmt_tag, d in fmts.items():
# skip websocket and mjpeg we can't handle them anyway
if fmt_tag in ('mjpeg-lodef', 'mp4-ws',): continue
if fmt_tag in ('mjpeg-lodef', 'mp4-ws',):
continue
for fmt_info in d.get('encodings'):
formats.append({
'url': fmt_info.get('location'),
@ -96,6 +96,7 @@ class StreamMeIE(InfoExtractor):
})
return formats
class StreamMeLiveIE(StreamMeIE):
IE_NAME = 'StreamIE:live'
_VALID_URL = r'%s/(?P<id>[^\#]+$)' % StreamMeIE._VALID_URL_BASE
@ -118,13 +119,14 @@ class StreamMeLiveIE(StreamMeIE):
.get('_links')
.get('manifest')
.get('href'), channel_id)
formats = self._extract_formats(manifest_json.get('formats'))
formats = self._extract_formats(manifest_json.get('formats'))
self._sort_formats(formats, 'vbr')
info = self._extract_info(stream_info)
info['formats'] = formats
return info
class StreamMeArchiveIE(StreamMeIE):
IE_NAME = 'StreamMe:archives'
_VALID_URL = r'%s/(?P<id>[^\#]+(?P<tag>\#archives)$)' % StreamMeIE._VALID_URL_BASE
@ -137,6 +139,9 @@ class StreamMeArchiveIE(StreamMeIE):
'title': 'KombatCup',
},
'playlist_mincount': 25,
'params': {
'skip_download': True,
}
}
def _real_extract(self, url):