Python Download Script Updated

I’m so slow

I’m been so caught up in my new website project (downloading songs from HypeMachine as well), that I’ve really left the extension and python script fall behind.
In an attempt to try and rectify this, I’ve made the first step by fixing/updating the python script. I’ve already documented many of the changes that needed to occur in my previous blog post but now here is the full source for those who are curious!

You can download the script here:

I’ve substantially cleaned up the code and removed the sqlite (database) aspect to it. This has resulted in a nice clean barebone downloader which does the one job it needs to do; download’em songs!. I’m always looking for advice, comments and feedback.

20 Replies to “Python Download Script Updated”

  1. Thanks a lot Farid! 🙂

    I get this error when running the script, maybe it has to do with “/” characters, I don’t know.

    Any ideas?

    Traceback (most recent call last):
    File “”, line 153, in
    File “”, line 150, in main
    File “”, line 74, in start
    self.download_songs(tracks, cookie)
    File “”, line 118, in download_songs
    print “t{} by {}”.format(title, artist)
    UnicodeEncodeError: ‘ascii’ codec can’t encode character u’xe9′ in position 21: ordinal not in range(128)

  2. If I comment out line 118, the script runs.

    Also, I get this error, so I don’t think that “/” in the filename works either:
    generic exception: [Errno 2] No such file or directory: ‘One Day / Reckoning Song (Wankelmut Remi….mp3’

  3. Sorry Farid, but I also found that the script doesn’t respect the chosen download folder.

    It always downloads to the folder where the script is run from.

    Thanks again 🙂

  4. Hey Farid

    Thanks, it works fine now 🙂

    One question, I have set the script to run automatically several times a day, and it scrapes my liked tracks.

    I have set the script to download 1 page only, but everytime it runs it has to download all the songs from page 1 and I have a clean-up script to remove the duplicates.

    There’s no way to get around that, now that the sql database is gone (the script doesn’t know which tracks it has already downloaded)?

    1. Hey!
      Um i’ve never pep8’d a python module before but ti’s something I’d love to look into.
      There are a few to dos for the script as well. Thanks for the feedback!
      I actually have a huge re-design of the download site which I think everyone will love that I’ve done with a partner.

      1. 是heavenly script 哼哼 然後其實語言學上Chinese是包括很多東西的 北京話 所謂的標準話 廣東話 上海話 閩南語…etc 就算是一個以北京話 啊還是你喜歡叫它台灣的中文 隨便 為母語的人 例如我 也沒辦法聽懂上海話 之前在上海機場被海關人員嚇到 也就是說 雖然是Chinese 但是有很多分支 有人說是方言 也有人認為只是口音 總之語言學家很多人就有很多種說法 所以聽不懂也可能是有可能的 嗯今天講話好多括號 題外話 你的哲學雞蛋糕信的確有助於我不小心瀏覽到有興趣的文章 然後不小心點進來這裡亂滾

  5. می‌گه:ba salamdooste aziz bande yeki az mioardne site hastamin site be hich onvan az fakezilla estefade nemikonad va nakardelotfan az roo bi etelaii in etelaate ghalat ra be mardom nadahidba tashakor

Leave a Reply

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