Automatically downloading a file mp3 with a bash script



Linux systems give you many possibilities and one of them is good scheduling (cron), another is good scripting capabilities. I’ve done things with linux fairly easily that with Windows would have been next to impossible and required me to download several other things to make it happen. Anyway, I recently saw mention of a linux, bash scripted podcatching client. Basically you tell what podcasts you subscribe to and it downloads them on a schedule. It reminded me of a couple scripts I’ve got running that do similar things, but not from a true rss/podcast feed.


First up, I’ve mentioned before that I’ve been brushing up on my spanish the last couple of years. I’ve found shortwave news broadcasts to be helpful. One such is the Voice of America buenos dias America broadcast. Of course, many shortwave broadcasters make their shows available online. I found the place online where it’s updated each day and did a very simple script….

#!/bin/bash
date=`/bin/date +%m%d%y`
cd /home/userdirectory/mp3downloads/
/usr/bin/wget ftp://8475.ftp.storage.akadns.net/mp3/voa/latam/span/buenos.mp3 -O buenos_$date.mp3

It’s a simple wget, the file at their end changes each day, I get the date in a format I want and wen wget pulls the file down it saves it with the date so I can keep track of deleting old ones. Nice and simple.

I’ve done an almost identical script for radio Nederlands noticias… the only difference being a different web server for the wget. The only thing now to do is to set the script as executable and schedule it with cron (or kcron) for a daily download. One warning, there will be no size limitations, so you’ll have to clean up/archive old ones on your own. Some will not be as straightforward as the above. I have a couple for instance that use lynx to dump the source of a webpage and then grep for mp3 and then pipe through sed to get the address to the mp3 file, a bit tricky and site specific, but it works.

Related Posts

Blog Traffic Exchange Related Posts
  • The security of remote tech support (ultravnc sc or x11vnc with wrapper script) Well, I've got a nice way of doing "easy" one click (or one cut and paste) light desktop support for windows or linux, one uses ultravnc sc, the other uses x11vnc with a special wrapper script. So, what security flaws are there in this process? Well, for starters, I see......
  • Remote Tech Support using VNC (Ultravnc SC and x11vnc+wrapper script) Ok, some time back I'd done a writeup on UltraVNC SC, which is a nice customizable (windows version) VNC server that essentially let's someone doing remote support build their own downloadable .exe that runs and automatically tries to make a direct connection to a "listening" vnc viewer. It's good for......
  • Remote tech support with anything - would I do it? I've tried to ask myself if I'd trust someone enough to let them run a remote session on my own desktop to solve a problem. I think the answer is "it depends". If you think about it, I do tech support for home users quite a bit and they let......
Blog Traffic Exchange Related Websites
  • Encryption: Never Leave Home Without It As portable drives have gotten physically smaller and larger in storage capacity, they've become an indespensible gadget for many.  If you use yours to store vital and sensitive information, you need to secure that information with encryption.  I should not need to tell you about the long list of......
  • Ten Steps To Become a Linux/Unix Geek Until recently, Linux/Unix was considered OS of the geeks. However, with GUI and more desktop Linux distributions, things have simplified on both Linux and Unix. Still you can geek out with Unix/Linux using its terminal. Just follow the steps below to master the terminal. 1. Never used Linux! Get Ubuntu......
  • SEO Principles for WordPress Blogs WordPress is a relatively SEO friendly blogging tool to begin with. It offers a linking structure that makes it relatively easy for spiders to crawl your pages, and the code contains very little validation errors if any at all. However, there are a few additional steps that you can follow......
PDF24    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site