Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2024-12-28 14:54:25 +00:00
parent b21d4962c3
commit 81ad4aa209
4 changed files with 177 additions and 0 deletions

View File

@ -0,0 +1,74 @@
apiVersion: v1
data:
config.yaml: |
configuration:
working_directory: ".ytdl-sub-working-directory"
presets:
TV Shows:
preset:
- "Jellyfin TV Show by Date"
- "Max 1080p"
embed_thumbnail: True
throttle_protection:
sleep_per_download_s:
min: 2.2
max: 10.8
sleep_per_subscription_s:
min: 9.0
max: 14.1
max_downloads_per_subscription:
min: 10
max: 36
ytdl_options:
source_address: '0.0.0.0'
cookiefile: /config/cookies.txt
date_range:
after: "now-1year"
chapters:
# Embedded Chapter Fields
embed_chapters: True
allow_chapters_from_comments: False
remove_chapters_regex:
- "Intro"
- "Outro"
# Sponsorblock Fields
sponsorblock_categories:
- "outro"
- "selfpromo"
- "preview"
- "interaction"
- "sponsor"
- "music_offtopic"
- "intro"
remove_sponsorblock_categories: "sponsor"
TV Shows Fortnight:
preset:
- "TV Shows"
date_range:
after: "now-14days"
subscriptions.yaml: |
__preset__:
overrides:
tv_show_directory: "/youtube/tv_shows"
music_directory: "/youtube/tv_shows"
"TV Shows":
= Documentaries:
"Technogy Connections": "https://www.youtube.com/@TechnologyConnections"
"TV Shows Fortnight":
= Music:
"Rick Beato": "https://www.youtube.com/@RickBeato"
run_cron: |
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
echo 'Cron started, running ytdl-sub...'
cd /config/
ytdl-sub --config=config.yaml sub subscriptions.yaml
abc: |
0 */6 * * * /config/ytdl-sub-configs/run_cron
kind: ConfigMap
metadata:
creationTimestamp: null
name: ytdl-sub-config

View File

@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ytdl-sub
name: ytdl-sub
spec:
selector:
matchLabels:
app: ytdl-sub
strategy:
type: Recreate
template:
metadata:
labels:
app: ytdl-sub
spec:
containers:
- env:
- name: PUID
value: "1000"
- name: PGID
value: "1000"
- name: TZ
value: "Europe/Berlin"
- name: DOCKER_MODS
value: "linuxserver/mods:universal-cron"
image: ghcr.io/jmbannon/ytdl-sub:ubuntu-2024.12.27
imagePullPolicy: Always
name: ytdl-sub
ports:
- containerPort: 8443
name: http
protocol: TCP
volumeMounts:
- mountPath: /config
name: config
- mountPath: /youtube
name: youtube
initContainers:
- image: busybox
name: copy-config
command:
- /bin/sh
- -c
- "cp /config_src/config.yaml /config/;
cp /config_src/subscriptions.yaml /config/;
cp /secret/cookies.txt /config/;
mkdir /config/ytdl-sub-configs ;
cp /config_src/run_cron /config/ytdl-sub-configs/ ;
chmod +x /config/ytdl-sub-configs/run_cron ;
mkdir /config/crontabs ;
cp /config_src/abc /config/crontabs/ ;
chown -R 1000:1000 /config"
volumeMounts:
- mountPath: /config_src
name: config-src
- mountPath: /config
name: config
- mountPath: /secret
name: cookie
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
volumes:
- name: config
emptyDir: {}
- name: cookie
secret:
secretName: cookie-secret
- name: config-src
configMap:
name: ytdl-sub-config
- name: youtube
persistentVolumeClaim:
claimName: smb-youtube

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: smb-youtube
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: smb-youtube

View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
annotations:
external-dns.alpha.kubernetes.io/hostname: ytdl-sub.martyn.berlin
labels:
app: ytdl-sub
name: ytdl-sub
spec:
ports:
- targetPort: 8989
port: 80
selector:
app: ytdl-sub
type: LoadBalancer