From c0ae248e62704a9bd465a656a48b9a3aab903099 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 26 Jun 2021 20:35:43 +0200 Subject: [PATCH] added peertube support --- README.md | 9 +++++++-- ripper | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3a4dab..f130938 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,21 @@ # ripper -Checks YT Channels and Bitchute channels for new videos and downloads them quickly +Checks YouTube, Bitchute, and Peertube channels for new videos and downloads them quickly. This is considerably faster than giving `youtube-dl` the channel URIs directly. +## YouTube This script can use the YouTube Data API v3 if available, but has a fallback if either: - no API Key is given - the Data quota for the day has been exceeded +## Bitchute Bitchute can also be used with this script. This part of the script is quite generic and could easily be adjusted for other websites. +## Peertube +Peertube instances require the channel RSS feed URL to work. + + See the documentation inside the `ripper` file for more information. ## Install @@ -22,4 +28,3 @@ After `git clone`ing this repo, run the helper `installer` ## Features to come - Odysee support -- Peertube support -> could just be done via RSS feeds diff --git a/ripper b/ripper index 3c39553..dfd68f8 100755 --- a/ripper +++ b/ripper @@ -105,6 +105,20 @@ for channel in $BC_CHANNELS; do done grep 'bitchute' "$DLARCHIVE" | sed 's/bitchute /https:\/\/www\.bitchute\.com\/video\//' >> /tmp/alreadydownloaded$$ +##PEERTUBE +echo "Scanning Peertube instances..." +PT_CHANNELS="$(grep -Ev '(bichute|youtube)' $CHANNELSFILE | grep -v '^#')" +for channel in $PT_CHANNELS; do + printf 'PT channel: %s\n' "$channel" + channelxml="$(curl -s "$channel")" + todownload="$(echo "$channelxml" | xml2 | grep '^/rss/channel/item/link=' | sed 's|^/rss/channel/item/link=||' | sort -u | grep -vf "$BLACKLIST" | tee -ai /tmp/todownload$$)" + #might not be always correct for all peertube instances? + channelinstance="$(echo "$channelxml" | xml2 | grep '^/rss/channel/link=' | sed 's|^/rss/channel/link=||')" + #creates fake video links for other instances but shouldn't be an issue + grep -E 'peertube' "$DLARCHIVE" | sed "s|peertube |$channelinstance/videos/watch/|" | grep "$todownload" >> /tmp/alreadydownloaded$$ +done + + ##DOWNLOAD VIDEOS FROM ACCUMULATED LINKS grep -vf /tmp/alreadydownloaded$$ /tmp/todownload$$ | sort -u > /tmp/new_videos$$ rm -f /tmp/alreadydownloaded$$ /tmp/todownload$$ @@ -121,6 +135,7 @@ if [ "$number" -gt 0 ]; then notify-send "Channel Ripper" "Finished downloading" fi + if [ "$number" -eq 0 ]; then echo "No new videos" fi