URL to video file #2912

Closed
opened 2026-02-20 23:10:51 -05:00 by deekerman · 1 comment
Owner

Originally created by @KickassCoxa on GitHub (Aug 25, 2014).

Hello, i am building small application (API) for youtube-dl and i have several questions about possibility to return video URL for downloading in file.

API set would be:

  1. Dedicated server with Python installed
  2. Client PHP website with possibility for user enter video URL (external server)

Would it be possible to:
For user enter video view URL in Client PHP website, then with Client API functions provided send API request to my DServer, where youtube-dl/Python application would parse URL, access video provider website and get direct video URL, and then return it to Client PHP website where user after URL submition (On next page) would be able to press "download" and then be able to download video file?

Do i need return cookies from my DServer to Client PHP website and then set user cookie?

How could i do that?

Would there be some problems with some providers with this workflow?

If yes, is it legal to download video file to server and then let users to download it, or download-to-stream without storying video file in server?

How could i return direct video URL instead of downloading it server?

Thank you

Originally created by @KickassCoxa on GitHub (Aug 25, 2014). Hello, i am building small application (API) for youtube-dl and i have several questions about possibility to return video URL for downloading in file. API set would be: 1. Dedicated server with Python installed 2. Client PHP website with possibility for user enter video URL (external server) Would it be possible to: For user enter video view URL in Client PHP website, then with Client API functions provided send API request to my DServer, where youtube-dl/Python application would parse URL, access video provider website and get direct video URL, and then return it to Client PHP website where user after URL submition (On next page) would be able to press "download" and then be able to download video file? Do i need return cookies from my DServer to Client PHP website and then set user cookie? How could i do that? Would there be some problems with some providers with this workflow? If yes, is it legal to download video file to server and then let users to download it, or download-to-stream without storying video file in server? How could i return direct video URL instead of downloading it server? Thank you
Author
Owner

@phihag commented on GitHub (Aug 25, 2014):

That all totally depends on the the video site.

  • For some sites, only the direct URL is enough
  • For others, it won't work without cookies
  • And many providers restrict the download to the IP that extracted it.

So in general, you need to download the video on your server first.

I am not a lawyer, so I cannot answer legal questions. Unless you specify a psasword, youtube-dl only downloads public videos though, and those often cached anyways between users. Many major ISPs also have their own official or unofficial active caching and recompression boxes. I guess it also depends a lot on where you are actually running your server - law can be quite different from country to country.

To allow the video to be downloaded by a client, you must implement the extraction (i.e. run youtube-dl) client-side. Due to security restrictions, this won't work in a web application though.

@phihag commented on GitHub (Aug 25, 2014): That all totally depends on the the video site. - For some sites, only the direct URL is enough - For others, it won't work without cookies - And many providers restrict the download to the IP that extracted it. So in general, you need to download the video on your server first. I am not a lawyer, so I cannot answer legal questions. Unless you specify a psasword, youtube-dl only downloads public videos though, and those often cached anyways between users. Many major ISPs also have their own official or unofficial active caching and recompression boxes. I guess it also depends a lot on where you are actually running your server - law can be quite different from country to country. To allow the video to be downloaded by a client, you must implement the extraction (i.e. run youtube-dl) client-side. Due to security restrictions, this won't work in a web application though.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#2912
No description provided.