stck-lzm / badown

badown (bash-downloader for mediafire, zippyshare & mega)
GNU General Public License v3.0
60 stars 15 forks source link

Hey I get this error when I try to download #7

Closed jelliedpizza closed 3 years ago

jelliedpizza commented 3 years ago

awk: line 1: regular expression compile failed (missing operand)

jelliedpizza commented 3 years ago

I found the issue but I didn't really delve into it too deep. I have a different version of awk (there are 3 for some reason), and in my version, the old one, regexp characters have to be escaped with a backslash. So

file_name=$(printf '%b' "$(echo $file_url \
      | awk -F'/' '{gsub("%","\\x");gsub("+"," ");print $NF}')")
                                          ^

should be

file_name=$(printf '%b' "$(echo $file_url \
      | awk -F'/' '{gsub("%","\\x");gsub("\+"," ");print $NF}')")
                                          ^