some fixes and improvments

This commit is contained in:
localhost_frssoft 2022-04-14 18:42:47 +03:00
parent 3cdfdf4cf7
commit 828b5ac291

View file

@ -151,14 +151,14 @@ follow_api_export()
echo "$acc_following_count followings exported"
elif [ $count -lt 40 ]; then
countindex=$(expr $count - 1)
echo $followings | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/friends.csv
echo $followings | jj -l \#.acct | delq | legacy_addr_preprocess >> backups_$instance/friends.csv
offset=$(echo $followings | jj $countindex.id)
echo "+$count follows"
count=0
echo "$acc_following_count followings exported"
elif [ $count -gt 0 ]; then
countindex=$(expr $count - 1)
echo $followings | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/friends.csv
echo $followings | jj -l \#.acct | delq | legacy_addr_preprocess >> backups_$instance/friends.csv
offset=$(echo $followings | jj $countindex.id)
echo "+$count follows"
fi
@ -177,13 +177,13 @@ blocks_api_export()
echo "Blocks exported"
elif [ $count -lt 40 ]; then
countindex=$(expr $count - 1)
echo $blocks | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/blocks.csv
echo $blocks | jj -l \#.acct | delq | legacy_addr_preprocess >> backups_$instance/blocks.csv
offset=$(echo $blocks | jj $countindex.id)
echo "+$count blocks"
count=0
echo "Blocks exported"
elif [ $count -gt 0 ]; then
echo $blocks | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/blocks.csv
echo $blocks | jj -l \#.acct | delq | legacy_addr_preprocess >> backups_$instance/blocks.csv
offset=$(echo $blocks | jj $countindex.id)
echo "+$count blocks"
fi
@ -202,13 +202,13 @@ mutes_api_export()
echo "Mutes exported"
elif [ $count -lt 40 ]; then
countindex=$(expr $count - 1)
echo $mutes | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/mutes.csv
echo $mutes | jj -l \#.acct | delq | legacy_addr_preprocess >> backups_$instance/mutes.csv
offset=$(echo $mutes | jj $countindex.id)
echo "+$count mutes"
count=0
echo "Mutes exported"
elif [ $count -gt 0 ]; then
echo $mutes | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/mutes.csv
echo $mutes | jj -l \#.acct | delq| legacy_addr_preprocess >> backups_$instance/mutes.csv
offset=$(echo $mutes | jj $countindex.id)
echo "+$count mutes"
fi
@ -260,6 +260,21 @@ thread_api_statuses()
default_curl_opt "$instance_point/statuses/$1/context"
}
html_to_txt_render()
{
sed -e "s/<br[^>]*>/\n/g ; s/<p[^>]*>/\n/g ; s/<[^>]*>//g ; s/&gt;*/>/g ; s/&lt;*/</g ; s/&quot;/\"/g ; s/&#39;/'/g"
}
delq()
{
sed 's/"//g'
}
delqse()
{
sed 's/^"//g; s/"$//g'
}
thread_menu()
{
sub_menu_lvl=2
@ -288,10 +303,8 @@ thread_menu()
if [ -n "$reply_to_id" ]; then
echo "Reply to: $reply_to_id"
fi
echo $status | jj content | sed -e "s/<br[^>]*>/\n/g
; s/<p[^>]*>/\n/g ; s/<[^>]*>//g
; s/&gt;*/>/g ; s/&lt;*/</g ; s/&quot;/\"/g ; s/&#39;/'/g"
attachments=$(echo $status | jj -l media_attachments.#.remote_url | sed 's/"//g')
echo "$status" | jj -r content | delqse | html_to_txt_render
attachments=$(echo $status | jj -l media_attachments.#.remote_url | delq)
if [ -n "$attachments" ]; then
echo "#EXTINF:-1, $uri" >> attachments.m3u8
echo "$attachments" >> attachments.m3u8
@ -321,7 +334,7 @@ timeline_menu()
while [ $sub_menu_lvl -eq 1 ]; do
while [ $indexator -gt 0 ]; do
status=$(echo $json | jj $indexator)
status=$(echo "$json" | jj $indexator)
reblog=$(echo $status | jj reblog)
uri=$(echo $status | jj uri)
id_status=$(echo $status | jj id)
@ -334,9 +347,11 @@ timeline_menu()
if [ -n "$reblog" ]; then
echo "$boost_symbol"
fi
echo $status | jj content | sed -e "s/<br[^>]*>/\n/g
; s/<p[^>]*>/\n/g ; s/<[^>]*>//g
; s/&gt;*/>/g ; s/&lt;*/</g ; s/&quot;/\"/g ; s/&#39;/'/g"
spoiler_text=$(echo "$status" | jj spoiler_text)
if [ -n "$spoiler_text" ]; then
echo "#[$spoiler_text]"
fi
echo "$status" | jj -r content | delqse | html_to_txt_render
attachments=$(echo $status | jj -l media_attachments.#.remote_url | sed 's/"//g')
if [ -n "$attachments" ]; then
echo "#EXTINF:-1, $uri" >> attachments.m3u8