diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9b1e44fdb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:2.7.16-alpine3.9 +LABEL MAINTAINER="sillyhatxu@gmail.com" + +RUN apk add --no-cache tzdata +RUN apk --update --no-cache add curl +RUN apk add --no-cache ca-certificates + +RUN curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl +RUN chmod a+rx /usr/local/bin/youtube-dl + +WORKDIR /app + +ENTRYPOINT ["sh", "/app/download.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 92c3a92a1..0bc050a5f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ youtube-dl - download videos from youtube.com or other video platforms - [INSTALLATION](#installation) - [DESCRIPTION](#description) +- [DOCKER](#docker) - [OPTIONS](#options) - [CONFIGURATION](#configuration) - [OUTPUT TEMPLATE](#output-template) @@ -50,6 +51,24 @@ Alternatively, refer to the [developer instructions](#developer-instructions) fo youtube-dl [OPTIONS] URL [URL...] +# DOCKER + +If you don't want to download plug-in for your company. You can ues docker image. + +### build docker images + + docker build -t youtube-dl . + +### docker run + +It will execute the `download.sh` script in the current directory + + docker run -d -v `pwd`/:/app xushikuan/youtube-download:1.0 + +### download.sh + + youtube-dl -i -r 1M -o '/app/%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/channel/xxxxxxxxxxxxxxxxx/playlists + # OPTIONS -h, --help Print this help text and exit --version Print program version and exit