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

Download binary from custom mirror, e.g. S3 #1

Closed
n1ru4l opened this issue Mar 2, 2021 · 5 comments · Fixed by #2
Closed

Download binary from custom mirror, e.g. S3 #1

n1ru4l opened this issue Mar 2, 2021 · 5 comments · Fixed by #2

Comments

@n1ru4l
Copy link

n1ru4l commented Mar 2, 2021

Currently, it seems like the binary can only be downloaded from S3. I created przemyslawpluta/node-youtube-dl#351 on node-youtube-dl

Since this package supersedes node-youtube-dl I think there should be an option for a custom mirror.

A possible implementation could use the YOUTUBE_DL_DIRECT_BINARY_DOWNLOAD_URL environment variable:

YOUTUBE_DL_DIRECT_BINARY_DOWNLOAD_URL - download the youtube-dl binary from the given download url, completely ignoring the ** YOUTUBE_DL_HOST** option, while performing no lookup for retrieving the latest version of the binary. This is useful if you are hosting the youtube-dl binary on your own S3 bucket. The platform-specific extension will be appended.
E.g. the value https://xxxxx.s3.xxxxxx.amazonaws.com/2020.11.12-youtube-dl will result in downloading https://xxxxx.s3.xxxxxx.amazonaws.com/2020.11.12-youtube-dl.exe on windows.

@Kikobeats
Copy link
Member

Hello, can you give me a valid S3 URL for testing? 🙂

@n1ru4l
Copy link
Author

n1ru4l commented Mar 2, 2021

@Kikobeats Here you go :) https://youtube-dl-mirror.s3.eu-central-1.amazonaws.com/2020.11.12-youtube-dl, https://youtube-dl-mirror.s3.eu-central-1.amazonaws.com/2020.11.12-youtube-dl.exe

@Kikobeats
Copy link
Member

Kikobeats commented Mar 2, 2021

shipped at [email protected], can you confirm to me it works as you expected?

just you need to setup YOUTUBE_DL_HOST environment variable:

YOUTUBE_DL_HOST=https://youtube-dl-mirror.s3.eu-central-1.amazonaws.com/2020.11.12-youtube-dl

or

YOUTUBE_DL_HOST=https://youtube-dl-mirror.s3.eu-central-1.amazonaws.com/2020.11.12-youtube-dl.exe

Also, I added some details about environment variables into the documentation:

https://github.com/microlinkhq/youtube-dl-exec/blob/master/README.md#environment-variables

@n1ru4l
Copy link
Author

n1ru4l commented Mar 3, 2021

why cant we just append .exe based on the detected os? This now requires setting up environment variables based on the OS before installing the package. 😕

@Kikobeats
Copy link
Member

Kikobeats commented Mar 3, 2021

it auto-detects the platform and add .exe under windows:

https://github.com/microlinkhq/youtube-dl-exec/blob/master/src/constants.js#L21

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

Successfully merging a pull request may close this issue.

2 participants