Browse Source

Update upload scripts for ily.li

master
Alice Gaudon 12 months ago
parent
commit
90e6fbdca1
  1. 8
      flameshot_upload.sh
  2. 8
      flameshot_upload_latest.sh
  3. 18
      push_file.sh

8
flameshot_upload.sh

@ -8,13 +8,7 @@ file_name+=$base_name
flameshot gui -r > $file_name
sftp -oPort=4242 gaudonpr@ftp.gaudon.pro << EOT
cd public_html/push.arisu.fr/
put $file_name
EOT
url="https://push.arisu.fr/"
url+=$base_name
url=$(sh $(dirname $0)/push_file.sh $file_name)
echo $url | xclip -selection clipboard

8
flameshot_upload_latest.sh

@ -7,13 +7,7 @@ base_name=$latest_screenshot
file_name+=$base_name
sftp -oPort=4242 gaudonpr@ftp.gaudon.pro << EOT
cd public_html/push.arisu.fr/
put $file_name
EOT
url="https://push.arisu.fr/"
url+=$base_name
url=$(sh $(dirname $0)/push_file.sh $file_name)
echo $url | xclip -selection clipboard

18
push_file.sh

@ -0,0 +1,18 @@
#!/bin/sh
local_file=$1
token=$(cat $HOME/.ily_token)
if test -z "$2"; then
curl -X POST -H 'Accept: text/plain' \
-H "Authorization: $token" \
-F 'upload=@'$local_file \
-F 'ttl=2592000' \
https://ily.li/
else
curl -X PUT -H 'Accept: text/plain' \
-H "Authorization: $token" \
-F 'upload=@'$local_file \
-F 'ttl=2592000' \
"https://ily.li/$2"
fi
Loading…
Cancel
Save