Code: Select all
wget --trust-server-name http://electro-music.com/forum/download.php?id=28985
Code: Select all
wget --trust-server-name http://electro-music.com/forum/download.php?id=28985
Code: Select all
wget --trust-server-name http://electro-music.com/forum/download.php?id=28985 2>&1 | grep -o -E "»».+««" | tr -d '»«'Code: Select all
$ wget --trust-server-names=on -o log \
http://electro-music.com/forum/download.php?id=28985 && \
awk -F"'" '/saved/{print $2}' logaudiodef ... in which case both Quincy and my suggestions are off target as both will wget the file. To provide the filename, without downloading the file, '--spider' should be used.audiodef wrote:I only need to get the filename.
Well, the following will print the filename to stdout, stdout can then be redirected to a file if need be.audiodef wrote:I like what Quincy did - it outputs the filename, and I like khayyam's code that puts it in a file. I tried adding > downloaded_file to Quincy's code, but > doesn't seem to work with wget. What's the best way to do that?
Code: Select all
$ wget --trust-server-names=on --spider -o log \
http://electro-music.com/forum/download.php?id=28985 && \
awk -F"/" '/Location/{print substr($NF, 1, length($NF) - 12)}' logCode: Select all
wget -nv --trust-server-namehttp://electro-music.com/forum/download.php?id=28985 2>&1 | grep -o -E "\".+\"" | tr -d '"' > downloaded_file