Merge branch 'master' of github.com:nficano/pytube
Browse files* 'master' of github.com:nficano/pytube:
Update cipher.py
Update cipher.py
Update cipher.py
- pytube/cipher.py +4 -6
pytube/cipher.py
CHANGED
@@ -5,10 +5,8 @@ This module countains all logic necessary to decipher the signature.
|
|
5 |
YouTube's strategy to restrict downloading videos is to send a ciphered version
|
6 |
of the signature to the client, along with the decryption algorithm obfuscated
|
7 |
in JavaScript. For the clients to play the videos, JavaScript must take the
|
8 |
-
ciphered version,
|
9 |
-
signs the media URL with the output.
|
10 |
-
signature sent in the GET parameters is valid, and then returns the content
|
11 |
-
(video/audio stream) or 403 unauthorized accordingly.
|
12 |
|
13 |
This module is responsible for (1) finding and extracting those "transform
|
14 |
functions" (2) maps them to Python equivalents and (3) taking the ciphered
|
@@ -45,8 +43,8 @@ def get_initial_function_name(js):
|
|
45 |
def get_transform_plan(js):
|
46 |
"""Extract the "transform plan".
|
47 |
|
48 |
-
The "transform plan" is the functions the ciphered signature is
|
49 |
-
through to obtain the actual signature.
|
50 |
|
51 |
:param str js:
|
52 |
The contents of the base.js asset file.
|
|
|
5 |
YouTube's strategy to restrict downloading videos is to send a ciphered version
|
6 |
of the signature to the client, along with the decryption algorithm obfuscated
|
7 |
in JavaScript. For the clients to play the videos, JavaScript must take the
|
8 |
+
ciphered version, cycle it through a series of "transform functions," and then
|
9 |
+
signs the media URL with the output.
|
|
|
|
|
10 |
|
11 |
This module is responsible for (1) finding and extracting those "transform
|
12 |
functions" (2) maps them to Python equivalents and (3) taking the ciphered
|
|
|
43 |
def get_transform_plan(js):
|
44 |
"""Extract the "transform plan".
|
45 |
|
46 |
+
The "transform plan" is the functions that the ciphered signature is
|
47 |
+
cycled through to obtain the actual signature.
|
48 |
|
49 |
:param str js:
|
50 |
The contents of the base.js asset file.
|