Java HypeMachine Batch Downloader

UPDATE – May 24 2011: I had fixed a few issues with the batch downloader such as having it download to the proper directory and made it a bit more easier to use.

It’s Been A While

For starters, I’ve officially graduated from the University of Waterloo’s Software Engineering program. Yay! However what has seem an eternity ago (~2 months) I haven’t touched my computer in any way resembling programming. Just recently, the evil geniuses wonderful guys at HypeMachine decided to break my sweet Chrome Extension. Before tackling the task of trying to now fix it, I thought I’d start off small and re-acquaint myself with some easy programming. For some reason, I chose Java….

I’m not sure why I chose Java

In all honesty, I haven’t programmed in Java since first/second year at UW. However, I figured what the hell and tried to write a GUI for my Python Batch Downloader Script which I get e-mails regarding constantly. I always seem to get stuck on the design aspect of any programming which is frustrating. Whereas the means to download and scrape the information is quick and easy, I am finding the ability to make a flawless User Interface and perhaps have it run super smooth with ThreadPools a bit more aggravating.
Anyways, I think I’ve toyed enough with it to release a 0.1Alpha. Here it is if people want to play around with it and let me know how I’ve mucked up.


Things I already Know I’d Like To Fix

  1. When a song is downloaded, the item in the list doesn’t cause an invalidate (so that it shows as green)
  2. Persistance, so that when you relaunch the application it will show songs previously downloaded
  3. A nicer way to navigate to Popular, latest, users etc.. (perhaps even with a login?)
  4. When multiple downloads are started, have a new window appear with a bunch of progress bars
  5. The ability to play/stream the music directly through the application so you can test which songs you’d like to download
  6. The ability to <3 songs

Let me know if anyone would like it on GitHub as well.

Anyone up for the challenge?

Forgotten README

I didn’t really include a manual so here is a quick one.

~Welcome to my slapped together HypeMachine Batch Downloader Application~

1. Choosing the location to download from:
You can change the URL in the top right text field. Simply change ‘popular’ to things such as ‘latest’ or even any username!

2. Choosing where to save the MP3 files.
The button to the top right lets you chose the save location. By default it’s where the application has launched from.

3. The 'More' button scrapes additional songs! (Thinking of just having it notice when you scroll to the end instead)

4. The 'Refresh' button restarts the page number 1 and refreshes the song listing.

5. The 'Download' button downloads. Simple!

