Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADN] impossible to extract subtitles #12724

Open
Ririx02 opened this issue Apr 12, 2017 · 91 comments
Open

[ADN] impossible to extract subtitles #12724

Ririx02 opened this issue Apr 12, 2017 · 91 comments

Comments

@Ririx02
Copy link

@Ririx02 Ririx02 commented Apr 12, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.04.11. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.04.11

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

youtube-dl --all-subs -v http://animedigitalnetwork.fr/video/boruto-naruto-next-generations/7937-episode-2-le-fils-du-hokage
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--all-subs', '-v', 'http://animedigitalnetwork.fr/video/boruto-naruto-next-generations/7937-episode-2-le-fils-du-hokage']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2017.04.11
[debug] Python version 3.4.4 - Windows-10-10.0.14393
[debug] exe versions: ffmpeg N-80912-gce466d0, ffprobe N-80912-gce466d0, rtmpdump 2.3
[debug] Proxy map: {}
[ADN] 7937: Downloading webpage
[ADN] 7937: Downloading JSON metadata
[ADN] 7937: Downloading m3u8 information
[ADN] 7937: Downloading JSON metadata
[ADN] 7937: Downloading m3u8 information
[ADN] 7937: Downloading webpage
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\__init__.py", line 464, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\__init__.py", line 454, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\YoutubeDL.py", line 1890, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\YoutubeDL.py", line 761, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\extractor\common.py", line 429, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\extractor\adn.py", line 133, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\extractor\common.py", line 2390, in extract_subtitles
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\extractor\adn.py", line 53, in _get_subtitles
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpsqdjcx2e\build\youtube_dl\extractor\common.py", line 672, in _parse_json
  File "C:\Python\Python34\lib\json\__init__.py", line 312, in loads
TypeError: the JSON object must be str, not 'bytes'

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):


Description of your issue, suggested solution and other information

impossible to extract subtitles.

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 17, 2017

the problem in the issue can be fixed simply by decoding the decrypted subtitle, however the real problem is that they change the decryption key frequently, so this won't be fixed untill there is a js interpreter that can handle the key construction js code.

@leonekmi
Copy link

@leonekmi leonekmi commented Apr 28, 2017

Can you (@remitamine) explain how to get the encr. key, i see that you regulary change the key in the extractor ?
Me and JS, huh....

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 29, 2017

the key can be found in http://animedigitalnetwork.fr/components/com_vodvideo/videojs/adn-vjs.min.js.
for example at this time this is the code to construct the key:

function(){var a=function(){var a,b=[a=114874,a+=-1521,a+=-19814,a+=-75638,a+=45570,a+=46993,a+=-66124,a+=28122];b[3]=[b[4],b[4]=b[3]][0],b[5]=[b[2],b[2]=b[5]][0],b[2]=44262*b[2]%(2<<16),b[2]=6159*b[2]%(2<<16),b[5]=b[6]^b[2],b[3]=[b[0],b[0]=b[3]][0],b[0]=b[7]^b[0],b[5]=4906*b[5]%(2<<16),b[5]=b[7]^b[0],acopifakofuwil(b.map(function(a){return("0000"+a.toString(16)).substr(-4)}).join(""))};a(),a=null}()

what i did is copying what is inside the a function and replacing the name of the function written before b.map which in this case acopifakofuwil with console.log than execute the code in browser console.
the executed code whould be:

var a, b = [a = 114874, a += -1521, a += -19814, a += -75638, a += 45570, a += 46993, a += -66124, a += 28122];
        b[3] = [b[4], b[4] = b[3]][0], b[5] = [b[2], b[2] = b[5]][0], b[2] = 44262 * b[2] % (2 << 16), b[2] = 6159 * b[2] % (2 << 16), b[5] = b[6] ^ b[2], b[3] = [b[0], b[0] = b[3]][0], b[0] = b[7] ^ b[0], b[5] = 4906 * b[5] % (2 << 16), b[5] = b[7] ^ b[0], console.log(b.map(function(a) {
            return ("0000" + a.toString(16)).substr(-4)
        }).join(""))

the result is: ece1bac92300c0ba45edf7efad341b0e
then prefix every two characters with \x and replace the key in the extractor.

