Browse Source

Update upload_file.sh, add shrink_url.sh, rename twist-dl.node to twist-dl.sh

master
Alice Gaudon 6 months ago
parent
commit
d37658ab40
4 changed files with 35 additions and 18 deletions
  1. +0
    -18
      push_file.sh
  2. +17
    -0
      shrink_url.sh
  3. +0
    -0
      twist-dl.sh
  4. +18
    -0
      upload_file.sh

+ 0
- 18
push_file.sh View File

@ -1,18 +0,0 @@
#!/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

+ 17
- 0
shrink_url.sh View File

@ -0,0 +1,17 @@
#!/bin/sh
target_url=$1
slug=$2
token=$(cat "$HOME/.ily_token")
if test -z "$slug"; then
method=POST
else
method=PUT
fi
curl -X $method -H 'Accept: text/plain' \
-H "Authorization: $token" \
-F 'type=url' \
-F "target_url=$target_url" \
"https://ily.li/$slug"

twist-dl.node → twist-dl.sh View File


+ 18
- 0
upload_file.sh View File

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

Loading…
Cancel
Save