34 Replies to “Java HypeMachine Batch Downloader”

  1. I didn’t really include a manual so here is a quick one:
    1 – You can change the url in the top right. Just change ‘popular’ to things such as ‘latest’ or even any username!
    2- The button to the top right lets you chose the save location. By default it’s where the application has launched from.
    3- More scrapes more songs!
    4- Refresh, restarts the page number 1 and refreshes.
    5- Download, downloads. Simple!

  2. Hi,

    Fantastic work on the downloader – it all works just fine – apart from one thing…

    Does the green song title mean the song(s) have downloaded? The ones that remain black in the list have not downloaded, and don’t seem to download at all..

    Should I just leave it on over night and see what happens? Or is this a bug.. I’m downloading 350 songs from my Hypem.


  3. @Drew: Hey Drew,

    A green song title means the song(s) have been ownloaded and the ones that remain black mean they haven’t.

    I wrote this application not with the use case in mind that someone would be downloading in bulk 350 songs so that it might actually crash if you do because I think I made each download it’s own thread asynchronously.

    If that’s the use case, I might put it on one thread now instead…. interesting…

  4. Hi Farid,
    I agree with Drew. I’m trying to download quite a few song and though it’s not crashing the program, it only was able to get through about half and it gave up on the others. I am able to go back and select the ones that weren’t download it an do it again, but like you said it would be nice to have it queued in some way. I definitely agree some sort of progress indicator would be nice! I think the biggest use case would be to do a batch download of your entire favorites library. Maybe there’s a button that can just queue up all the songs from favorite list instead of having to press “more” a bunch of times.

    Most needed bug fixes:
    1. Fix apostrophes to display without “”
    2. The ID3 tag should include artist. Right now it only has song name. Or even the file itself could have artist name.

    It’d love to check out the code if you put it on GitHub. My user name is neufuture there. Awesome work, btw.

  5. @Michael Zick Doherty:

    Yea it was an error in how I programmed it.. for some reason I put each song it’s own thread rather than have all the songs download together just on a seperate thread. I’ll work on it this week (haven’t looked at it recently) and put the new code as well on GitHub.

    I have a batch python script for doing more of the ‘download all’ type of songs if you want.
    I envisioned this for more selectively choosing songs.

  6. Hi Farid,

    first off, great work on this program. i deeply admire your work 🙂

    ive downloaded the java downloader but i seem to be having an issue of downloading only the links to the song, and not the actual mp3 file itself. i saw there was a problem immediately b/c it took only 1 second to “download” each song, and i realized that each file was only “526 bytes.” do you have a solution to this problem? it was the same issue with the chrome extension with only the links to the song being downloaded.

    i’d greatly appreciate any feedback.


  7. Thank you. Hype machine has connected me to more music other than the crap on the radio. Taking the new stuff with me a listening to it on long bike ride has been awesome. Your work is appreciated.

  8. Farid,

    Awesome work! There are several songs that would immediately “cancel” itself after i click download. There is also another set of songs that will download and finish right after with 1kb. I’ve tried exiting the program and restarting several times and it doesn’t seem to fix it. It does the job for most of my other songs so I’m still really grateful 🙂 Looking forward to your future work 🙂

  9. @Eric:
    Yea that would make sense Eric.
    I kind of wrote the app very quickly (under an hour) so i didn’t really validate it 100%.
    Errors such as the one you’re describing make sense since I wasn’t really checking for special characters like that…

    It’s on my list of things TODO to go back and revise the software, but in the meantime you can use the chrome extension of my python script should also work well 🙂

    Thanks for the nice words.

  10. @Farid:

    This is really well written for something under an hour. Will look into the chrome extension and looking forward to your future work! 😀

  11. Hey Farid!

    I know its been a while since you’ve worked on this and I’m sure you’ve moved on to bigger and brighter things. But this batch downloader has been the single best tool I have for getting music than torrents, direct downloads, or even buying cds! You’ve made an amazing piece of software here but it has recently stopped working. I understand if you’re too busy to look at this right now but myself and many other music lovers like me rely on your batch downloader to cure our blues! Hopefully you can fix it soon.

    Thanks for being you!

  12. @sophia:
    I’m on it lol.
    The script works at least.
    I just have to reset up the environment…

    Just been busy because I’ve accepted a new job in Seattle and currently planning my move.
    I haven’t forgotten you 😉

    1. Hey Rob,

      I just moved to Seattle (starting a new job at Amazon) and still waiting for my furniture (including desktop to come!).

      As soon as they arrive I promise to rework this.
      In the mean time you can check out the script or extension 🙂

      Thanks for the kind words! 🙂

  13. Hey Farid,

    haven’t used any of your software yet.
    But I’m using Uberhype for on my Android phone constantly.
    Naturally hand in hand with the frustration that comes with streaming music (loading times, high data costs, occasional bad connection).
    I’m studying Information, Multimedia and Management at the VU University, Amsterdam and chose Introduction to Programming Java as a course this year.
    I’d like to see if I can make an application, similar to Uberhype, but with some local caching magic.
    I think your Java code (once it’s updated to the recent changes on HypeM) would prove to be a really helpful example 🙂
    Could you please post it?
    I’m really looking forward to seeing it.
    I already did some research on the possibility of downloading and playing an mp3 file simultaneously using Java, without downloading the data twice thus enabling streaming whilst saving time/data costs.
    I found these answers at Stackoverflow.

    Apparently it works perfectly.

    1. Hey!

      All the HypeMachine projects can be found on my GitHub. You can find the java code specifically here.
      Have you checked out my recent pet project with my friend Alex? We’ve built a site that lets you easily download and stream the music from Hypemachine.
      Check it out at

      The site is built responsive so it should look decent on a mobile browser and let you download and play the songs on your android phone!

      1. Thanks for the reply!

        Is your Java code up to date?
        In your article “Hypem API Changes” (Published:October 2, 2012) you fix the workaround.
        Had this been implemented in your Java project?
        According to Github the project was last authored 3 months ago, which leads me to believe it might need a little update.

        I checked out It’s great for constant desktop (in fact I’m using it right now) use and possibly sporadic mobile use, but I don’t see it replacing a dedicated music player (that listens to (bluetooth) media key events, has a shuffle function, auto start next song, downloads and plays simultaneously etc.)

        I’d like to start on that dedicated music player 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *