There is no need in scripting at all. All you had to do -- to read a wget
man page :)
wget -np -nd -c -A.m4a -r -k -erobots=off http://runawaypodcast.com/wp-content/uploads/2014/
For mass file rename there is a rename
tool ( check which one you have as it depends on your distro before you use it)
The full instruction how to handle this download. First download can be performed with:
wget -np -nd -c -A.m4a -r -k -erobots=off http://runawaypodcast.com/wp-content/uploads/2014/ \
-o download.log
now we have all download log in file. to form a blacklist for future download we need to build a file list from a log:
v_black_list=$(sed -n '/--.*m4a/s=.*/==p' download.log | tr '\n' ',')
and to run wget with this enabled black list, you have to use -R
option:
wget -np -nd -c -A.m4a -r -k -erobots=off http://runawaypodcast.com/wp-content/uploads/2014/ \
-a download.log -R$v_black_list
note, that in second run -a
is used instead of -o
to avoid logfile overwrite.