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

Custom Configuration Fork #4

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# youtube-dl Server Dockerfile
#
# https://github.com/kmb32123/youtube-dl-server-dockerfile
# https://github.com/brandong777/youtube-dl-server-dockerfile
#

# Pull base image.
Expand All @@ -12,9 +12,12 @@ RUN \
apt-get update && \
apt-get install -y libav-tools && \
rm -rf /var/lib/apt/lists/*

# Copy default youtube-dl.conf
COPY youtube-dl.conf /config/youtube-dl.conf

EXPOSE 8080

VOLUME ["/youtube-dl"]
VOLUME /config /youtube-dl

CMD [ "python", "-u", "./youtube-dl-server.py" ]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ This example uses host networking for simplicity. Also note the `-v` argument. T
sudo docker run -d --net="host" --name youtube-dl -v /home/kevin/youtube-dl:/youtube-dl kmb32123/youtube-dl-server
```

### Configuration

Define custom configuration options within /config/youtube-dl.conf. See https://github.com/rg3/youtube-dl/blob/master/README.md#configuration for more details.

### Start a download remotely

Downloads can be triggered by supplying the `{{url}}` of the requested video through the Web UI or through the REST interface via curl, etc.
Expand Down
2 changes: 1 addition & 1 deletion youtube-dl-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def dl_worker():

def download(url):
print("Starting download of " + url)
command = """youtube-dl -o "/youtube-dl/.incomplete/%(title)s.%(ext)s" -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4] --exec 'touch {} && mv {} /youtube-dl/' --merge-output-format mp4 """ + url
command = """youtube-dl --config-location /config --exec 'touch {} && mv {} /youtube-dl/' --merge-output-format mp4 """ + url
subprocess.call(command, shell=True)
print("Finished downloading " + url)

Expand Down
10 changes: 10 additions & 0 deletions youtube-dl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Lines starting with # are comments

# Use this proxy
#--proxy 172.17.0.1:8118

# File Output Options
-o "/youtube-dl/.incomplete/%(title)s[%(id)s].%(ext)s"

# Format Options
-f bestvideo[height<=?1080][ext=mp4]+bestaudio[ext=mp4]/best[height<=?1080][ext=mp4]
Binary file added youtube-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.