diff --git a/youtube_dl/extractor/adn.py b/youtube_dl/extractor/adn.py
index 66caf6a81..50cfdcdee 100644
--- a/youtube_dl/extractor/adn.py
+++ b/youtube_dl/extractor/adn.py
@@ -45,7 +45,7 @@ class ADNIE(InfoExtractor):
         # http://animedigitalnetwork.fr/components/com_vodvideo/videojs/adn-vjs.min.js
         dec_subtitles = intlist_to_bytes(aes_cbc_decrypt(
             bytes_to_intlist(base64.b64decode(enc_subtitles[24:])),
-            bytes_to_intlist(b'\nd\xaf\xd2J\xd0\xfc\xe1\xfc\xdf\xb61\xe8\xe1\xf0\xcc'),
+            bytes_to_intlist(b'\xec\xe1\xba\xc9\x23\x00\xc0\xba\x45\xed\xf7\xef\xad\x34\x1b\x0e'),
             bytes_to_intlist(base64.b64decode(enc_subtitles[:24]))
         ))
         subtitles_json = self._parse_json(
@leonekmi
Copy link

@leonekmi leonekmi commented Apr 29, 2017

This is not possible to automatically execute this (via external server for example) ?

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 29, 2017

This is not possible to automatically execute this (via external server for example) ?

as i said before:

so this won't be fixed untill there is a js interpreter that can handle the key construction js code.

it's possible with a js interpreter.

@Ririx02
Copy link
Author

@Ririx02 Ririx02 commented Apr 30, 2017

I do not really have any knowledge in js interpreter but maybe there is something that would be appropriate? :
Https://github.com/amol-/dukpy
Https://github.com/NeilFraser/JS-Interpreter

@remitamine
Copy link
Collaborator

@remitamine remitamine commented May 11, 2017

Https://github.com/amol-/dukpy

dukpy is currently not production ready and might actually crash your program as it is mostly implemented in C.

Https://github.com/NeilFraser/JS-Interpreter

javascript project we are using python in this project.

the decryption code has been changed again(they apply more obfuscation, but it still simple to deobfuscate), the change that also need to apply in the code is changing the user agent(they banned the user agent used by youtube-dl).

diff --git a/youtube_dl/extractor/adn.py b/youtube_dl/extractor/adn.py
index 66caf6a81..09e46cc34 100644
--- a/youtube_dl/extractor/adn.py
+++ b/youtube_dl/extractor/adn.py
@@ -38,14 +38,16 @@ class ADNIE(InfoExtractor):
 
         enc_subtitles = self._download_webpage(
             'http://animedigitalnetwork.fr/' + sub_path,
-            video_id, fatal=False)
+            video_id, headers={
+                'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0'
+            }, 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(base64.b64decode(enc_subtitles[24:])),
-            bytes_to_intlist(b'\nd\xaf\xd2J\xd0\xfc\xe1\xfc\xdf\xb61\xe8\xe1\xf0\xcc'),
+            bytes_to_intlist(b'\xba\x11\x86\x24\x55\xa6\x40\xf8\x50\xb8\xb0\xe7\x46\x4d\x90\x13'),
             bytes_to_intlist(base64.b64decode(enc_subtitles[:24]))
         ))
         subtitles_json = self._parse_json(
@Ririx02
Copy link
Author

@Ririx02 Ririx02 commented May 25, 2017

Otherwise, could we create an option where we could enter the key manually?
Example: youtube-dl -key 15541681654654 .....

@leonekmi
Copy link

@leonekmi leonekmi commented May 25, 2017

Ah yeah, which can be easily got via an external serivce in JS (in a GH Page for example)
I propose --sub-decryption-key (or -subdk) for the name of the argument

@leonekmi
Copy link

@leonekmi leonekmi commented May 26, 2017

@remitamine, the new obsfucation system is strarting at which line exactly ? (after unminify)
From L21434 ?

We can also create a notice to explain how to get easily this decryption key to afterward specify in -subdk.

@leonekmi
Copy link

@leonekmi leonekmi commented May 26, 2017

Hey, update :

leonekmi@leonekmi-MS-7693:~$ youtube-dl -v --print-traffic http://animedigitalnetwork.fr/video/my-hero-academia-saison-2/7945-episode-3-quelle-belle-alterite
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--print-traffic', 'http://animedigitalnetwork.fr/video/my-hero-academia-saison-2/7945-episode-3-quelle-belle-alterite']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.05.26
[debug] Python version 3.6.1 - Linux-4.10.0-21-generic-x86_64-with-Ubuntu-17.04-zesty
[debug] exe versions: ffmpeg 3.2.4-1build2, ffprobe 3.2.4-1build2
[debug] Proxy map: {}
[ADN] 7945: Downloading webpage
send: b'GET /video/my-hero-academia-saison-2/7945-episode-3-quelle-belle-alterite HTTP/1.1\r\nHost: animedigitalnetwork.fr\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nConnection: close\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 760, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/common.py", line 433, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/adn.py", line 125, in _real_extract
    self._sort_formats(formats)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/common.py", line 1056, in _sort_formats
    raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

header: Server header: Date header: Content-Type header: Keep-Alive header: Vary header: P3P header: X-Logged-In header: Content-Encoding header: Cache-Control header: X-Varnish header: Age header: X-Cache header: X-Varnish-IP header: Content-Length header: Connection header: Accept-Ranges
@remitamine
Copy link
Collaborator

@remitamine remitamine commented May 26, 2017

@remitamine, the new obsfucation system is strarting at which line exactly ? (after unminify)
From L21434 ?

i will point directly to obfuscated part related to the decryption key.
the key splitted into two parts.
the first part is stored in _0x2002('0xf8') of this part of code(the real value is 1be0296138942400):

        '\x70\x72\x65\x70\x61\x72\x65\x53\x75\x62\x74\x69\x74\x6c\x65\x73': function(_0x4425ef) {
            var _0x21b8fa = _0x4425ef[_0x2002('0xf7')](0x0, 0x18);
            var _0x5a1269 = _0x4425ef['\x73\x75\x62\x73\x74\x72\x69\x6e\x67'](0x18);
            try {
                var _0x3597bf = _0xe329f8[_0x2002('0xc8')][_0x2002('0xa6')](_0x5a1269, _0xe329f8[_0x2002('0x6f')][_0x2002('0x70')][_0x2002('0x78')](_0x2002('0xf8') + _0x2f9bc6), {
                    '\x69\x76': _0xe329f8['\x65\x6e\x63'][_0x2002('0x8e')][_0x2002('0x78')](_0x21b8fa)
                });
                _0x3597bf = _0x3597bf[_0x2002('0x62')](_0xe329f8[_0x2002('0x6f')][_0x2002('0x76')]);
                _0x1cfa06[this[_0x2002('0xd1')]] = JSON[_0x2002('0x78')](_0x3597bf) || {};
            } catch (_0x263178) {
                this['\x74\x72\x69\x67\x67\x65\x72']('\x61\x64\x6e\x2e\x65\x72\x72\x6f\x72');
            }
            this[_0x2002('0xf9')]();
        },

the second part can be found in(the real value is 12bdc580accebeb0):

        var _0x2c722f = [_0x2c9d03 = 0x1127e, _0x2c9d03 = _0x2c9d03 + -0x9d8e, _0x2c9d03 = _0x2c9d03 + -0x4a4b, _0x2c9d03 = _0x2c9d03 + 0x12000];
        _0x2c722f[0x2] = _0x2c722f[0x1] * _0x2c722f[0x2];
        _0x2c722f[0x2] = [_0x2c722f[0x3], _0x2c722f[0x3] = _0x2c722f[0x2]][0x0];
        _0x2c722f[0x1] = _0x2c722f[0x1] * 0xc0c8 % (0x2 << 0x10);
        _0x2c722f[0x2] = _0x2c722f[0x3] * _0x2c722f[0x2];
        _0x2c722f[0x1] = _0x2c722f[0x1] * 0x79cd % (0x2 << 0x10);
        _0x2c722f[0x2] = _0x2c722f[0x0] ^ _0x2c722f[0x3];
        for (var _0x44da56 = 0x8; _0x44da56 < 0xe; _0x44da56++) {
            _0x2c722f[0x0] += _0x44da56;
        }
        _0x0bdd31(_0x2c722f[_0x2002('0x176')](function(_0x541fc3) {
            return (_0x2002('0x177') + _0x541fc3[_0x2002('0x62')](0x10))['\x73\x75\x62\x73\x74\x72'](-0x4);
        })[_0x2002('0x71')](''));

I propose --sub-decryption-key (or -subdk) for the name of the argument

options should be generic, normally we don't add options specific for one of the extractors.
if the user know how to get the encryption key, he can just edit the key directly in the source code.

@leonekmi
Copy link

@leonekmi leonekmi commented May 26, 2017

oh, we can use --video-password, it will be a little weird but if we cannot create a new argument.

@hutigh
Copy link

@hutigh hutigh commented May 27, 2017

Hi, i still get this issue any idea ? ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@remitamine
Copy link
Collaborator

@remitamine remitamine commented May 27, 2017

Hi, i still get this issue any idea ? ERROR: No video formats found;

it will be fixed in the next version.

@leonekmi
Copy link

@leonekmi leonekmi commented Jun 27, 2017

Ow...

[leonekmi@leonekmi-PC` ~]$ youtube-dl --write-sub http://animedigitalnetwork.fr/video/chunibyou_demo_koi_ga_shitai/2702-episode-1-rencontre-avec-le-jao-shingan-l-il-de-verite-du-roi-du-mal
[ADN] 2702: Downloading webpage
[ADN] 2702: Downloading JSON metadata
[ADN] 2702: Downloading JSON metadata
[ADN] 2702: Downloading m3u8 information
[ADN] 2702: Downloading JSON metadata
[ADN] 2702: Downloading m3u8 information
[ADN] 2702: Downloading webpage
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 11, in <module>
    load_entry_point('youtube-dl==2017.6.25', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python3.6/site-packages/youtube_dl/__init__.py", line 465, in main
    _real_main(argv)
  File "/usr/lib/python3.6/site-packages/youtube_dl/__init__.py", line 455, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1927, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 762, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 433, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/adn.py", line 144, in _real_extract
    'subtitles': self.extract_subtitles(player_config.get('subtitles'), video_id),
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 2467, in extract_subtitles
    return self._get_subtitles(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/adn.py", line 56, in _get_subtitles
    dec_subtitles[:-compat_ord(dec_subtitles[-1])].decode(),
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 0: invalid continuation byte
@Ririx02
Copy link
Author

@Ririx02 Ririx02 commented Jul 5, 2017

@siddht4
Copy link

@siddht4 siddht4 commented Jul 5, 2017

i feel like @testlog0 has not completly understand what the problem is? The issue here is that the site creates a new key for the subtitle similar to an issue .The site uses date,time and key to obsfuricate the code so that the user cannot understand it.Think it this was if you have a valuable file, you would do whatever possible to avoid anyone copying it.So your subtitle is protected that way.In order to break it you need to deobsfuricate the code,then it will be parsed by the necessary function and you will get your subtitle.This sometimes can be done directly and if the result are positive the code can be pushed here. @remitamine please give one more example so that i can prepare the regex function meanwhile

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jul 6, 2017

@remitamine please give one more example so that i can prepare the regex function meanwhile.

i will put the unminified code as it will be the one that is needed to be matched.
the first part is stored in _0x2342('0xf9') of this part of code:

'\x70\x72\x65\x70\x61\x72\x65\x53\x75\x62\x74\x69\x74\x6c\x65\x73':function(_0xe6cfbd){var _0x9dea74=_0xe6cfbd[_0x2342('0xf8')](0x0,0x18);var _0x4334c4=_0xe6cfbd[_0x2342('0xf8')](0x18);try{var _0x4a1554=_0xa9e524[_0x2342('0xcf')][_0x2342('0xab')](_0x4334c4,_0xa9e524['\x65\x6e\x63']['\x48\x65\x78'][_0x2342('0x7f')](_0x2342('0xf9')+_0x49e891),{'\x69\x76':_0xa9e524[_0x2342('0x75')]['\x42\x61\x73\x65\x36\x34'][_0x2342('0x7f')](_0x9dea74)});_0x4a1554=_0x4a1554['\x74\x6f\x53\x74\x72\x69\x6e\x67'](_0xa9e524[_0x2342('0x75')]['\x55\x74\x66\x38']);_0x1317c5[this['\x74\x72\x61\x63\x6b\x49\x6e\x64\x65\x78']]=JSON[_0x2342('0x7f')](_0x4a1554)||{};}catch(_0x22dfdc){this['\x74\x72\x69\x67\x67\x65\x72'](_0x2342('0xec'));}this[_0x2342('0xfa')]();}

the second part can be found in:

(function(){var _0x146fe4=function(){var _0x553262;var _0x387bcd=[_0x553262=0x10270,_0x553262=_0x553262+0xd0ba,_0x553262=_0x553262+-0x15405,_0x553262=_0x553262+0x7ad9];_0x387bcd[0x1]=_0x387bcd[0x1]*0x2751%(0x2<<0x10);_0x387bcd[0x3]=[_0x387bcd[0x2],_0x387bcd[0x2]=_0x387bcd[0x3]][0x0];for(var _0x5e4edc=0x4;_0x5e4edc<0xc;_0x5e4edc++){_0x387bcd[0x3]+=_0x5e4edc;}_0x387bcd[0x1]=[_0x387bcd[0x0],_0x387bcd[0x0]=_0x387bcd[0x1]][0x0];for(var _0x5e4edc=0x2;_0x5e4edc<0x13;_0x5e4edc++){_0x387bcd[0x2]+=_0x5e4edc;}_0x387bcd[0x1]=_0x387bcd[0x3]^_0x387bcd[0x1];_0x387bcd[0x2]=_0x387bcd[0x1]*_0x387bcd[0x2];_0x9ebf57(_0x387bcd[_0x2342('0x172')](function(_0x57d859){return(_0x2342('0x173')+_0x57d859[_0x2342('0x69')](0x10))[_0x2342('0x78')](-0x4);})[_0x2342('0x77')](''));};_0x146fe4();_0x146fe4={};}());
@siddht4
Copy link

@siddht4 siddht4 commented Jul 7, 2017

@remitamine thanks for the 2nd example,found out they use date as a get value followed by something similar to version id,
example : <script src="/components/com_vodvideo/videojs/adn-vjs.min.js?2017-07-07_1.2.2" type="text/javascript"></script>
I think they are splitting it at _(underscore) so it is
1."date":"2017-07-07" ,2. "version":"1.2.2"
differentiating both shows obvious size difference.

@siddht4
Copy link

@siddht4 siddht4 commented Jul 7, 2017

they use a minfied version then append it with the obsfuricated code,just not able to understand which part to use, @remitamine please guide as i am simply using parts of the code,part of the code is at https://gist.github.com/siddht1/ed9837e6d2af205b4ccdb25459ba20e4

@siddht4
Copy link

@siddht4 siddht4 commented Jul 7, 2017

@remitamine '\x70\x72\x65\x70\x61\x72\x65\x53\x75\x62\x74\x69\x74\x6c\x65\x73' actually means that

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jul 7, 2017

prepareSubtitles

@siddht4
Copy link

@siddht4 siddht4 commented Jul 7, 2017

@remitamine i know '\x70\x72\x65\x70\x61\x72\x65\x53\x75\x62\x74\x69\x74\x6c\x65\x73' means preparesubtitlle,'\x73\x75\x62\x73\x74\x72\x69\x6e\x67' means substring,'\x70\x61\x72\x73\x65' means parse,just searching where it gets invoked

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jul 7, 2017

loadSubtitles

@siddht4
Copy link

@siddht4 siddht4 commented Jul 7, 2017

@remitamine

loadSubtitles where is it ?

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jul 7, 2017

loadSubtitles where is it ?

https://gist.github.com/siddht1/ed9837e6d2af205b4ccdb25459ba20e4#file-adn-part-code-L1060

@siddht1 if you're looking for a better understanding of the code, i think the first thing that you have to do is to deobfuscate the code:

  • replace hex and unicode escaped strings.
  • replace the calls to the functions using the array from the first line in your gist(you need to get a number from the code and shift/rotate the array negativaly by this ammount than use index(in hexadecimal) passed to function calls to get the real string).

this will give you a clear source code that will let you understand the flow.

@siddht4
Copy link

@siddht4 siddht4 commented Jul 7, 2017

@siddht4 if you're looking for a better understanding of the code, i think the first thing that you have to do is to deobfuscate the code:

replace hex and unicode escaped strings.
replace the calls to the functions using the array from the first line in your gist(you need to get a number from the code and shift/rotate the array negativaly by this ammount than use index(in hexadecimal) passed to function calls to get the real string).

this will give you a clear source code that will let you understand the flow.

That prettly much what was i doing but you already know developer obfuscrate the code so that its next to impossible to get the code back in readable format(next to impossible,not impossible).My mozilla deobsfuricate doesnt seems to work,so had been document.write() what each part meant.Lengthy work so chit chatting with @remitamine.If @remitamine has partial deobfuscate of the code share it.I will be keeping the complete copy of the js for each day so that i can verify indeed there is a function working with the get values of date and version

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jul 7, 2017

That prettly much what was i doing but you already know developer obfuscrate the code so that its next to impossible to get the code back in readable format(next to impossible,not impossible).

it's possible to convert the code into a readable format.

If @remitamine has partial deobfuscate of the code share it.

i wrote before a script to automatically get an fresh deobfuscated version of the js code, however i can't access it now because i can't access the HDD.

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 5, 2019

Oh and by the way @remitamine, you should re-add the user pass login function in the adn.py file, it would be useful instead of generating cookies every time.

this problem is tracked at #17084.

@ghost
Copy link

@ghost ghost commented Apr 5, 2019

Oh and by the way @remitamine, you should re-add the user pass login function in the adn.py file, it would be useful instead of generating cookies every time.

this problem is tracked at #17084.

My bad, thanks for answer.

@ghost
Copy link

@ghost ghost commented Apr 5, 2019

Skype ? Steam ? Twitter ? Facebook ?

As you want, gimme your name somewhere I can contact you.

@remitamine remitamine mentioned this issue Apr 8, 2019
5 of 9 tasks complete
@s0rand0m
Copy link

@s0rand0m s0rand0m commented Apr 10, 2019

After fixing the urllib.request with an user agent and doing some tweaks because player_config was moved it was still working before, but now since today the m=re.search to get key doesnt work anymore and return None. Someone has any idea how to fix this?

@ghost
Copy link

@ghost ghost commented Apr 10, 2019

@remitamine Doesn't work anymore, they've changed it just after the release of One Punch Man Season 2.

@s0rand0m
Copy link

@s0rand0m s0rand0m commented Apr 10, 2019

(btw, here's my crappy way to get new player config info with re.findall if someone need)

        url = 'https://animedigitalnetwork.fr/'+re.findall('100%;" data-url="(.*?)">',webpage)[0]
        webpage2 = self._download_webpage(url, video_id)
        webpage2 = re.findall('{"player":(.*?),"actionBar',webpage2)[0]
        player_config = self._parse_json(self._search_regex(
            r'(.*)', webpage2, 'player config'), video_id)
@s0rand0m
Copy link

@s0rand0m s0rand0m commented Apr 10, 2019

hope @remitamine or @persi-persu gonna be able to break that new js ! Here's the latest "deobfuscated_js version" from today

10042019deobfuscated_beautified.txt

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 10, 2019

the manual method that I've explained before still work without a problem(deobfuscation, extract key function, change the last call to console.log and execute code in the browser).
here is the new key 7b59f657765153f9 by executing the part from line 650 to 657.

_0x3108d8[0x3] = 0x7732 * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = 0x7cae * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = _0x3108d8[0x0] * _0x3108d8[0x1];
for (var _0x57989e = 0x0; _0x57989e < 0x12; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
_0x3108d8[0x1] = _0x3108d8[0x2] * _0x3108d8[0x3], _0x3108d8[0x0] = [_0x3108d8[0x2], _0x3108d8[0x2] = _0x3108d8[0x0]][0x0];
for (_0x57989e = 0x4; _0x57989e < 0x11; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
_0x3108d8[0x0] = 0x95cd * _0x3108d8[0x0] % (0x2 << 0x10), _0xb03201(_0x3108d8['map'](function(_0x365834) {
    return ('3111' + _0x365834['toString'](0x10))['substr'](-0x4);
})['join'](''));
@s0rand0m
Copy link

@s0rand0m s0rand0m commented Apr 10, 2019

Thanks @remitamine!

@ghost
Copy link

@ghost ghost commented Apr 10, 2019

Thanks @remitamine!

Could you explain how it works, haven't understand it.

EDIT: Thanks, it works, but it's pretty boring to do it manually every day, anyway, thanks for answer.

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 10, 2019

updating the instruction again!!!
the execution of this code will result a readable file(adn.js) of the web player code(requires jsbeautifier package).

import base64
import os
import re
import urllib.request
from collections import deque

import jsbeautifier
from jsbeautifier.unpackers import UNPACKERS

for unpacker in UNPACKERS:
    if 'javascriptobfuscator' in unpacker.__name__:
        def unpack(code):
            matches = re.search(r"(?s)((?:var\s+)?(_0x[0-9a-f]+)\s*=\s*\[\s*(.+?)\s*\].+?}\(\2\s*,\s*(0x[0-9a-f]+)\)\);\s*)(?:var\s+)?(_0x[0-9a-f]+)", code)
            if matches:
                repl_array, shift, repl_func = matches.group(3, 4, 5)
                repl_array = deque(base64.b64decode(x[1:-1].encode().decode('unicode_escape')).decode().replace(r"'", r"\'") for x in repl_array.split(','))
                repl_array.rotate(-int(shift, 16))
                code = code[len(matches.group(1)):]
                code = re.sub(r"%s\('(0x[0-9a-f]+)'\)" % repl_func, lambda mobj: "'%s'" % repl_array[int(mobj.group(1), 16)], code)
            return code
        unpacker.unpack = unpack
        break

with urllib.request.urlopen(urllib.request.Request('http://www.animedigitalnetwork.fr/components/com_vodvideo/videojs/adn-vjs.min.js', headers={'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0'})) as adn_min:
    opts = jsbeautifier.default_options()
    opts.eol = os.linesep
    opts.unescape_strings = True
    code = jsbeautifier.beautify(adn_min.read().decode(), opts)
    with open('adn.js', 'wb') as adn_unmin:
        adn_unmin.write(code.encode())

now we have to location the key construction function, the subtitle decryption code located at prepareSubtitles function:

            'prepareSubtitles': function(_0x31f341) {
                if (this['minimalist']) {
                    for (var _0x2696a5 in _0x4845ec[this['trackIndex']] = {}, this['resolutions']) this['resolutions']['hasOwnProperty'](_0x2696a5) && (_0x4845ec[this['trackIndex']][_0x2696a5] = {});
                    this['startPlayer']();
                } else {
                    var _0x5e52e4 = CryptoJS['enc']['Base64']['parse'](_0x31f341['substring'](0x0, 0x18)),
                        _0xfc90c3 = _0xd52c11 + _0x278d86,
                        _0x10339d = CryptoJS['enc']['Hex']['parse'](_0xfc90c3),
                        _0x529633 = _0x31f341['substring'](0x18);
                    try {
                        var _0x307106 = CryptoJS['AES']['decrypt'](_0x529633, _0x10339d, {
                            'iv': _0x5e52e4
                        });
                        _0x307106 = _0x307106['toString'](CryptoJS['enc']['Utf8']), _0x4845ec[this['trackIndex']] = JSON['parse'](_0x307106) || {};
                    } catch (_0x2c9e75) {
                        return void this['trigger']('adn.error');
                    }
                    this['startPlayer']();
                }
            },

the key in this case is constructed with two parts, we only need the second part(changes frequently), the name of the second part variable is _0x278d86.

_0xfc90c3 = _0xd52c11 + _0x278d86

that gets set by _0xb03201 function:

_0xb03201 = function() {
    _0x278d86 = arguments[0x0];
};

that gets called in:

function() {
    var _0x876a2f = function() {
        var _0x99882, _0x3108d8 = [_0x99882 = 0x7651, _0x99882 += 0x9ad8, _0x99882 += -0xa16c, _0x99882 += 0x14631];
        _0x3108d8[0x3] = 0x7732 * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = 0x7cae * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = _0x3108d8[0x0] * _0x3108d8[0x1];
        for (var _0x57989e = 0x0; _0x57989e < 0x12; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
        _0x3108d8[0x1] = _0x3108d8[0x2] * _0x3108d8[0x3], _0x3108d8[0x0] = [_0x3108d8[0x2], _0x3108d8[0x2] = _0x3108d8[0x0]][0x0];
        for (_0x57989e = 0x4; _0x57989e < 0x11; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
        _0x3108d8[0x0] = 0x95cd * _0x3108d8[0x0] % (0x2 << 0x10), _0xb03201(_0x3108d8['map'](function(_0x365834) {
            return ('3111' + _0x365834['toString'](0x10))['substr'](-0x4);
        })['join'](''));
    };
    _0x876a2f(), _0x876a2f = {};
}()

now, we get the inner code of the function:

        var _0x99882, _0x3108d8 = [_0x99882 = 0x7651, _0x99882 += 0x9ad8, _0x99882 += -0xa16c, _0x99882 += 0x14631];
        _0x3108d8[0x3] = 0x7732 * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = 0x7cae * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = _0x3108d8[0x0] * _0x3108d8[0x1];
        for (var _0x57989e = 0x0; _0x57989e < 0x12; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
        _0x3108d8[0x1] = _0x3108d8[0x2] * _0x3108d8[0x3], _0x3108d8[0x0] = [_0x3108d8[0x2], _0x3108d8[0x2] = _0x3108d8[0x0]][0x0];
        for (_0x57989e = 0x4; _0x57989e < 0x11; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
        _0x3108d8[0x0] = 0x95cd * _0x3108d8[0x0] % (0x2 << 0x10), _0xb03201(_0x3108d8['map'](function(_0x365834) {
            return ('3111' + _0x365834['toString'](0x10))['substr'](-0x4);
        })['join'](''));

change the last call in the code(_0xb03201) with console.log:

        var _0x99882, _0x3108d8 = [_0x99882 = 0x7651, _0x99882 += 0x9ad8, _0x99882 += -0xa16c, _0x99882 += 0x14631];
        _0x3108d8[0x3] = 0x7732 * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = 0x7cae * _0x3108d8[0x3] % (0x2 << 0x10), _0x3108d8[0x3] = _0x3108d8[0x0] * _0x3108d8[0x1];
        for (var _0x57989e = 0x0; _0x57989e < 0x12; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
        _0x3108d8[0x1] = _0x3108d8[0x2] * _0x3108d8[0x3], _0x3108d8[0x0] = [_0x3108d8[0x2], _0x3108d8[0x2] = _0x3108d8[0x0]][0x0];
        for (_0x57989e = 0x4; _0x57989e < 0x11; _0x57989e++) _0x3108d8[0x1] += _0x57989e;
        _0x3108d8[0x0] = 0x95cd * _0x3108d8[0x0] % (0x2 << 0x10), console.log(_0x3108d8['map'](function(_0x365834) {
            return ('3111' + _0x365834['toString'](0x10))['substr'](-0x4);
        })['join'](''));

and execute the code in the web browser console, get the printed key and replace the one in the adn.py file.

but it's pretty boring to do it manually every day

@Asusagawa as i stated before, i don't use the website, and the same would apply for me if they decide to make the automatic detection of the key construction function more difficult.
and as they say:

give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime

@s0rand0m
Copy link

@s0rand0m s0rand0m commented Apr 10, 2019

@remitamine just when i figured out how u did u provide tuto haha :) nice ! Thanks again

@ghost
Copy link

@ghost ghost commented Apr 10, 2019

Thanks for this explanation, sorry if I seemed offensive, that wasn't the idea.

@ghost
Copy link

@ghost ghost commented Apr 16, 2019

@remitamine Sorry to bother you once again, it doesn't work anymore.

youtube-dl --cookies cookies.txt -f '(bestvideo[height<=1080]+bestaudio/best[height<=1080])' --write-sub https://animedigitalnetwork.fr/video/one-piece/9528-episode-880-sabo-sort-de-l-ombre-les-commandants-revolutionnaires -o "One Piece - 880 [1080p]".mp4 -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--cookies', 'cookies.txt', '-f', '(bestvideo[height<=1080]+bestaudio/best[height<=1080])', '--write-sub', 'https://animedigitalnetwork.fr/video/one-piece/9528-episode-880-sabo-sort-de-l-ombre-les-commandants-revolutionnaires', '-o', 'One Piece - 880 [1080p].mp4', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.04.07
[debug] Python version 3.7.3 (CPython) - Linux-5.0.4-arch1-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 4.1.2, ffprobe 4.1.2, rtmpdump 2.4
[debug] Proxy map: {}
[ADN] 9528: Downloading webpage
[ADN] 9528: Downloading player config JSON metadata
[ADN] 9528: Downloading links JSON metadata
[ADN] 9528: Downloading vostf mobile JSON metadata
[ADN] 9528: Downloading m3u8 information
[ADN] 9528: Downloading vostf sd JSON metadata
[ADN] 9528: Downloading m3u8 information
[ADN] 9528: Downloading vostf hd JSON metadata
[ADN] 9528: Downloading m3u8 information
[ADN] 9528: Downloading vostf fhd JSON metadata
[ADN] 9528: Downloading m3u8 information
[ADN] 9528: Downloading vostf auto JSON metadata
[ADN] 9528: Downloading m3u8 information
[ADN] 9528: Downloading subtitles data
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.7/site-packages/youtube_dl/__init__.py", line 474, in main
    _real_main(argv)
  File "/usr/lib/python3.7/site-packages/youtube_dl/__init__.py", line 464, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 2008, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 796, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 529, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/adn.py", line 198, in _real_extract
    'subtitles': self.extract_subtitles(sub_path, video_id),
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 2850, in extract_subtitles
    return self._get_subtitles(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/adn.py", line 69, in _get_subtitles
    bytes_to_intlist(compat_b64decode(enc_subtitles[24:])),
  File "/usr/lib/python3.7/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
remitamine added a commit that referenced this issue Apr 16, 2019
@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 16, 2019

will be fixed in the next version.

@ghost
Copy link

@ghost ghost commented Apr 16, 2019

Thanks.

@Nahoog
Copy link

@Nahoog Nahoog commented Apr 28, 2019

@remitamine I've got this issue, do you know that is the problem please ?

sudo python3 main.py --cookie cookies.txt --all-subs --skip-download -v https://animedigitalnetwork.fr/video/rakugo_tv/7004-episode-1-premier-acte
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--cookie', 'cookies.txt', '--all-subs', '--skip-download', '-v', 'https://animedigitalnetwork.fr/video/rakugo_tv/7004-episode-1-premier-acte']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.04.24
[debug] Python version 3.6.5 (CPython) - Linux-4.4.0-17763-Microsoft-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.4, ffprobe 3.4.4
[debug] Proxy map: {}
[ADN] 7004: Downloading webpage
[ADN] 7004: Downloading player config JSON metadata
[ADN] 7004: Downloading links JSON metadata
[ADN] 7004: Downloading vostf mobile JSON metadata
[ADN] 7004: Downloading m3u8 information
[ADN] 7004: Downloading vostf sd JSON metadata
[ADN] 7004: Downloading m3u8 information
[ADN] 7004: Downloading vostf hd JSON metadata
[ADN] 7004: Downloading m3u8 information
[ADN] 7004: Downloading vostf auto JSON metadata
[ADN] 7004: Downloading m3u8 information
[ADN] 7004: Downloading subtitles location
[ADN] 7004: Downloading subtitles data
WARNING: Unable to download webpage: HTTP Error 403: Forbidden
[debug] Default format spec: bestvideo+bestaudio/best

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 28, 2019

will be fixed in the next version.

remitamine added a commit that referenced this issue Apr 28, 2019
@Nahoog
Copy link

@Nahoog Nahoog commented Apr 28, 2019

It works, thanks !

@PR3D4T0R8778
Copy link

@PR3D4T0R8778 PR3D4T0R8778 commented Apr 29, 2019

Hello I have a problem : WARNING: Unable to download webpage: HTTP Error 403: Forbidden

@hexodgo
Copy link

@hexodgo hexodgo commented Jun 28, 2019

F:\>youtube-dl.exe -v --cookies F:\cookies.txt --all-subs --skip-download https://animedigitalnetwork.fr/video/boruto-naruto-next-generations/8148-episode-17-elle-court-sarada [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['-v', '--cookies', 'F:\\cookies.txt', '--all-subs', '--skip-download', 'https://animedigitalnetwork.fr/video/boruto-naruto-next-generations/8148-episode-17-elle-court-sarada'] [debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252 [debug] youtube-dl version 2019.06.27 [debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362 [debug] exe versions: none [debug] Proxy map: {} [ADN] 8148: Downloading webpage [ADN] 8148: Downloading player config JSON metadata [ADN] 8148: Downloading links JSON metadata [ADN] 8148: Downloading vf hd JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vf sd JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vf auto JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vf fhd JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vf mobile JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vostf hd JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vostf sd JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vostf auto JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vostf fhd JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading vostf mobile JSON metadata [ADN] 8148: Downloading m3u8 information [ADN] 8148: Downloading subtitles location [ADN] 8148: Downloading subtitles data Traceback (most recent call last): File "__main__.py", line 19, in <module> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\__init__.py", line 474, in main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\__init__.py", line 464, in _real_main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\YoutubeDL.py", line 2008, in download File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\YoutubeDL.py", line 796, in extract_info File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\extractor\common.py", line 530, in extract File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\extractor\adn.py", line 204, in _real_extract File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\extractor\common.py", line 2880, in extract_subtitles File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpjzs7t34q\build\youtube_dl\extractor\adn.py", line 80, in _get_subtitles UnicodeDecodeError: 'utf-8' codec can't decode byte 0xea in position 3: invalid continuation byte

i have this error for the downloads subs in adn

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jun 28, 2019

@hexodgo read the comment on how to extract and update the decryption key.

@hexodgo
Copy link

@hexodgo hexodgo commented Jun 28, 2019

im lock at this step

that gets set by _0xb03201 function: ?
the code

'prepareSubtitles': function(_0x381e6f) {
if (this['minimalist']) {
for (var _0x224849 in _0x46b056[this['trackIndex']] = {}, t$
this'startPlayer';
} else {
var _0x557da4 = CryptoJS['enc']['Base64']['parse'](_0x381e6$
_0x467787 = _0x1deade + _0x12f763,
_0x3ffcde = CryptoJS['enc']['Hex']'parse',
_0x540472 = _0x381e6f'substring';
try {
var _0x5b119f = CryptoJS['AES']['decrypt'](_0x540472, _$
'iv': _0x557da4
});
_0x5b119f = _0x5b119f['toString'](CryptoJS['enc']['Utf8$
} catch (_0x584352) {
return void this'trigger';

the line is

_0x467787 = _0x1deade + _0x12f763,

I don't understand the next step ...

sorry

@hexodgo
Copy link

@hexodgo hexodgo commented Jul 2, 2019

need help :)

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jul 2, 2019

@hexodgo everything has been explained before, read previous comments.
if you need help for basic skills needed(how to find a word in a file, how to execute a python script, etc...) you can search online.

@ytdl-org ytdl-org locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
17 participants
You can’t perform that action at this time.