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

Running youtube-dl on a server #248

Closed
jasperamorgan opened this issue Dec 13, 2011 · 3 comments
Closed

Running youtube-dl on a server #248

jasperamorgan opened this issue Dec 13, 2011 · 3 comments

Comments

@jasperamorgan
Copy link

I'm writing a bookmarking tool to create playlists of online video which can be played from local media players.

For Youtube videos I am extracting the actual video URLs using Youtube-dl running on a server which get passed to the media player.

This works great running in a local development environment but when the URL is extracted from the production server (running on EC2), I get a 403 error. (BTW, as per issue #41 I'm passing the cookie to the media player which works fine.)

Could it be an issue that the URL is being extracted and then used on machines running in different networks?

@phihag
Copy link
Contributor

phihag commented Dec 15, 2011

This depends on the video service you're downloading from. In particular, youtube is known to require extractor (i.e. youtube-dl) and downloader to be in the same /24 IPv4 network. Many video services (youtube included) also require cookies, and may require the same User-Agent string and other characteristics.

I think you have options here:

  1. Download the videos on the server, and re-serve them.
  2. Run youtube-dl on the client, i.e. pass youtube/video service URLs unmodified.
  3. Somehow get client and server into the same network.
  4. youtube only: Download via IPv6, where these rules don't seem to apply. Note that extraction will be IPv4 unless you're specifically whitelisted by google.

I'm marking this issue as closed as I don't think there is anything youtube-dl can do here (apart from clearly documenting one needs to transfer cookies and such). This doesn't mean we can't discuss it; I'll reopen the issue once there is a specific problem with youtube-dl, or a problem that can't be solved by one of the above setups.

@phihag phihag closed this as completed Dec 15, 2011
@jasperamorgan
Copy link
Author

Hi Philipp,

thanks for taking time to respond and confirming my suspicion that
extraction and playback need to happen on the same network. I agree that
this falls outside the scope of youtube-dl. I'll take a shot at getting
the extractor to pass in the network address of the client to see if
youtube can be fooled into thinking that extraction and playback happen
from the same network.

mfg

Jasper

On 15 December 2011 14:03, Philipp Hagemeister <
reply@reply.github.com

wrote:

This depends on the video service you're downloading from. In particular,
youtube is known to require extractor (i.e. youtube-dl) and downloader to
be in the same /24 IPv4 network. Many video services (youtube included)
also require cookies, and may require the same User-Agent string and other
characteristics.

I think you have options here:

  1. Download the videos on the server, and re-serve them.
  2. Run youtube-dl on the client, i.e. pass youtube/video service URLs
    unmodified.
  3. Somehow get client and server into the same network.
  4. youtube only: Download via IPv6, where these rules don't seem to apply.
    Note that extraction will be IPv4 unless you're specifically whitelisted by
    google.

I'm marking this issue as closed as I don't think there is anything
youtube-dl can do here (apart from clearly documenting one needs to
transfer cookies and such). This doesn't mean we can't discuss it; I'll
reopen the issue once there is a specific problem with youtube-dl, or a
problem that can't be solved by one of the above setups.


Reply to this email directly or view it on GitHub:
#248 (comment)

@maurrubio
Copy link

@jasperamorgan Did you manage to solve this issue?

joedborg referenced this issue in joedborg/youtube-dl Nov 17, 2020
[pull] master from ytdl-org:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants