summaryrefslogtreecommitdiffstats
path: root/skripti/365_prenesi_omejene_vsebine.sh
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-03-31 14:38:27 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-03-31 14:38:27 +0200
commit004c9fb14fefa1eb57c31990392de2b34a7a2100 (patch)
tree2c410142758b4605c88b812a85f08f6b77f5abd1 /skripti/365_prenesi_omejene_vsebine.sh
parentdn04b lažje berljiv (diff)
downloadr-004c9fb14fefa1eb57c31990392de2b34a7a2100.tar
r-004c9fb14fefa1eb57c31990392de2b34a7a2100.tar.gz
r-004c9fb14fefa1eb57c31990392de2b34a7a2100.tar.bz2
r-004c9fb14fefa1eb57c31990392de2b34a7a2100.tar.lz
r-004c9fb14fefa1eb57c31990392de2b34a7a2100.tar.xz
r-004c9fb14fefa1eb57c31990392de2b34a7a2100.tar.zst
r-004c9fb14fefa1eb57c31990392de2b34a7a2100.zip
Diffstat (limited to '')
-rwxr-xr-xskripti/365_prenesi_omejene_vsebine.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/skripti/365_prenesi_omejene_vsebine.sh b/skripti/365_prenesi_omejene_vsebine.sh
index bdc003c..f9a8c69 100755
--- a/skripti/365_prenesi_omejene_vsebine.sh
+++ b/skripti/365_prenesi_omejene_vsebine.sh
@@ -7,6 +7,11 @@
set -euo pipefail
page=`curl --fail-with-body https://365.rtvslo.si/oddaja/dnevnik/92` # outputa preveč shita za set -x
set -x
+for id in `find -type f -size 7931523c | sed -E 's/^.*\[([0-9]*)\].*$/\1/g'` # repair broken downloads (pravice potekle)
+do
+ yt-dlp --no-continue http://365.rtvslo.si/arhiv/oddaja/$id
+done
+rm -f Error\ \[*\].mp4
dnevnik_id=`grep href=./arhiv/dnevnik <<<"$page" | cut -d\" -f2 | cut -d/ -f4 | head -n1`
client_id=`grep client-id <<<"$page" | cut -d\" -f2 | head -n1`
if [ ! -f zadnji ]
@@ -18,15 +23,15 @@ while :
do
id_oddaje=$(($id_oddaje+1))
api_response=`curl --fail-with-body https://api.rtvslo.si/ava/getRecordingDrm/$id_oddaje?client_id=$client_id`
- if [ "`jq --raw-output .response.title <<<$api_response`" = Error ]
+ if [ "`jq --raw-output .response.title <<<$api_response`" = Error ] && [ $dnevnik_id -lt $id_oddaje ]
then
break
fi
- if [ "`jq --raw-output .response.expirationDate <<<$api_response`" = "3001-01-01 00:00:00" ]
+ if [ "`jq --raw-output .response.expirationDate <<<$api_response | head -c1`" = "3" ]
then
continue
fi
- echo $api_response > $id_oddaje.json
- yt-dlp http://365.rtvslo.si/arhiv/oddaja/$id_oddaje
+ # echo $api_response > $id_oddaje.json
+ yt-dlp http://365.rtvslo.si/arhiv/oddaja/$id_oddaje || :
echo $id_oddaje > zadnji
done