From 004c9fb14fefa1eb57c31990392de2b34a7a2100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 31 Mar 2024 14:38:27 +0200 Subject: 365-error-fix --- skripti/365_prenesi_omejene_vsebine.sh | 13 +++++++++---- 1 file 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 -- cgit v1.2.3