nbr23 / youtube-dl-server

Web / REST interface for downloading youtube videos onto a server.
MIT License
228 stars 32 forks source link

login required to download video from source #43

Open judos opened 3 years ago

judos commented 3 years ago

Is there an easy way to configure logins for webpages where this is required? I am not familiar with youtube-dl/ffmpeg so far.

Thanks for your help! The Frontend is awesome btw!

g0d-m0nky commented 3 years ago

Is there an easy way to configure logins for webpages where this is required? I am not familiar with youtube-dl/ffmpeg so far.

Thanks for your help! The Frontend is awesome btw!

hi, did you ever figure this out?

blackerking commented 3 years ago

Hey there, It would be a very bad idea to publish a plain http (unsecure) service in the web. Most users have several services and use a https proxy for handling secure connections. Inside such proxys (like Traefik or SWAG) you can add security features like password, OTP, etc.

On the otherside it is easy to hack a http password protection.

I don't like this idea.

nbr23 commented 3 years ago

@judos can you clarify what you are looking for here? Is it to specify credentials for video sources ? Or is it like @blackerking mentionned to add login/password to the youtube-dl-server interface? If it is this case, then it will not be implemented, and should be handled by your reverse proxy as @blackerking mentionned.

Thanks!

judos commented 3 years ago

Yes I meant a way to specify credentials for video sources. Like when I tried to download a video it said "login required". Sorry I didn't paste the logs. Gonna post them next time when I have this issue.

judos commented 3 years ago

Found it finally again. I tried to download mp3 of this video: https://www.youtube.com/watch?v=Nkwhj96kVyU

Log in the youtube-dl UI shows:

Error during download task:
Exception:
WARNING: unable to download video info webpage: HTTP Error 404: Not Found
ERROR: Sign in to confirm your age
This video may be inappropriate for some users.

Is there a way how I can configure it to use my account?

nbr23 commented 3 years ago

Hi @judos,

Thanks yeah I have something in mind to get this sorted out. I should have a fix soon. Cheers,

yangchris4 commented 3 years ago

thanks for providing this great project! and it will be better if you can add the following function.

1.using youtube cookies to download some age-confirmed videos; 2.youtube-dl can automatically move the video into the specified folder after downloading it. (using --exec "mv {} /," )

best wishes! @nbr23

nbr23 commented 3 years ago

@yangchris4 thanks for the suggestions!

  1. is definitely planned… daytime work got in the way, but I should have this ready soon!
  2. I'm not 100% sure (but happy to get convinced!) how this would be helpful compared to just changing the output location directly ?
    ydl_options:
    output: '/youtube-dl/%(title)s [%(id)s].%(ext)s'

Cheers!

yangchris4 commented 3 years ago

hi @nbr23 thank you for answering my question patiently.

ydl_options: output: '/youtube-dl/%(title)s [%(id)s].%(ext)s'

nice try,however sometimes the video files are either separated from audio and video, or there are many fragments like m3u8, which means that after the download is completed, it needs to be merged twice;

if it is to download the file directly to the vps local, merging local files is extremely fast; but if it is a mounted remote disk,These incomplete videos are downloaded and transmitted to the remote.

When merging, the downloaded incomplete files must be read from the remote. Pull it back from the remote and merge it for a second time,that's a big problem.

At this time, you need to download the file to the local first, and automatically move the complete video file to the specified remote folder after the merge is completed, so as to avoid the problem of slow speed or simply unable to download;

accroding to the offical documentation

–exec CMD Execute a command on the file after downloading, similar to find’s -exec syntax. Example: –exec ‘adb push {} /sdcard/Music/ && rm {}’

For example youtube-dl -v --exec "mv {} /mnt/share/{}" https://www.youtube.com/watch?v=********

argument

mv :#command to move files {} :#Get the file name parameter /mnt/share:#This folder is the remote disk folder I mounted

This command works when I use it,XD