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

I need help with the decrypt signature code: #3174

Closed
juanla opened this issue Jun 29, 2014 · 4 comments
Closed

I need help with the decrypt signature code: #3174

juanla opened this issue Jun 29, 2014 · 4 comments

Comments

@juanla
Copy link

@juanla juanla commented Jun 29, 2014

Hello all! First, Sorry for my english

I am coding a little java app that allows download a video from youtube, and I have troubles with the signature (I receibe 403 forbidden when use my urls)

I will hope somebody can help me a little :)

I will start with a VEVO video (but we can try any):
https://www.youtube.com/watch?v=My2FRPA3Gf8

Im getting for example this download URL:
https://r8---sn-w511uxa-h5qz.googlevideo.com/videoplayback?signature=58CC9165505182C4C8E10DC245402D47D1D842990.D01383B3F72B138739230AA522E3AFC06D30C635D35D

The signature is encrypted (I suppose because Im having HTTP 403) Then, Im decrypting the signature using the python code on this page (I used to try the decryption process before to convert to java):
http://www.compileonline.com/execute_python_online.php

With this code:
http://pastebin.com/Z6U4KQmW (Using the before mencioned signature)

I receibe this new signature:
36C03D60CFA3E225AA032937831B27F3B38310D.0C9248D1D74D204542CD01E8D4C2815055619CC85

Then I tried the new URL:
https://r8---sn-w511uxa-h5qz.googlevideo.com/videoplayback?signature=36C03D60CFA3E225AA032937831B27F3B38310D.0C9248D1D74D204542CD01E8D4C2815055619CC85

And same 403 forbbiden than before.

Anybody can help me? Whats is wrong here?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 29, 2014

Does it work when you just download the video? Post the full output you get with the --verbose option: youtube-dl https://www.youtube.com/watch?v=My2FRPA3Gf8 --verbose

@ghost
Copy link

@ghost ghost commented Jun 29, 2014

You are trying to use static decrypting method, it's not maintained anymore, hence don't work...

Look at youtube-dl.py for automatic decrypting. It automatically extracts js signature function.

@juanla
Copy link
Author

@juanla juanla commented Jun 29, 2014

wow, you are right, I found the right code, but I have some problems to understand it, any can explain me a little (I used to code in java, and my knowledge in python is low)

I have:
s-> encrypted signature
videoid->videoid
playerurl (Html5 .js version)
age_gate-> (I will skip this for now)
Player source.

I understand that I have to download the source from the player (If I dont have it yet) Its this source:

             player_id = (player_url, len(s))
            if player_id not in self._player_cache:
                func = self._extract_signature_function(
                    video_id, player_url, len(s)
                )
                self._player_cache[player_id] = func
            func = self._player_cache[player_id]

well, when I have the downloaded source, I dont understand this:
if self._downloader.params.get('youtube_print_sig_code'):
self._print_sig_code(func, len(s))
return func(s)

@phihag
Copy link
Contributor

@phihag phihag commented Jun 29, 2014

As mentioned in our Bug reporting instructions, this bug tracker is for issues affecting the use of youtube-dl. You are not using youtube-dl.

@phihag phihag closed this Jun 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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