docker actually working
This commit is contained in:
parent
cab6a4d8c1
commit
9ca1d132c4
7 changed files with 28 additions and 4 deletions
|
|
@ -6,6 +6,7 @@ FROM ghcr.io/linuxserver/baseimage-alpine:3.15
|
|||
COPY root/ /
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
vim \
|
||||
gcc \
|
||||
g++ \
|
||||
make \
|
||||
|
|
@ -20,7 +21,8 @@ RUN apk update && \
|
|||
apk add --repository=http://dl-3.alpinelinux.org/alpine/edge/community/ \
|
||||
py3-pip=22.0.4-r0 && \
|
||||
mkdir -p /config && \
|
||||
pip install --no-cache-dir ytdl_sub-*.whl
|
||||
pip install --no-cache-dir ytdl_sub-*.whl && \
|
||||
rm ytdl_sub-*.whl
|
||||
|
||||
###############################################################################
|
||||
# CONTAINER CONFIGS
|
||||
|
|
|
|||
11
docker/root/etc/cont-init.d/30-config
Normal file
11
docker/root/etc/cont-init.d/30-config
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# copy config
|
||||
[[ ! -e /config/config.yaml ]] && \
|
||||
cp /defaults/config.yaml /config/config.yaml
|
||||
[[ ! -e /config/subscriptions.yaml ]] && \
|
||||
cp /defaults/subscriptions.yaml /config/subscriptions.yaml
|
||||
|
||||
# permissions
|
||||
chown -R abc:abc \
|
||||
/config
|
||||
|
|
@ -21,6 +21,8 @@ console_scripts =
|
|||
[options]
|
||||
package_dir =
|
||||
= src
|
||||
packages=find:
|
||||
|
||||
install_requires =
|
||||
argparse==1.4.0
|
||||
dicttoxml==1.7.4
|
||||
|
|
@ -30,6 +32,9 @@ install_requires =
|
|||
PyYAML==6.0
|
||||
yt-dlp==2022.4.8
|
||||
|
||||
[options.packages.find]
|
||||
where=src
|
||||
|
||||
[options.extras_require]
|
||||
test =
|
||||
coverage[toml]==6.3.2
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import argparse
|
|||
###################################################################################################
|
||||
# GLOBAL PARSER
|
||||
parser = argparse.ArgumentParser(
|
||||
description="YoutubeDL-Subscribe: Download and organize your favorite media hassle-free."
|
||||
description="ytdl-sub: Automate download and adding metadata with YoutubeDL"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
|
|
@ -21,8 +21,8 @@ subscription_parser.add_argument(
|
|||
"subscription_paths",
|
||||
metavar="SUBPATH",
|
||||
nargs="*",
|
||||
help="path to subscription files, uses config.yaml if not provided",
|
||||
default="config.yaml",
|
||||
help="path to subscription files, uses subscriptions.yaml if not provided",
|
||||
default="subscriptions.yaml",
|
||||
)
|
||||
###################################################################################################
|
||||
# DOWNLOAD PARSER
|
||||
|
|
|
|||
|
|
@ -60,6 +60,12 @@ def _download_subscription_from_cli(config: ConfigFile, extra_args: List[str]) -
|
|||
|
||||
def main():
|
||||
"""Entrypoint for ytdl-subscribe"""
|
||||
|
||||
# If no args are provided, print help and exit
|
||||
if len(sys.argv) < 2:
|
||||
parser.print_help()
|
||||
return
|
||||
|
||||
args, extra_args = parser.parse_known_args()
|
||||
|
||||
config: ConfigFile = ConfigFile.from_file_path(args.config)
|
||||
|
|
|
|||
Loading…
Reference in a new issue