Skip to content

Commit 97e61c3

Browse files
committed
Changes to volaupload.sh and stuff2vola.sh
- fix regression in volaupload.sh with error handling after receiving upload key - limit filename size to 200 characters so ext4 filesystem doesn't complain when it gets over 255 chars
1 parent 29667c5 commit 97e61c3

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Disclaimer
1010
`volaupload.sh` was originally made by [lain](https://github.com/laino) and Xiao. It seemed
1111
to be abandoned so I enhanced it with agrument parsing and some other features.
1212

13-
volaupload.sh ver. 3.2
13+
volaupload.sh ver. 3.3
1414
----------------------
1515

1616
This script allows you to upload files to [Volafile](https://volafile.org)
@@ -19,7 +19,7 @@ files with different names without a need to rename them beforehand.
1919
Use -h or --help command for full list of capabilities. Check [Configuration](#configuration)
2020
section below to learn how to preset your room, nick and password.
2121

22-
stuff2vola.sh ver. 2.6
22+
stuff2vola.sh ver. 2.7
2323
----------------------
2424

2525
Are you a fan of redundancy and don't want to post links to stuff in chat like a pleb?

install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
set -uo pipefail
55
IFS=$'\n\t'
66

7-
VOLAUPLOAD_SH_VER=(3 2)
8-
STUFF2VOLA_SH_VER=(2 6)
7+
VOLAUPLOAD_SH_VER=(3 3)
8+
STUFF2VOLA_SH_VER=(2 7)
99
VOLACRYPT_SH_VER=(1 3)
1010
PROWATCH_SH_VER=(1 2)
1111
CURLBAR_VER=(1 3)

stuff2vola.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck disable=SC2155,SC1117
33

44
# shellcheck disable=SC2034
5-
__STUFF2VOLASH_VERSION__=2.6
5+
__STUFF2VOLASH_VERSION__=2.7
66

77
if ! OPTS=$(getopt --options hr:n:p:u:a:f:d:ob \
88
--longoptions help,room:,nick:,pass:,room-pass:,upload-as:,force-server:,dir:,audio-only,best-quality \
@@ -263,7 +263,8 @@ postStuff() {
263263
filepath="$(urldecode "$dir/$(basename "$l")")"
264264
echo -e "\033[32m<\033[38;5;88m\\/\033[32m> Downloading from \033[1m$l\033[22m \033[33m"
265265
if [[ "$ftype" == "text/html" ]]; then
266-
title="$(youtube-dl --get-title "$l")"; title="$(head -c200 <(echo -e "$title" | tr -d "\"\r\n\t"))..."
266+
title="$(youtube-dl --get-title "$l")"
267+
title="$(head -c200 <(echo -e "$title" | tr -d "\"\r\n\t" | tr "/" " "))..."
267268
youtube-dlBar "-o" "$dir/$title.%(ext)s" "$args" "$l"
268269
else
269270
if [[ "$l" =~ ^.*volafile\.[net|org|io] ]]; then

volaupload.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck disable=SC2153,SC1117
33

44
# shellcheck disable=SC2034
5-
__VOLAUPLOADSH_VERSION__=3.2
5+
__VOLAUPLOADSH_VERSION__=3.3
66

77
if ! OPTS=$(getopt --options hr:cn:p:u:a:f:t:wmvb: \
88
--longoptions help,room:,call,nick:,pass:,room-pass:,upload-as:,force-server:,retries:,watch,most-new,vanned,server-blacklist \
@@ -307,7 +307,6 @@ doUpload() {
307307
[[ -z "$name" ]] && name="Volaphile"
308308
response=$(makeApiCall getUploadKey "name=$name&room=$room" "$room")
309309
fi
310-
[[ -n "$roompass" ]] && roompass="&password=$roompass"
311310
error="$?"; lerr="$(trim "$(cat "$LAST_ERROR")")"
312311
case "$error" in
313312
0 ) ;;
@@ -348,6 +347,7 @@ doUpload() {
348347
local key; key="&key=$(extract "$response" key)"
349348
local file_id; file_id=$(extract "$response" file_id)
350349
local up_str; local startAT; local mainfile="$file"
350+
[[ -n "$roompass" ]] && roompass="&password=$roompass"
351351
up_str="\033[32m<\033[38;5;22m/\\\\\033[32m> Uploading \033[1m$(basename "$file")\033[22m"
352352
up_str+=" to \033[1m$ROOM, $(echo "$server" | cut -f1 -d'.')\033[22m as \033[1m$name\033[22m\033[33m"
353353
server="https://$server"

0 commit comments

Comments
 (0)