Browse Source

[openload] Support subtitles (closes #10625)

totalwebcasting
Yen Chi Hsuan 8 years ago
parent
commit
0711995bca
No known key found for this signature in database GPG Key ID: 3FDDD575826C5C30
2 changed files with 26 additions and 1 deletions
  1. +3
    -0
      ChangeLog
  2. +23
    -1
      youtube_dl/extractor/openload.py

+ 3
- 0
ChangeLog View File

@ -3,6 +3,9 @@ vesion <unreleased>
Core Core
+ Improved support for HTML5 subtitles + Improved support for HTML5 subtitles
Extractors
+ [openload] Support subtitles (#10625)
version 2016.09.24 version 2016.09.24


+ 23
- 1
youtube_dl/extractor/openload.py View File

@ -24,6 +24,22 @@ class OpenloadIE(InfoExtractor):
'title': 'skyrim_no-audio_1080.mp4', 'title': 'skyrim_no-audio_1080.mp4',
'thumbnail': 're:^https?://.*\.jpg$', 'thumbnail': 're:^https?://.*\.jpg$',
}, },
}, {
'url': 'https://openload.co/embed/rjC09fkPLYs',
'info_dict': {
'id': 'rjC09fkPLYs',
'ext': 'mp4',
'title': 'movie.mp4',
'thumbnail': 're:^https?://.*\.jpg$',
'subtitles': {
'en': [{
'ext': 'vtt',
}],
},
},
'params': {
'skip_download': True, # test subtitles only
},
}, { }, {
'url': 'https://openload.co/embed/kUEfGclsU9o/skyrim_no-audio_1080.mp4', 'url': 'https://openload.co/embed/kUEfGclsU9o/skyrim_no-audio_1080.mp4',
'only_matching': True, 'only_matching': True,
@ -71,11 +87,17 @@ class OpenloadIE(InfoExtractor):
'title', default=None) or self._html_search_meta( 'title', default=None) or self._html_search_meta(
'description', webpage, 'title', fatal=True) 'description', webpage, 'title', fatal=True)
return {
entries = self._parse_html5_media_entries(url, webpage, video_id)
subtitles = entries[0]['subtitles'] if entries else None
info_dict = {
'id': video_id, 'id': video_id,
'title': title, 'title': title,
'thumbnail': self._og_search_thumbnail(webpage, default=None), 'thumbnail': self._og_search_thumbnail(webpage, default=None),
'url': video_url, 'url': video_url,
# Seems all videos have extensions in their titles # Seems all videos have extensions in their titles
'ext': determine_ext(title), 'ext': determine_ext(title),
'subtitles': subtitles,
} }
return info_dict

Loading…
Cancel
Save