From 54362dcf4a6e8b74fe17356924802193fd0ab9ce Mon Sep 17 00:00:00 2001 From: Mid Favila Date: Sat, 16 Oct 2021 21:15:17 -0300 Subject: [PATCH] Remove accidental backup. --- invcli~ | 63 --------------------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100755 invcli~ diff --git a/invcli~ b/invcli~ deleted file mode 100755 index 386e18c..0000000 --- a/invcli~ +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -e - -search() -{ - rm -f /tmp/invidious_results - query_sanitized="$(printf "%s\n" "$1"|sed -e 's/ */%20/g')" - curl --output /tmp/invidious_results "https://vid.puffyan.us/search?q=$query_sanitized" -} -extract_names() -{ - sed -ne 's/

\(.*\)<\/p>/\1/p' /tmp/invidious_results|sed 's/ *//' -} - -extract_urls() -{ - for id in $(sed -ne 's/ */ /g' -e 's//\1/p' /tmp/invidious_results|sed -ne 's/ *//p') - do - printf "https://vid.puffyan.us%s\n" $id - done -} - -watch_vid() -{ - curl -v "https://vid.puffyan.us/latest_version?id=$id&itag=$itag" 2>>/dev/stdout|sed -ne 's/< Location: \(.*\)/\1/p' -} - -fetch_itag() -{ - curl --silent $1|sed -ne 's/.*"itag":"\([0-9][0-9]*\)".*/\1/p' -} - -fetch_id() -{ - curl --silent $(extract_urls|sed $chosen_video!d)|grep itag|sed -ne 's/.*"id":"\(.*\)","itag":.*/\1/p'|sed 1!d -} - -generate_locations() -{ - for itag in $(fetch_itag $(extract_urls|sed $chosen_video!d)|sed $chosen_video!d) - do - watch_vid - done -} - -main() -{ - printf "Enter your search terms: " - read -r query - search "$query" - extract_names|nl - printf "Choose the desired media: " - read -r chosen_video - printf "Attempting to retrieve primary source for: " - printf "\"%s\"" "$(extract_names|sed $chosen_video!d)" - printf "...\nPlease wait.\n\n" - itag=$(echo $(fetch_itag $(extract_urls|sed $chosen_video!d))|cut -f$chosen_video -d' ') - id=$(fetch_id) - media="$(generate_locations|sed 1!d)" - printf "Loading %s...\n" "$media" - ffplay "$media" -} - -main