download with menu
This commit is contained in:
@@ -45,7 +45,7 @@ logging.basicConfig(
|
|||||||
format=f"[%(asctime)s] [%(levelname)s] %(message)s",
|
format=f"[%(asctime)s] [%(levelname)s] %(message)s",
|
||||||
)
|
)
|
||||||
|
|
||||||
__VERSION__ = "20240411.0"
|
__VERSION__ = "20240928.0"
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_object(__name__)
|
app.config.from_object(__name__)
|
||||||
app.config.from_prefixed_env()
|
app.config.from_prefixed_env()
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ _help() {
|
|||||||
upload_token Get URL for uploads ( -d expiry )
|
upload_token Get URL for uploads ( -d expiry )
|
||||||
autocomplete Get Bash autocompletion script
|
autocomplete Get Bash autocompletion script
|
||||||
update Update self
|
update Update self
|
||||||
|
download Download using smenu
|
||||||
|
|
||||||
-d max days to keep (default 30)
|
-d max days to keep (default 30)
|
||||||
-m max downloads to keep (default 9999, -1 to disable)
|
-m max downloads to keep (default 9999, -1 to disable)
|
||||||
@@ -140,6 +141,14 @@ _maintain() {
|
|||||||
"$MFL_ROOTURL"/maintenance
|
"$MFL_ROOTURL"/maintenance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_download() {
|
||||||
|
choice=$( _simple_list | sed "s|^|$MFL_ROOTURL/d/|" | tac | \
|
||||||
|
smenu -t 1 -a c:2,bu i:8,b -n 25 -m "Download url" -W $'\n' \
|
||||||
|
)
|
||||||
|
if [[ -n "$choice" ]]; then
|
||||||
|
wget "$choice"
|
||||||
|
fi
|
||||||
|
}
|
||||||
_upload_token() {
|
_upload_token() {
|
||||||
token=$( curl -fL -s \
|
token=$( curl -fL -s \
|
||||||
-H "Expires-Days: $MAXDAYS" \
|
-H "Expires-Days: $MAXDAYS" \
|
||||||
@@ -233,6 +242,7 @@ fi
|
|||||||
[[ "$1" = "w" || "$1" = "write" ]] && { CMD=write; ARG1=$CMD; }
|
[[ "$1" = "w" || "$1" = "write" ]] && { CMD=write; ARG1=$CMD; }
|
||||||
[[ "$1" = "d" || "$1" = "delete" || "$1" = "del" ]] && { CMD=delete; ARG1=$CMD; }
|
[[ "$1" = "d" || "$1" = "delete" || "$1" = "del" ]] && { CMD=delete; ARG1=$CMD; }
|
||||||
[[ "$1" = "l" || "$1" = "list" ]] && { CMD=list; ARG1=$CMD; }
|
[[ "$1" = "l" || "$1" = "list" ]] && { CMD=list; ARG1=$CMD; }
|
||||||
|
[[ "$1" = "download" ]] && { CMD=download; ARG1=$CMD; }
|
||||||
[[ "$1" = "show" ]] && { CMD=details; ARG1=$CMD; }
|
[[ "$1" = "show" ]] && { CMD=details; ARG1=$CMD; }
|
||||||
[[ "$1" = "maintain" ]] && { CMD=maintain; }
|
[[ "$1" = "maintain" ]] && { CMD=maintain; }
|
||||||
[[ "$1" = "simplelist" ]] && { CMD=simple_list; ARG1=$CMD; }
|
[[ "$1" = "simplelist" ]] && { CMD=simple_list; ARG1=$CMD; }
|
||||||
@@ -279,4 +289,8 @@ fi
|
|||||||
_maintain
|
_maintain
|
||||||
exit $?
|
exit $?
|
||||||
}
|
}
|
||||||
|
[[ "$CMD" = download ]] && {
|
||||||
|
_download
|
||||||
|
exit $?
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user