Skip to content

Commit

Permalink
[afreecatv] Improve format extraction (closes #15019)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey M․ committed Dec 18, 2017
1 parent 99081da commit 4a109f8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions youtube_dl/extractor/afreecatv.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,19 @@ def _real_extract(self, url):
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,
Expand Down

0 comments on commit 4a109f8

Please sign in to comment.