aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2019-04-16 13:04:13 +0100
committerRemita Amine <remitamine@gmail.com>2019-04-16 13:04:13 +0100
commite6c9ae31df1196dc12607b83be01141eb52b80b6 (patch)
tree4174eefd7e0ae1e64de61e9ddd417de7b54f5bd5 /youtube_dl
parentcb6cd76f7bc4c964e148d3a592db256547a79bae (diff)
[adn] fix subtitle extraction(#12724)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/adn.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/youtube_dl/extractor/adn.py b/youtube_dl/extractor/adn.py
index 1e04a55a6..923c351e4 100644
--- a/youtube_dl/extractor/adn.py
+++ b/youtube_dl/extractor/adn.py
@@ -60,14 +60,19 @@ class ADNIE(InfoExtractor):
enc_subtitles = self._download_webpage(
urljoin(self._BASE_URL, sub_path),
- video_id, 'Downloading subtitles data', fatal=False)
+ video_id, 'Downloading subtitles location', fatal=False) or '{}'
+ subtitle_location = (self._parse_json(enc_subtitles, video_id, fatal=False) or {}).get('location')
+ if subtitle_location:
+ enc_subtitles = self._download_webpage(
+ urljoin(self._BASE_URL, subtitle_location),
+ video_id, 'Downloading subtitles data', fatal=False)
if not enc_subtitles:
return None
# http://animedigitalnetwork.fr/components/com_vodvideo/videojs/adn-vjs.min.js
dec_subtitles = intlist_to_bytes(aes_cbc_decrypt(
bytes_to_intlist(compat_b64decode(enc_subtitles[24:])),
- bytes_to_intlist(binascii.unhexlify(self._K + '083db5aebd9353b4')),
+ bytes_to_intlist(binascii.unhexlify(self._K + '4421de0a5f0814ba')),
bytes_to_intlist(compat_b64decode(enc_subtitles[:24]))
))
subtitles_json = self._parse_json(