Compare commits
No commits in common. "master" and "b89e4090baf77546341df355150612a660b6b665" have entirely different histories.
master
...
b89e4090ba
17
Makefile
17
Makefile
@ -1,32 +1,23 @@
|
||||
export DOCKER_HOST := ssh://root@lstor1
|
||||
|
||||
.PHONY: default deploy build_image restart stop run logs
|
||||
|
||||
default: deploy
|
||||
|
||||
deploy:
|
||||
make build_image
|
||||
make stop
|
||||
make start
|
||||
default: build_image
|
||||
|
||||
build_image:
|
||||
docker build -t sneak/ytdlp .
|
||||
|
||||
restart:
|
||||
make stop
|
||||
make start
|
||||
|
||||
stop:
|
||||
-docker stop sneak-ytdlp
|
||||
-docker rm -f sneak-ytdlp
|
||||
|
||||
start:
|
||||
run: stop
|
||||
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
14
run.sh
@ -1,26 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
DEST="/output"
|
||||
INTERVAL="3600" #1h
|
||||
START_TIME="$(date +%s)"
|
||||
|
||||
INTERVAL="43200" #12h
|
||||
|
||||
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
|
||||
@ -35,7 +28,8 @@ function doDownload {
|
||||
for CHANNEL in $(listChannels); do
|
||||
echo "downloading $CHANNEL"
|
||||
HOME="$DEST" yt-dlp --config-location /etc/youtube-dl.conf $CHANNEL
|
||||
sleep 1
|
||||
echo "sleeping 10s"
|
||||
sleep 10
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,5 @@
|
||||
--download-archive "/output/archive.log"
|
||||
-i
|
||||
--restrict-filenames
|
||||
--mtime
|
||||
--write-info-json
|
||||
--write-comments
|
||||
--trim-filenames 250
|
||||
--add-metadata
|
||||
--all-subs
|
||||
--embed-subs
|
||||
|
Loading…
Reference in New Issue
Block a user