diff --git a/.gitignore b/.gitignore index 34aac524..8c83760e 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,4 @@ dmypy.json .idea/ docker/*.whl +docker/root/*.whl diff --git a/Makefile b/Makefile index 0e3bd09e..f5ec2086 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ -build: - python setup.py bdist_wheel --dist-dir docker -docker: build - sudo docker build -t ytdl-sub:0.1 docker/ +wheel: + python setup.py bdist_wheel +docker: wheel + cp dist/*.whl docker/root/ + sudo docker build --no-cache -t ytdl-sub:0.1 docker/ -.PHONY: build +.PHONY: wheel docker diff --git a/docker/Dockerfile b/docker/Dockerfile index 8c863ac4..0eeae589 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,5 @@ FROM python:3.10.4-alpine3.15 -# Needed for py deps -RUN apk add gcc g++ make libffi-dev openssl-dev - -USER ${PUID}:${PGID} -COPY ytdl_sub-0.0.1-py3-none-any.whl . - -RUN ls -lh -RUN pip install ytdl_sub-0.0.1-py3-none-any.whl - ############################################################################### # S6 OVERLAY @@ -18,6 +9,39 @@ ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLA RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz + +############################################################################### +# YTDL-SUB INSTALL + +COPY root/ / +RUN apk update && apk add \ + gcc \ + g++ \ + make \ + libffi-dev \ + openssl-dev \ + vim \ + bash \ + shadow && \ + echo "**** create abc user and make our folders ****" && \ + groupmod -g 1000 users && \ + useradd -u 911 -U -d /config -s /bin/false abc && \ + usermod -G users abc && \ + mkdir -p /config && \ + pip install ytdl_sub-*.whl + +############################################################################### +# CONTAINER CONFIGS + +# Environment Variables +ENV EDITOR="nano" \ +HOME="/config" + + + +USER ${PUID}:${PGID} +VOLUME /config + ENTRYPOINT ["/init"] diff --git a/docker/root/config/config.yaml b/docker/root/config/config.yaml new file mode 100644 index 00000000..13823876 --- /dev/null +++ b/docker/root/config/config.yaml @@ -0,0 +1,80 @@ +configuration: + working_directory: '/tmp/ytdl-sub-downloads' + +# All example presets are included in this default config.yaml, +# feel free to change it as you see fit. +presets: + yt_music_video_playlist: + youtube: + download_strategy: "playlist" + ytdl_options: + ignoreerrors: True + output_options: + output_directory: "{music_video_directory}" + file_name: "{music_video_name}.{ext}" + thumbnail_name: "{music_video_name}.jpg" + maintain_download_archive: True + convert_thumbnail: + to: "jpg" + nfo_tags: + nfo_name: "{music_video_name}.nfo" + nfo_root: "musicvideo" + tags: + artist: "{artist}" + title: "{title}" + album: "Music Videos" + year: "{upload_year}" + overrides: + music_video_directory: "path/to/Music Videos" + music_video_name: "{sanitized_artist} - {sanitized_title}" + + yt_music_video: + preset: "yt_music_video_playlist" + youtube: + download_strategy: "video" + + yt_channel_as_tv: + youtube: + download_strategy: "channel" + channel_avatar_path: "poster.jpg" + channel_banner_path: "fanart.jpg" + ytdl_options: + ignoreerrors: True + output_options: + output_directory: "{youtube_tv_shows_directory}/{sanitized_tv_show_name}" + file_name: "{episode_name}.{ext}" + thumbnail_name: "{episode_name}.jpg" + maintain_download_archive: True + convert_thumbnail: + to: "jpg" + nfo_tags: + nfo_name: "{episode_name}.nfo" + nfo_root: "episodedetails" + tags: + title: "{title}" + season: "{upload_year}" + episode: "{upload_month}{upload_day_padded}" + plot: "{description}" + year: "{upload_year}" + aired: "{upload_date_standardized}" + output_directory_nfo_tags: + nfo_name: "tvshow.nfo" + nfo_root: "tvshow" + tags: + title: "{tv_show_name}" + overrides: + youtube_tv_shows_directory: "/path/to/youtube_tv_shows" + episode_name: "Season {upload_year}/s{upload_year}.e{upload_month_padded}{upload_day_padded} - {sanitized_title}" + + yt_channel_as_tv__recent: + preset: "yt_channel_as_tv" + youtube: + after: "today-2weeks" + ytdl_options: + break_on_reject: True + break_on_existing: True + + yt_channel_as_tv__only_recent: + preset: "yt_channel_as_tv__recent" + output_options: + keep_files_after: "today-2weeks" \ No newline at end of file diff --git a/docker/root/config/subscriptions.yaml b/docker/root/config/subscriptions.yaml new file mode 100644 index 00000000..54a6ad5e --- /dev/null +++ b/docker/root/config/subscriptions.yaml @@ -0,0 +1,13 @@ +#recent_channel_test: +# preset: "yt_channel" +# ytdl_options: +# break_on_reject: True +# youtube: +# channel_id: "UCsvn_Po0SmunchJYOWpOxMg" +# after: today-13days +# output_options: +# output_directory: "/tmp/dunkey" +# keep_files: +# after: today-3days +# overrides: +# tv_show_name: "Youtube: Dunkey" \ No newline at end of file