latest
This commit is contained in:
parent
b89e4090ba
commit
e801932783
7
Makefile
7
Makefile
|
@ -1,6 +1,11 @@
|
||||||
export DOCKER_HOST := ssh://root@lstor1
|
export DOCKER_HOST := ssh://root@lstor1
|
||||||
|
|
||||||
default: build_image
|
default: deploy
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
make build_image
|
||||||
|
make stop
|
||||||
|
make run
|
||||||
|
|
||||||
build_image:
|
build_image:
|
||||||
docker build -t sneak/ytdlp .
|
docker build -t sneak/ytdlp .
|
||||||
|
|
11
run.sh
11
run.sh
|
@ -1,14 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEST="/output"
|
DEST="/output"
|
||||||
|
INTERVAL="3600" #1h
|
||||||
INTERVAL="43200" #12h
|
START_TIME="$(date +%s)"
|
||||||
|
|
||||||
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
|
||||||
|
@ -28,8 +32,7 @@ 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
|
||||||
echo "sleeping 10s"
|
sleep 1
|
||||||
sleep 10
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue