aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2017-02-04 18:18:03 +0100
committerRemita Amine <remitamine@gmail.com>2017-02-04 18:18:28 +0100
commit3d2c2752c5cd70fc7f9cebe8c4683a1de626017d (patch)
treeeedc77538e78bc5c94a05b9d063fede271125afc /youtube_dl
parenta713a86755ba864a7b765fd2ce9a5ac8a8f4cc63 (diff)
[afreecatv] extract rtmp formats
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/afreecatv.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dl/extractor/afreecatv.py
index 4f6cdb8a2..e0a0f7c57 100644
--- a/youtube_dl/extractor/afreecatv.py
+++ b/youtube_dl/extractor/afreecatv.py
@@ -221,10 +221,23 @@ class AfreecaTVGlobalIE(AfreecaTVIE):
s_url = s.get('purl')
if not s_url:
continue
- # TODO: extract rtmp formats
- if s.get('stype') == 'HLS':
+ stype = s.get('stype')
+ if stype == 'HLS':
formats.extend(self._extract_m3u8_formats(
- s_url, channel_id, 'mp4', fatal=False))
+ s_url, channel_id, 'mp4', m3u8_id=stype, fatal=False))
+ elif stype == 'RTMP':
+ format_id = [stype]
+ label = s.get('label')
+ if label:
+ format_id.append(label)
+ formats.append({
+ 'format_id': '-'.join(format_id),
+ 'url': s_url,
+ 'tbr': int_or_none(s.get('bps')),
+ 'height': int_or_none(s.get('brt')),
+ 'ext': 'flv',
+ 'rtmp_live': True,
+ })
self._sort_formats(formats)
info.update({