ytmdl-web-v2 icon indicating copy to clipboard operation
ytmdl-web-v2 copied to clipboard

set download dir

Open lukesturgis opened this issue 3 years ago • 3 comments

it'd be nice if there was a way to have a data dir mounted via docker that you could have ytmdl automatically put songs in after complete, using the -o OUTPUT_DIR option. im happy to try and come up with a commit or pr if this is a desirable feature for others.

(first time creating a feature request for this repo, please lmk if i put this in the wrong spot.)

awesome tool by the way! using it all the time.

lukesturgis avatar Feb 10 '22 16:02 lukesturgis

@lukesturgis That is a nice feature but the docker image provided in this repo is for the web version and it utilizes ytmdl apis to download the song.

I don't think the files are getting downloaded to the docker image.

If this is something you'd like in the cli tool, I can move this issue to that repo (https://github.com/deepjyoti30/ytmdl)

deepjyoti30 avatar Mar 14 '22 05:03 deepjyoti30

@deepjyoti30 Could you help me understand what https://github.com/deepjyoti30/ytmdl-web-v2/blob/7b32d4777859f5888f7aecd33fe0777c3217f694/src/views/Download.vue#L75 is doing? I had though that the response body contained the music file as a payload which would then be downloaded by the user. I am not too familiar with JS/backend code.

Also, where can I find details on the API (if publically available)? Out of curiosity, why not run ytmdl inside the docker container and ship as part of the docker container? When the details of a music file are finalized, ytmdl can be launched inside as a process.

Looking forward to hearing your thoughts :)

rzalawad avatar Aug 10 '23 04:08 rzalawad

is doing? I had though that the response body contained the music file as a payload which would then be downloaded by the user. I am not too familiar with JS/backend code.

This function is hitting the download endpoint of the Ytmdl Web API and getting the details of the song to be downloaded like the file URL, how long it is accessible etc.

As you can see it is writing the detail to a variable.

This variable is then passed as a prop to the DownloadButton component. So once the download details are fetched the button is ready to be clicked and when it is clicked, the song starts downloading.

Also, where can I find details on the API (if publically available)?

You cannot. It's not open source. I initially had plans of making the API open-source but due to lack of time I have decided to keep it as is.

Out of curiosity, why not run ytmdl inside the docker container and ship as part of the docker container?

When you say ytmdl are you referring to the ytmdl CLI? If that is so then the reason is if I keep the CLI in the same docker the web will have one CLI that can be triggerred once at a time to download the song. However I want the webapp to be asynchronous and work simultaneously for everyone.

This is where the API comes in where the API can accept multiple requests at the same time and moreover the current deployment of the API is running in three different nodes which makes it very reliable ( in the unlikely scenario of one node going down, the API will still be up).

Also, based on the other issue you had raise #74 , I think you are trying to understand the API and the web code to be able to create a script of some kind to run on your server? I would again say that the better approach for you would be to just use the CLI version of ytmdl that you can find here: https://github.com/deepjyoti30/ytmdl

deepjyoti30 avatar Aug 25 '23 17:08 deepjyoti30