docker actually working

This commit is contained in:
jbannon 2022-05-19 20:02:42 +00:00
parent cab6a4d8c1
commit 9ca1d132c4
7 changed files with 28 additions and 4 deletions

View file

@ -6,6 +6,7 @@ FROM ghcr.io/linuxserver/baseimage-alpine:3.15
COPY root/ / COPY root/ /
RUN apk update && \ RUN apk update && \
apk add \ apk add \
vim \
gcc \ gcc \
g++ \ g++ \
make \ make \
@ -20,7 +21,8 @@ RUN apk update && \
apk add --repository=http://dl-3.alpinelinux.org/alpine/edge/community/ \ apk add --repository=http://dl-3.alpinelinux.org/alpine/edge/community/ \
py3-pip=22.0.4-r0 && \ py3-pip=22.0.4-r0 && \
mkdir -p /config && \ 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 # CONTAINER CONFIGS

View 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

View file

@ -21,6 +21,8 @@ console_scripts =
[options] [options]
package_dir = package_dir =
= src = src
packages=find:
install_requires = install_requires =
argparse==1.4.0 argparse==1.4.0
dicttoxml==1.7.4 dicttoxml==1.7.4
@ -30,6 +32,9 @@ install_requires =
PyYAML==6.0 PyYAML==6.0
yt-dlp==2022.4.8 yt-dlp==2022.4.8
[options.packages.find]
where=src
[options.extras_require] [options.extras_require]
test = test =
coverage[toml]==6.3.2 coverage[toml]==6.3.2

View file

@ -3,7 +3,7 @@ import argparse
################################################################################################### ###################################################################################################
# GLOBAL PARSER # GLOBAL PARSER
parser = argparse.ArgumentParser( 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( parser.add_argument(
"-c", "-c",
@ -21,8 +21,8 @@ subscription_parser.add_argument(
"subscription_paths", "subscription_paths",
metavar="SUBPATH", metavar="SUBPATH",
nargs="*", nargs="*",
help="path to subscription files, uses config.yaml if not provided", help="path to subscription files, uses subscriptions.yaml if not provided",
default="config.yaml", default="subscriptions.yaml",
) )
################################################################################################### ###################################################################################################
# DOWNLOAD PARSER # DOWNLOAD PARSER

View file

@ -60,6 +60,12 @@ def _download_subscription_from_cli(config: ConfigFile, extra_args: List[str]) -
def main(): def main():
"""Entrypoint for ytdl-subscribe""" """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() args, extra_args = parser.parse_known_args()
config: ConfigFile = ConfigFile.from_file_path(args.config) config: ConfigFile = ConfigFile.from_file_path(args.config)