aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-12-19 00:38:39 +0700
committerSergey M․ <dstftw@gmail.com>2017-12-19 00:38:39 +0700
commit4a109f81bc39ed09931fd6f9d21d20f7abdc9742 (patch)
treeaa96d8f2bf89bdadbd314b555840c638dac77708 /youtube_dl
parent99081da90c9b8ce4ee7fe9452787507fed4251a0 (diff)
[afreecatv] Improve format extraction (closes #15019)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/afreecatv.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dl/extractor/afreecatv.py
index e6513c7a4..513dd81df 100644
--- a/youtube_dl/extractor/afreecatv.py
+++ b/youtube_dl/extractor/afreecatv.py
@@ -228,10 +228,19 @@ class AfreecaTVIE(InfoExtractor):
r'^(\d{8})_', key, 'upload date', default=None)
file_duration = int_or_none(file_element.get('duration'))
format_id = key if key else '%s_%s' % (video_id, file_num)
- formats = self._extract_m3u8_formats(
- file_url, video_id, 'mp4', entry_protocol='m3u8_native',
- m3u8_id='hls',
- note='Downloading part %d m3u8 information' % file_num)
+ if determine_ext(file_url) == 'm3u8':
+ formats = self._extract_m3u8_formats(
+ file_url, video_id, 'mp4', entry_protocol='m3u8_native',
+ m3u8_id='hls',
+ note='Downloading part %d m3u8 information' % file_num)
+ else:
+ formats = [{
+ 'url': file_url,
+ 'format_id': 'http',
+ }]
+ if not formats:
+ continue
+ self._sort_formats(formats)
file_info = common_entry.copy()
file_info.update({
'id': format_id,