Browse Source

[udemy] Extract outputs renditions (closes #16289, closes #16291, closes #16320, closes #16321, closes #16334, closes #16335)

master-ytdl-org
Sergey M․ 7 years ago
parent
commit
8513963468
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      youtube_dl/extractor/udemy.py

+ 10
- 0
youtube_dl/extractor/udemy.py View File

@ -58,6 +58,10 @@ class UdemyIE(InfoExtractor):
# no url in outputs format entry # no url in outputs format entry
'url': 'https://www.udemy.com/learn-web-development-complete-step-by-step-guide-to-success/learn/v4/t/lecture/4125812', 'url': 'https://www.udemy.com/learn-web-development-complete-step-by-step-guide-to-success/learn/v4/t/lecture/4125812',
'only_matching': True, 'only_matching': True,
}, {
# only outputs rendition
'url': 'https://www.udemy.com/how-you-can-help-your-local-community-5-amazing-examples/learn/v4/t/lecture/3225750?start=0',
'only_matching': True,
}] }]
def _extract_course_info(self, webpage, video_id): def _extract_course_info(self, webpage, video_id):
@ -357,6 +361,12 @@ class UdemyIE(InfoExtractor):
fatal=False) fatal=False)
extract_subtitles(text_tracks) extract_subtitles(text_tracks)
if not formats and outputs:
for format_id, output in outputs.items():
f = extract_output_format(output, format_id)
if f.get('url'):
formats.append(f)
self._sort_formats(formats, field_preference=('height', 'width', 'tbr', 'format_id')) self._sort_formats(formats, field_preference=('height', 'width', 'tbr', 'format_id'))
return { return {


Loading…
Cancel
Save