Update YoutubeSeriesDownloader.service
This commit is contained in:
parent
8eccf80e3a
commit
cc94e84838
1 changed files with 21 additions and 22 deletions
|
@ -1,10 +1,22 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.2"
|
scriptVersion="1.2"
|
||||||
ytdlpExtraOpts="--user-agent facebookexternalhit/1.1"
|
ytdlpExtraOpts="--user-agent facebookexternalhit/1.1"
|
||||||
|
scriptName="YoutubeSeriesDownloader"
|
||||||
|
|
||||||
#### Import Settings
|
#### Import Settings
|
||||||
source /config/extended.conf
|
source /config/extended.conf
|
||||||
|
|
||||||
|
log () {
|
||||||
|
m_time=`date "+%F %T"`
|
||||||
|
echo $m_time" :: $scriptName :: $scriptVersion :: "$1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$enableYoutubeSeriesDownloader" != "true" ]; then
|
||||||
|
log "Script is not enabled, enable by setting enableYoutubeSeriesDownloader to \"true\" by modifying the \"/config/extended.conf\" config file..."
|
||||||
|
log "Sleeping (infinity)"
|
||||||
|
sleep infinity
|
||||||
|
fi
|
||||||
|
|
||||||
getArrAppInfo () {
|
getArrAppInfo () {
|
||||||
# Get Arr App information
|
# Get Arr App information
|
||||||
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
|
||||||
|
@ -41,12 +53,6 @@ verifyApiAccess () {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
log () {
|
|
||||||
m_time=`date "+%F %T"`
|
|
||||||
echo $m_time" :: Youtube Series Downloader :: $scriptVersion :: "$1
|
|
||||||
}
|
|
||||||
|
|
||||||
# auto-clean up log file to reduce space usage
|
# auto-clean up log file to reduce space usage
|
||||||
if [ -f "/config/logs/YoutubeSeriesDownloader.txt" ]; then
|
if [ -f "/config/logs/YoutubeSeriesDownloader.txt" ]; then
|
||||||
find /config/logs -type f -name "YoutubeSeriesDownloader.txt" -size +1024k -delete
|
find /config/logs -type f -name "YoutubeSeriesDownloader.txt" -size +1024k -delete
|
||||||
|
@ -174,20 +180,13 @@ YoutubeSeriesDownloaderProcess () {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$enableYoutubeSeriesDownloader" == "true" ]; then
|
log "Starting Script...."
|
||||||
log "Starting Script...."
|
for (( ; ; )); do
|
||||||
for (( ; ; )); do
|
let i++
|
||||||
let i++
|
getArrAppInfo
|
||||||
getArrAppInfo
|
verifyApiAccess
|
||||||
verifyApiAccess
|
YoutubeSeriesDownloaderProcess
|
||||||
YoutubeSeriesDownloaderProcess
|
log "Script sleeping for 2 hours..."
|
||||||
log "Script sleeping for 2 hours..."
|
sleep 2h
|
||||||
sleep 2h
|
done
|
||||||
done
|
|
||||||
else
|
|
||||||
log "Script is not enabled, enable by setting enableYoutubeSeriesDownloader to \"true\" by modifying the \"/config/extended.conf\" config file..."
|
|
||||||
log "Sleeping (infinity)"
|
|
||||||
sleep infinity
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
Loading…
Reference in a new issue