Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

feat: use custom url for binary download #351

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

n1ru4l
Copy link

@n1ru4l n1ru4l commented Feb 18, 2021

This solves #338 which unfortunately got closed without being addressed.

This feature is necessary for people that are self-hosting the youtube-dl binary, e.g. on S3

cc @Kikobeats

@Kikobeats
Copy link
Collaborator

Hey, @n1ru4l I understand your use case but I prefer to don't add a new environment variable it could be a thing we can avoid.

What we can do to avoid the new environment variable is to check the response content type here:

https://github.com/przemyslawpluta/node-youtube-dl/blob/master/lib/downloader.js#L29

  1. If the content type is text, then the body contains the URL for fetching the resource.
  2. Otherwise the response is binary.

If you can make that change I will happy to merge :)

@n1ru4l
Copy link
Author

n1ru4l commented Feb 18, 2021

That would not work as there are additional get parameter added here:

`${ENDPOINT}?platform=${isWin ? 'windows' : 'linux'}`,

@Kikobeats
Copy link
Collaborator

@n1ru4l not seeing that is an issue since query parameters are ignored by S3 files.

e.g., https://s.microlink.io/kdsy_4QyLo6Kh61e8SOtMcxCtWg_.png?foo=bar&platform=darwin

@n1ru4l
Copy link
Author

n1ru4l commented Feb 18, 2021

But it will not append .exe properly?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants