Browse Source

[daisuki] Add subtitles (#4738)

master-ytdl-org
Yen Chi Hsuan 8 years ago
parent
commit
7c4aa6fd6f
No known key found for this signature in database GPG Key ID: 7F902A182457CA23
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      youtube_dl/extractor/daisuki.py

+ 15
- 0
youtube_dl/extractor/daisuki.py View File

@ -34,6 +34,11 @@ class DaisukiIE(InfoExtractor):
'id': '11213', 'id': '11213',
'ext': 'mp4', 'ext': 'mp4',
'title': '#01 Who is in the pumpkin carriage? - THE IDOLM@STER CINDERELLA GIRLS', 'title': '#01 Who is in the pumpkin carriage? - THE IDOLM@STER CINDERELLA GIRLS',
'subtitles': {
'mul': [{
'ext': 'ttml',
}],
},
'creator': 'BANDAI NAMCO Entertainment', 'creator': 'BANDAI NAMCO Entertainment',
}, },
'params': { 'params': {
@ -101,10 +106,20 @@ class DaisukiIE(InfoExtractor):
creator = self._html_search_regex( creator = self._html_search_regex(
r'Creator\s*:\s*([^<]+)', webpage, 'creator', fatal=False) r'Creator\s*:\s*([^<]+)', webpage, 'creator', fatal=False)
subtitles = {}
caption_url = rtn.get('caption_url')
if caption_url:
# mul: multiple languages
subtitles['mul'] = [{
'url': caption_url,
'ext': 'ttml',
}]
return { return {
'id': video_id, 'id': video_id,
'title': title, 'title': title,
'formats': formats, 'formats': formats,
'subtitles': subtitles,
'creator': creator, 'creator': creator,
} }


Loading…
Cancel
Save