Compare commits

...

2 Commits

Author SHA1 Message Date
Jeffrey Paul 86197a5a41 latest. fixes filenames 2022-11-08 18:57:25 -08:00
Jeffrey Paul e801932783 latest 2022-11-02 08:38:49 -07:00
3 changed files with 28 additions and 8 deletions

View File

@ -1,23 +1,32 @@
export DOCKER_HOST := ssh://root@lstor1
default: build_image
.PHONY: default deploy build_image restart stop run logs
default: deploy
deploy:
make build_image
make stop
make start
build_image:
docker build -t sneak/ytdlp .
restart:
make stop
make start
stop:
-docker stop sneak-ytdlp
-docker rm -f sneak-ytdlp
run: stop
start:
docker run \
-d \
--name sneak-ytdlp \
-v /srv/lstor1/warez/youtube:/output \
--restart unless-stopped \
sneak/ytdlp
make logs
logs:
docker logs -f sneak-ytdlp

14
run.sh
View File

@ -1,19 +1,26 @@
#!/bin/bash
DEST="/output"
INTERVAL="43200" #12h
INTERVAL="3600" #1h
START_TIME="$(date +%s)"
function listChannels {
SRC="/etc/videolist.txt"
grep -Ev "^#|^$" "$SRC" | sed 's/#.*$//'
}
function timeRunning {
expr $(date +%s) - $START_TIME
}
function main {
init
curl https://ipinfo.io
while true ; do
doDownload
echo "finished."
echo "cleaning up"
find "$DEST" -type f -iname '*.temp.*' -print -delete
echo "sleeping $INTERVAL"
sleep $INTERVAL
done
@ -28,8 +35,7 @@ function doDownload {
for CHANNEL in $(listChannels); do
echo "downloading $CHANNEL"
HOME="$DEST" yt-dlp --config-location /etc/youtube-dl.conf $CHANNEL
echo "sleeping 10s"
sleep 10
sleep 1
done
}

View File

@ -1,5 +1,10 @@
--download-archive "/output/archive.log"
-i
--restrict-filenames
--mtime
--write-info-json
--write-comments
--trim-filenames 250
--add-metadata
--all-subs
--embed-subs