Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Download files from a list while (re)naming them at the same time
"wget -i" is perhaps the tool of choice to download files from a list, but it doesn't allow you to set custom file names for the individual files on the list file. So, if you want to download a bunch of podcast episodes, but would want each file to have a descriptive file name rather than "12345.mp3", it won't help you.
A simple alternative is to have a download list with the file URLS followed by the "-O" flag and desired file name, and read this file in a loop as arguments for an wget command:
Then:
while read url ; do wget -c $url ; done < url-list.txt
One could make a script that would take a file list without the "-O" flag and try to parse it correctly, but why bother, that's so much simpler.
A simple alternative is to have a download list with the file URLS followed by the "-O" flag and desired file name, and read this file in a loop as arguments for an wget command:
Code:
http://www.someurl.com/podcast/432432.mp3 -O 34-that-very-interesting-thing.mp3 http://www.someurl.com/podcast/565767665.mp3 -O 102-cool-podcast-episode.mp3 http://www.someurl.com/podcast/3323.mp3 -O 12-thats-the-twelvth-episode.mp3
while read url ; do wget -c $url ; done < url-list.txt
One could make a script that would take a file list without the "-O" flag and try to parse it correctly, but why bother, that's so much simpler.
Total Comments 3
Comments
-
why don't you use youtube-dlyoutube-dl, you can even program it to perform renaming according to its meta-data.
Posted 12-01-2015 at 05:23 AM by jheengut -
Quote:why don't you use youtube-dlyoutube-dl, you can even program it to perform renaming according to its meta-data.
Posted 12-01-2015 at 05:24 AM by jheengut -
Youtube-dl is specialized in certain "big" sites, and tries to guess some others as "generic". I think there's the risk that it won't always know how to give a meaningful file name, using something akin to a file "ID" or the actual remote file name, whatever it may be. Maybe the meta-data would be just "podcast 23123132" or whatever.
But it never occurred to me to try to use it for non-video multimedia sites, even though often I use it to download just the audio from youtube itself. Got to try it sometime. But I bet it would be more likely to work on sites such as soundcloud.com than something like im-this-random-guy-who-has-this-podcast.com.Posted 12-04-2015 at 12:40 AM by the dsc