51 lines
1.9 KiB
Markdown
51 lines
1.9 KiB
Markdown
# youtube-dl-web
|
|
|
|
youtube-dl wrapped in a simple web server.
|
|
|
|
[](https://raw.githubusercontent.com/w33ble/youtube-dl-web/master/LICENSE)
|
|
[](https://nodejs.org/api/documentation.html#documentation_stability_index)
|
|
|
|
## Usage
|
|
|
|
Meant to be used with Docker, but it would work locally if you have [youtube-dl](https://youtube-dl.org/) installed as well.
|
|
|
|
```sh
|
|
docker run -it --rm -p 8080:8080 -v $PWD/data:/app/data w33ble/youtube-dl-web
|
|
```
|
|
|
|
Then hit `http://localhost:8080`, passing in a `url` and optionally a `format` query parameter for where to download from. For example:
|
|
|
|
```text
|
|
http://localhost:8080?url=https://www.youtube.com/watch?v=YE7VzlLtp-4
|
|
```
|
|
|
|
You can also pass in additional arguments that would normally be passed on the command line as query parameters in the URL, like so:
|
|
|
|
```text
|
|
http://localhost:8080?url=https://www.youtube.com/watch?v=YE7VzlLtp-4&format=mp3
|
|
```
|
|
|
|
### Automatic cleanup
|
|
|
|
By default, this image will both send the download in the web response as well as save it to disk. This is handy if you're saving those downloads via a volume.
|
|
|
|
If you don't want to keep the downloads around, you can use the `REMOVE_DOWNLOAD` environment to tell the server to clean up the download after sending it in the web request. Setting the value to `1` or `true` is all it takes:
|
|
|
|
```sh
|
|
docker run -it --rm -p 8080:8080 --env REMOVE_DOWNLOAD=1 w33ble/youtube-dl-web
|
|
```
|
|
|
|
Running it like this, the result from youtube-dl will only be useful from the web response. The file is cleaned up after sending so using the shared volume doesn't make sense.
|
|
|
|
## Deploy to Docker Hub
|
|
|
|
```sh
|
|
docker build . -t youtube-dl-web
|
|
docker tag youtube-dl-web w33ble/youtube-dl-web:latest
|
|
docker push w33ble/youtube-dl-web:latest
|
|
```
|
|
|
|
## License
|
|
|
|
MIT © [w33ble](https://github.com/w33ble)
|