Weblisten MP3Client
If you have an account with http://www.weblisten.com than you migth be interessted in the mp3client I wrote. It automates the download of your MP3 files. It is written in java. Altough it has been tested only under Win 2000, it should also run with linux (any Plattform supporting Java), you will have to write a own starting script, but that should be pretty straightforward. The program has been developed it with Java 1.4.2.
Download the zip File from the sourceforge project page http://sourceforge.net/projects/mp3client and extract it on your machine.
Edit the run.bat file:
set JAVA_HOME=<YOUR JAVA INSTALL PATH>
set CLASSPATH=%JAVA_HOME%\lib\rt.jar
set CLASSPATH=%CLASSPATH%;.\lib\commons-cli-1.0.jar
set CLASSPATH=%CLASSPATH%;.\lib\commons-codec-1.2.jar
set CLASSPATH=%CLASSPATH%;.\lib\commons-httpclient-3.0-alpha1.jar
set CLASSPATH=%CLASSPATH%;.\lib\commons-lnag-2.0.jar
set CLASSPATH=%CLASSPATH%;.\lib\commons-logging-api.jar
set CLASSPATH=%CLASSPATH%;.\lib\log4j-1.2.8.jar
set CLASSPATH=%CLASSPATH%;.\lib\mp3client.jar
set USER_ID=<YOUR USERID>
set PWD=<YOUR PASSWORD>
set LOG_FILE=<YOUR LOGFILE>
set DEST_DIR=<YOUR PATH TO SAVE THE DOWNLOADS>
%JAVA_HOME%\bin\java -Xms64m -Xmx128m net.jatec.weblisten.MP3Client -userId %USER_ID% -pwd %PWD% -logFile %LOG_FILE% -destDir %DEST_DIR%
replace the <...> fields with your values:
- <YOUR JAVA INSTALL PATH>
- Directory under which you have installed java.
Hint: if you can run in a commandshell java -version
sucessfully, you can delete the first line and change %JAVA_HOME%\bin\java
in the last line to java
- <YOUR USERID>
- Userid for www.weblistn.com. It is the email address you entered while registering [required]
- <YOUR PASSWORD>
- password to your www.weblisten.com account [required]
- <YOUR LOGFILE>
- name of the file where the programm should log. defualt is client.log and the programm does alternate between client.lag and client.log.1 [not required]
- <YOUR PATH TO SAVE THE DOWNLOADS>
- defines where to save the downloaded mp3 files [required]
Start it by running run.bat.
what does it do ??
- it connects to www.weblisten.com and logs in wit your userid and password
- it goes than to your download page: the link
- it anaylses the page:
- tries to figure out how many pages you have in total
- tries to recognize all track listed on the actual download page
- than the program iterates over the found tracks, and
- tries to connect to the track's details site and to retrieve the album name
- checks whether the track is localy (value of DEST_DIR) already available
- if not asks www.weblisten.com for the track and downloads them under DEST_DIR/<artist>/<album>/<track>
- after all tracks for the actual download page are handled, it starts actually at the first step, login, it looks for the next download page (if you have more than 1), and repeats the described process foer each download page
- after all download pages were processed, the program will go to sleep:
- for 4 hours, if the number of total download pages did not changed
- if the total number did changed while processing the downloadpages (1-x), it will sleep 30 minutes
- and everything starts over and over again :-)
why
downloading all the files manually is not an option. if you have an account with weblisten and have selected a few albums to download, you know what I mean. Weblisten offers a free download manager, but this software unfortunately was not taking album name into account when saving the files: all tracks of 2 albums from the same artist would end up in the same folder, and I had the feeling the program loses the session after a while. I couldn't contribute to that software, as I have no knowledge in the language it was written. I have to thank his developer for answering all my emails and giving me the basic idea and inspiration.
So finally I decided to write my own dowload manager in java.
my experiences
I have downloaded several hundred songs sucessfully (700 hundred songs with 10 failures). there are some minor problems:
- some album, artist and track names contain characters, which are not valid for directory and/or file names. I'm replacing most of them, still I might be missing some, please report to me when you have a
...FileNotFoundException
- once the programm did crashed when downloading one specific album with an OutOfMemoryError. I found out it had tracks of about 15 min => 20 MB. Files are downloaded to the memory first and then written to the filesystem. And I do process up to 4 tracks in parallel => the memory usage was to big, as the java virtual machine has per default only 64 MB memory available.
I changed the maximum memory size to 128 MB and had no problem since than.
- your tracks are getting expired after 3 days. weblisten has somehow a problem to remove those items from the list. my program do realize if items are expired, but will still it has to checkeach single track to figure out.