stck-lzm / badown

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

beautify #2

Open gorgone opened 4 years ago

gorgone commented 4 years ago

this is much cleaner

function mediafire {
<------>file_url=$(wget -q -O- $1 | grep  :\/\/download | awk -F'"' '{print $2}')
<------>file_down $file_url ${file_url##*/}
}
stck-lzm commented 4 years ago

Hello,

Thank you for taking time to open an issue, I did a small test with a file named 'test (01).zip'. Using this update, I download a file named : 'test+%2801%29.zip' With the old code, I download a file named : 'test (01).zip' You are completely right, the use of awk in this part of the code is a bit overkill and printf or maybe tr would have probably done the job. I might push for a simple solution later this week. to get file_name from file_url, one need to

gorgone commented 4 years ago

beautifully! i was looking for a bash download tool and yours was easy to modify for my simplebuild https://github.com/gorgone/s3_releases project in github.

i need this for my 1.5 gigabyte toolchains, which i want to try to host on mediafire and google drive. i also have a downloader for Googledrive the stupid thing is that I need 2 separate functions for small and large files.

Am Di., 3. Sept. 2019 um 16:04 Uhr schrieb stck-lzm < notifications@github.com>:

Hello,

Thank you for taking time to open an issue, I did a small test with a file named 'test (01).zip'. Using this update, I download a file named : 'test+%2801%29.zip' With the old code, I download a file named : 'test (01).zip' You are completely right, the use of awk in this part of the code is a bit overkill and printf or maybe tr would have probably done the job. I might push for a simple solution later this week. to get file_name from file_url, one need to

  • get the last part of the url (everything after the last /)
  • apply a function that do url-encode 2 ascii

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stck-lzm/badown/issues/2?email_source=notifications&email_token=AADOFKKXQ55MQACNJTCLVLLQHZVGBA5CNFSM4ISPYO62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5YJUGI#issuecomment-527473177, or mute the thread https://github.com/notifications/unsubscribe-auth/AADOFKKFJXWQMQZYTASYB3DQHZVGBANCNFSM4ISPYO6Q .