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

Get URL but play it on a different device/computer #2595

Closed
simplyi opened this issue Mar 20, 2014 · 5 comments
Closed

Get URL but play it on a different device/computer #2595

simplyi opened this issue Mar 20, 2014 · 5 comments

Comments

@simplyi
Copy link

@simplyi simplyi commented Mar 20, 2014

Hi guys!

It looks like youtube-dl can extract video urls but they can play only on a computer that issued the request. I cannot take extracted URL and play it on a computer with different ip address.

I need to extract video URL and play it on a Mobile Phone. Is there a way I can fake IP address with youtube-dl?

  1. I will get the IP address of user requesting the video.
  2. I will then run youtube-dl on behalf of user's IP address and get extracted URLs
  3. Return extracted URLs to Mobile device to be played

Is it possible?

@phihag
Copy link
Contributor

@phihag phihag commented Mar 20, 2014

Faking an IP address is generally a network attack and therefore not an option for your scenario.

You can get the video URL with the -g option. Especially if you use the --cookie option to store the cookies and use them in the final request as well, it may work on a lot of sites.

However, some video services require the final request to come from the same IP address.

Why don't you just run youtube-dl on the mobile device itself?

@phihag phihag closed this Mar 20, 2014
@simplyi
Copy link
Author

@simplyi simplyi commented Mar 21, 2014

@phihag I did not know I can run youtube-dl on iOS. That would be so helpful so awesome if youtube-dl could run on mobile phone/iOS.

Can I? Can you advice me of ways to do that?

@phihag
Copy link
Contributor

@phihag phihag commented Mar 21, 2014

I don't own any iOS devices (and I don't know of any open-source emulator), so I cannot say much about developing for iOS. However, Python should run fine on a modern smartphone, a quick google search turns up http://pythonforios.com/ , which even implements a Python IDE.

For what it's worth, running on Android is trivial once you've got a Python interpreter set up, see for example #967.

@simplyi
Copy link
Author

@simplyi simplyi commented Mar 21, 2014

@phihag looks like for Python to run on iOS, the device needs to be jailbroken, there is no way around that... and also that will require all users who download my app to have Python installed...

Can you guys advice me how to get youtube signature properly deciphered? Currently I grab the html5player javascript file and extract these two functions:

function fE(a){a=a.split("");a=a.slice(2);a=a.reverse();a=gE(a,39);a=gE(a,43);return a.join("")}
function gE(a,b){var c=a[0];a[0]=a[b%a.length];a[b]=c;return a}

Then pass the signature from url and get the new one. It works for many videos but not for videos that have label VEVO and actually for many others this approach does not help. Do you get proper signature another way?

@phihag
Copy link
Contributor

@phihag phihag commented Mar 21, 2014

The software I linked is available in the official Apple appstore, and therefore does not need a jailbroken phone. Additionally, iOS allows native code, and the cPython interpreter is native code. You can simply include the whole interpreter, just like our exe download.

We cannot advice you how to get YouTube signatures properly deciphered, since this is a bug tracker about youtube-dl and youtube-dl only.

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
2 participants
You can’t perform that action at this time.