Update upload_file.sh, add shrink_url.sh, rename twist-dl.node to twist-dl.sh
This commit is contained in:
parent
a12ae9248a
commit
d37658ab40
18
push_file.sh
18
push_file.sh
@ -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
shrink_url.sh
Executable file
17
shrink_url.sh
Executable 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"
|
18
upload_file.sh
Executable file
18
upload_file.sh
Executable 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…
Reference in New Issue
Block a user