Files
cnuktube/shells/get_comments_from_subscriptions
pance lalkov 73521d3cd5 Initial commit
2023-12-22 19:05:56 +01:00

35 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
escaped_1_temp=$(tr -dc '[:print:]\n' <<< "$1")
escaped_1=$(sed 's/;//g; s/|//g; s/\[//g; s/\]//g' <<< "$escaped_1_temp")
location="./rss/feeds/$escaped_1"
url=$(awk -F ' ' 'NR=='$2'{print $NF}' "$location")
title=$(./shells/yt_dlp_data/curl_get_fulltitle $url | tr -dc '[:print:]' | sed 's/\///g; s/;//g; s/|//g; s/\[//g; s/\]//g')
yt-dlp --skip-download --write-info-json -o ./temp_info/"$title" $url
yt-dlp --skip-download --write-thumbnail -o ./temp_info/"$title" $url
yt-dlp --skip-download --write-description -o ./temp_info/"$title" $url
file_name=$(ls ./temp_info/*"$title"*json)
new_text=$(awk '{print substr($0,length($0)-1200,1200)}' "$file_name")
echo "$new_text" > "$file_name"
sed -i 's/\"//g' "$file_name"
sed -i "s/,/\n/g" "$file_name"
file_name_new="./temp_info/$title.info"
grep "fulltitle:" "$file_name" | sed 's/fulltitle: //g' > "$file_name_new"
grep "uploader:" "$file_name" | sed 's/uploader: //g' >> "$file_name_new"
grep "channel_follower_count:" "$file_name" | sed 's/channel_follower_count: //g' >> "$file_name_new"
grep "uploader_url:" "$file_name" | sed 's/uploader_url: //g' >> "$file_name_new"
grep "upload_date:" "$file_name" | sed 's/upload_date: //g' >> "$file_name_new"
grep "duration_string:" "$file_name" | sed 's/duration_string: //g' >> "$file_name_new"
grep "is_live:" "$file_name" | sed 's/_/ /g' >> "$file_name_new"
grep "resolution:" "$file_name" | sed 's/resolution: //g' >> "$file_name_new"
echo "$url" >> "$file_name_new"
rm "$file_name"