Compare commits
No commits in common. "master" and "sneak/run-continuously" have entirely different histories.
master
...
sneak/run-
17
Makefile
17
Makefile
@ -1,32 +1,23 @@
|
|||||||
export DOCKER_HOST := ssh://root@lstor1
|
export DOCKER_HOST := ssh://root@lstor1
|
||||||
|
|
||||||
.PHONY: default deploy build_image restart stop run logs
|
default: build_image
|
||||||
|
|
||||||
default: deploy
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
make build_image
|
|
||||||
make stop
|
|
||||||
make start
|
|
||||||
|
|
||||||
build_image:
|
build_image:
|
||||||
docker build -t sneak/ytdlp .
|
docker build -t sneak/ytdlp .
|
||||||
|
|
||||||
restart:
|
|
||||||
make stop
|
|
||||||
make start
|
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
-docker stop sneak-ytdlp
|
-docker stop sneak-ytdlp
|
||||||
-docker rm -f sneak-ytdlp
|
-docker rm -f sneak-ytdlp
|
||||||
|
|
||||||
start:
|
run: stop
|
||||||
docker run \
|
docker run \
|
||||||
-d \
|
-d \
|
||||||
--name sneak-ytdlp \
|
--name sneak-ytdlp \
|
||||||
-v /srv/lstor1/warez/youtube:/output \
|
-v /srv/lstor1/warez/youtube:/output \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
sneak/ytdlp
|
sneak/ytdlp
|
||||||
|
make logs
|
||||||
|
|
||||||
logs:
|
logs:
|
||||||
docker logs -f sneak-ytdlp
|
docker logs -f sneak-ytdlp
|
||||||
|
|
||||||
|
14
run.sh
14
run.sh
@ -1,26 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEST="/output"
|
DEST="/output"
|
||||||
INTERVAL="3600" #1h
|
|
||||||
START_TIME="$(date +%s)"
|
INTERVAL="43200" #12h
|
||||||
|
|
||||||
function listChannels {
|
function listChannels {
|
||||||
SRC="/etc/videolist.txt"
|
SRC="/etc/videolist.txt"
|
||||||
grep -Ev "^#|^$" "$SRC" | sed 's/#.*$//'
|
grep -Ev "^#|^$" "$SRC" | sed 's/#.*$//'
|
||||||
}
|
}
|
||||||
|
|
||||||
function timeRunning {
|
|
||||||
expr $(date +%s) - $START_TIME
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
function main {
|
||||||
init
|
init
|
||||||
curl https://ipinfo.io
|
curl https://ipinfo.io
|
||||||
while true ; do
|
while true ; do
|
||||||
doDownload
|
doDownload
|
||||||
echo "finished."
|
|
||||||
echo "cleaning up"
|
|
||||||
find "$DEST" -type f -iname '*.temp.*' -print -delete
|
|
||||||
echo "sleeping $INTERVAL"
|
echo "sleeping $INTERVAL"
|
||||||
sleep $INTERVAL
|
sleep $INTERVAL
|
||||||
done
|
done
|
||||||
@ -35,7 +28,8 @@ function doDownload {
|
|||||||
for CHANNEL in $(listChannels); do
|
for CHANNEL in $(listChannels); do
|
||||||
echo "downloading $CHANNEL"
|
echo "downloading $CHANNEL"
|
||||||
HOME="$DEST" yt-dlp --config-location /etc/youtube-dl.conf $CHANNEL
|
HOME="$DEST" yt-dlp --config-location /etc/youtube-dl.conf $CHANNEL
|
||||||
sleep 1
|
echo "sleeping 10s"
|
||||||
|
sleep 10
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
--download-archive "/output/archive.log"
|
--download-archive "/output/archive.log"
|
||||||
-i
|
-i
|
||||||
--restrict-filenames
|
|
||||||
--mtime
|
|
||||||
--write-info-json
|
|
||||||
--write-comments
|
|
||||||
--trim-filenames 250
|
|
||||||
--add-metadata
|
--add-metadata
|
||||||
--all-subs
|
--all-subs
|
||||||
--embed-subs
|
--embed-subs
|
||||||
|
Loading…
Reference in New Issue
Block a user