summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaa <kaa@disroot.org>2025-07-30 22:06:31 -0700
committerkaa <kaa@disroot.org>2025-07-30 22:06:31 -0700
commit8a0a76d4170fc6ad75e49477dae706d797c2c2ac (patch)
tree25fce92e09c214871e4bf17d0959edd482dcaee6
parent6301279036db4efe914ca5078481e20417229b60 (diff)
check for downloaded without accessing yt
-rwxr-xr-xytpoll13
1 files changed, 10 insertions, 3 deletions
diff --git a/ytpoll b/ytpoll
index 6c7aa63..b299027 100755
--- a/ytpoll
+++ b/ytpoll
@@ -30,10 +30,17 @@ dl()
check()
{
- < $tmp jq -c '.entries[]' | head -$n | jq -c '.url, (.thumbnails | .[length - 1].url)' | paste - - | tr -d \" | while read -r video
+ # Get channel name
+ channel="$(< $tmp jq -c '.channel' | tr -d \")"
+ < $tmp jq -c '.entries[]' | head -$n | jq -c '(.url, .id)' | paste - - | tr -d \" | while read -r video
do
+ # check without accessing YT if video is downloaded
url=$(echo $video | sed -e 's| .*||')
- dl $url
+ id=$(echo $video | sed -e 's|.* ||')
+ if ! [ -f $out/$channel/*$id.webm ]
+ then
+ dl $url
+ fi
done
}
@@ -43,7 +50,7 @@ do
for channel in $channels
do
- index $channel
+ #index $channel
check
done