projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b0c65c6
)
[jwplatform] Improve subtitles extraction
author
Sergey M․
<dstftw@gmail.com>
Sat, 17 Dec 2016 11:45:44 +0000
(18:45 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 17 Dec 2016 11:50:00 +0000
(18:50 +0700)
youtube_dl/extractor/jwplatform.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/jwplatform.py
b/youtube_dl/extractor/jwplatform.py
index 5d56e0a28bd55b93153a92446834ba440ad59572..7037763cba308ae9b3090d5d882ebd7e82171148 100644
(file)
--- a/
youtube_dl/extractor/jwplatform.py
+++ b/
youtube_dl/extractor/jwplatform.py
@@
-11,6
+11,7
@@
from ..utils import (
int_or_none,
js_to_json,
mimetype2ext,
int_or_none,
js_to_json,
mimetype2ext,
+ urljoin,
)
)
@@
-110,10
+111,14
@@
class JWPlatformBaseIE(InfoExtractor):
tracks = video_data.get('tracks')
if tracks and isinstance(tracks, list):
for track in tracks:
tracks = video_data.get('tracks')
if tracks and isinstance(tracks, list):
for track in tracks:
- if track.get('file') and track.get('kind') == 'captions':
- subtitles.setdefault(track.get('label') or 'en', []).append({
- 'url': self._proto_relative_url(track['file'])
- })
+ if track.get('kind') != 'captions':
+ continue
+ track_url = urljoin(base_url, track.get('file'))
+ if not track_url:
+ continue
+ subtitles.setdefault(track.get('label') or 'en', []).append({
+ 'url': self._proto_relative_url(track_url)
+ })
entries.append({
'id': this_video_id,
entries.append({
'id': this_video_id,