From c337ca7b64a5c08f32efd25bf54135d26245482e Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 26 Jun 2021 19:20:12 +0200 Subject: [PATCH] using xml2 as parser instead of python lxml --- ripper | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ripper b/ripper index a0b0d47..719cfb4 100755 --- a/ripper +++ b/ripper @@ -67,15 +67,10 @@ for channel_id in $IDs; do fi fi if [ -n "$LEGACYMODE" ];then - curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=$channel_id" > /tmp/"${channel_id}.xml" - python -c "from lxml import etree -file=\"/tmp/${channel_id}.xml\" -root = etree.parse(file) -for el in root.iter(): - if(el.tag in '{http://www.youtube.com/xml/schemas/2015}videoId'): - print(el.text)" | - sed 's/^/https:\/\/www\.youtube\.com\/watch\?v=/' | grep -vf "$BLACKLIST" >> /tmp/todownload$$ - rm -f "/tmp/${channel_id}.xml" + curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=$channel_id" | + xml2 | grep '^/feed/entry/yt:videoId=' | + sed 's|^\/feed\/entry\/yt:videoId=|https:\/\/www\.youtube\.com\/watch\?v=|' | + grep -vf "$BLACKLIST" >> /tmp/todownload$$ else #Only try to download videos, not sheduled livestreams echo "$json" | jq '.items[] | select(.snippet.liveBroadcastContent != "upcoming") | .id.videoId' |