melbahja / got

Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!
MIT License
722 stars 46 forks source link

Feature Suggestion: Get Filename from Header #22

Closed mpldr closed 4 years ago

mpldr commented 4 years ago

Sometimes the Webserver provides a filename, maybe it's a good idea to use this if none is provided. If there is none, the default behavior of parsing it from the URL is probably good enough.

mpldr commented 4 years ago

Example:

http://cds.audible.com/download?user_id=YTkqat54chg8HN0H1jfFnzibrmHG1VFFUD5K5hhtRFvNL3s9OM6pA7ooHfVSfg&cust_id=YTkqat52chg8HN0H1jfFnzibrmHG1VFFUD5K5hhtRFvNL3s9OM6pA7ooHfVSfg&product_id=BK_DAVE_001032DE&asin=&codec=LC_128_44100_Stereo&awtype=AAX&source=audible_adm&title=KriegundFrieden1&assemble_url=http://cds.audible.de/download&order_number=&size=&domain=www.audible.de&transfer_player=1&browser_type=

Fails to return the correct filename download and does not save it as "KriegundFrieden1_ep7_YTkqat52chg8HN0H1jfFnzibrmHG1VFFUD5K5hhtRFvNL3s9OM6pA7ooHfVSfg.aax" which is sent by the webserver.

melbahja commented 4 years ago

maybe I will added it to GetInfo func. considering cases like filename=../../etc/path.