Headphones : Music albums and artists auto download program

Got a program that plays well with SABnzbd? Share it here!

Headphones : Music albums and artists auto download program

Postby demolt » March 4th, 2011, 4:26 pm

I'm totally in love with Sickbeard and I was thinking that it would be awesome if such a tool was available for music.  I figured it should be pretty easy to convert such a system te work with music as well.

Now the only programming I'm able to do is a little HTML and PHP, so I won't be able to do such a thing unfortunately. But I was hoping to find someone with the same interest in a program like that to convert sickbeard or create a simillar program to organize music with the help of an online database.
It would be great to be able to add artists like you add TV series in Sickbeard, the seasons would be the albums.

Is this possible and easy or am I crazy?
Last edited by rascalli on June 4th, 2011, 12:09 pm, edited 1 time in total.
demolt
Newbie
Newbie
 
Posts: 9
Joined: March 4th, 2011, 4:17 pm

Re: Sickbeard for Music albums and artists

Postby nomar383 » March 7th, 2011, 11:21 am

Do you know of any good online music databases with an API? I just saw that Yahoo has one.

This would be a nice way to track artists rather than just stumbling upon the fact that an artist you like just put out a new album.
SABCommand for iPad Developer
SABConnect for Safari 5 Developer

Bug Tracking:
http://redmine.kalenhansen.com

Twitter:
http://twitter.com/SABCommand
User avatar
nomar383
Release Testers
Release Testers
 
Posts: 224
Joined: April 14th, 2010, 2:34 am
Location: Rexburg, ID

Re: Sickbeard for Music albums and artists

Postby demolt » March 11th, 2011, 1:54 pm

Sorry for the late answer.

The standard DB other apps use is FreeDB, check www.freedb.org
demolt
Newbie
Newbie
 
Posts: 9
Joined: March 4th, 2011, 4:17 pm

Re: Sickbeard for Music albums and artists

Postby nomar383 » March 11th, 2011, 2:01 pm

Hmmmm, there would have to be somewhere that you could scrape or query for a particular artist.

Let's say I want to track the Beastie Boys. This app would have to be able to reliably tell what the next album will be. FreeDB turned up 8265 results just for a search for artists named "Beastie Boys". I'm not sure how reliable that is.
SABCommand for iPad Developer
SABConnect for Safari 5 Developer

Bug Tracking:
http://redmine.kalenhansen.com

Twitter:
http://twitter.com/SABCommand
User avatar
nomar383
Release Testers
Release Testers
 
Posts: 224
Joined: April 14th, 2010, 2:34 am
Location: Rexburg, ID

Re: Sickbeard for Music albums and artists

Postby demolt » March 11th, 2011, 2:45 pm

That's where my lack of programming comes to play, I don't know which database is useful.
I found the next sites:
http://www.discogs.com/
http://www.shazam.com/
http://www.last.fm
demolt
Newbie
Newbie
 
Posts: 9
Joined: March 4th, 2011, 4:17 pm

Re: Sickbeard for Music albums and artists

Postby nomar383 » March 11th, 2011, 2:46 pm

Oh! Last.fm has a great looking API. That might work for something like this...

EDIT: Python API for it too:
http://code.google.com/p/python-lastfm/
Last edited by nomar383 on March 11th, 2011, 2:49 pm, edited 1 time in total.
SABCommand for iPad Developer
SABConnect for Safari 5 Developer

Bug Tracking:
http://redmine.kalenhansen.com

Twitter:
http://twitter.com/SABCommand
User avatar
nomar383
Release Testers
Release Testers
 
Posts: 224
Joined: April 14th, 2010, 2:34 am
Location: Rexburg, ID

Re: Sickbeard for Music albums and artists

Postby demolt » March 11th, 2011, 3:00 pm

nomar383 wrote:Oh! Last.fm has a great looking API. That might work for something like this...

EDIT: Python API for it too:
http://code.google.com/p/python-lastfm/


Nice :)

I also opened a topic @ sickbeards forum, maybe there is someone who can help :)
http://sickbeard.com/forums/viewtopic.p ... 6239#p6239
demolt
Newbie
Newbie
 
Posts: 9
Joined: March 4th, 2011, 4:17 pm

Re: Sickbeard for Music albums and artists

Postby nomar383 » March 13th, 2011, 1:04 pm

How do you envision this working? You add an artist and have it download anything it finds that matches Last.FM results?
SABCommand for iPad Developer
SABConnect for Safari 5 Developer

Bug Tracking:
http://redmine.kalenhansen.com

Twitter:
http://twitter.com/SABCommand
User avatar
nomar383
Release Testers
Release Testers
 
Posts: 224
Joined: April 14th, 2010, 2:34 am
Location: Rexburg, ID

Re: Sickbeard for Music albums and artists

Postby demolt » March 13th, 2011, 3:27 pm

I was hoping it to work exactly like sickbeard.

First you add the artists you like, then you let it search the folders to songs you already have.
After that you chose the albums in stead of a season you pick an album and click "Wanted" at all the songs of that album, as you would do in sickbeard.
demolt
Newbie
Newbie
 
Posts: 9
Joined: March 4th, 2011, 4:17 pm

Re: Sickbeard for Music albums and artists

Postby rembo10 » May 25th, 2011, 3:04 am

http://github.com/rembo10/headphones

I just learned python so the code is pretty messy, but it's reasonably functional. It only works with SABnzbd & NZBMatrix for now (since that's what I've been using) and post-processing doesn't work (so just use SAB to configure your final download destination using the categories).

Either manually add artists or use the  iTunes auto-import to add artists to watch. New albums are auto-set to 'Wanted' and automatically downloaded when available. You can also download any old album within the app (although this is a little spotty due to NZBMatrix's RSS feed and retention parameters).

I'm totally rewriting the code to get rid of redundencies and what not, and to add logging & templates, but I wanted to get something working for myself.

To run it just download it from github, cd into the directory and run 'python headphones.py' [ -q and -d as optional arguments]

Default port is 8181

I built & tested it using Safari on a Mac so apologies if the css is a little wonky on other browsers
Last edited by rembo10 on May 25th, 2011, 4:13 am, edited 1 time in total.
rembo10
Jr. Member
Jr. Member
 
Posts: 56
Joined: April 26th, 2011, 3:29 am

Re: Sickbeard for Music albums and artists

Postby al1937 » May 25th, 2011, 12:08 pm

Hi rembo10
I get the error below when I try to add an artist.
Win7-64 and firefox and python 2.7.1.

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "M:\Headphones\rembo10-headphones-064ef2e\cherrypy\_cprequest.py", line 645, in respond
    response.body = self.handler()
  File "M:\Headphones\rembo10-headphones-064ef2e\cherrypy\lib\encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "M:\Headphones\rembo10-headphones-064ef2e\cherrypy\_cpdispatch.py", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "M:\Headphones\rembo10-headphones-064ef2e\webServer.py", line 217, in addArtist
    c.execute('INSERT INTO tracks VALUES( ?, ?, ?, ?, ?, ?, ?, ?)', (artistid, results.artist.name, results.title, results.asin, u.extractUuid(results.id), track.title, track.duration, u.extractUuid(track.id)))
ProgrammingError: Cannot operate on a closed cursor.
al1937
Newbie
Newbie
 
Posts: 44
Joined: November 25th, 2009, 3:49 am

Re: Sickbeard for Music albums and artists

Postby rembo10 » May 25th, 2011, 1:16 pm

Ah, I tested it with python 2.6 on OSX so I'm sure there are issues cross-compatibility wise. Should be fixed now on github....
rembo10
Jr. Member
Jr. Member
 
Posts: 56
Joined: April 26th, 2011, 3:29 am

Re: Sickbeard for Music albums and artists

Postby jcfp » May 25th, 2011, 1:39 pm

Rembo, great to see you work on the missing link of sab addons ;D

Just tried headphones and got a (similar but not identical) traceback when trying to add an artist. Anyway, the traceback presists even after a restart of the application, and blocks the web interface from being used. Ubuntu 11.04, Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53), exact web browser is in the logging below.

Code: Select all
$ python headphones.py
[25/May/2011:19:22:38] ENGINE Listening for SIGHUP.
[25/May/2011:19:22:38] ENGINE Listening for SIGTERM.
[25/May/2011:19:22:38] ENGINE Listening for SIGUSR1.
[25/May/2011:19:22:38] ENGINE Bus STARTING
[25/May/2011:19:22:38] ENGINE Started monitor thread 'Autoreloader'.
[25/May/2011:19:22:38] ENGINE Serving on 127.0.0.1:8082
[25/May/2011:19:22:38] ENGINE Bus STARTED
127.0.0.1 - - [25/May/2011:19:22:54] "GET / HTTP/1.1" 200 1022 "" "Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110525 Firefox/7.0a1"
127.0.0.1 - - [25/May/2011:19:22:54] "GET /data/css/style.css HTTP/1.1" 200 1904 "" "Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110525 Firefox/7.0a1"
127.0.0.1 - - [25/May/2011:19:22:54] "GET /data/images/headphoneslogo.png HTTP/1.1" 200 8304 "" "Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110525 Firefox/7.0a1"
127.0.0.1 - - [25/May/2011:19:23:48] "GET /findArtist?name=rammstein HTTP/1.1" 303 200 "" "Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110525 Firefox/7.0a1"
127.0.0.1 - - [25/May/2011:19:24:34] "GET /addArtist?artistid=b2d122f9-eadb-4930-a196-8f221eeb0c66 HTTP/1.1" 303 90 "" "Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110525 Firefox/7.0a1"
[25/May/2011:19:24:34] HTTP Traceback (most recent call last):
  File "/home/jp/devel/headphones/headphones/cherrypy/_cprequest.py", line 645, in respond
    response.body = self.handler()
  File "/home/jp/devel/headphones/headphones/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/home/jp/devel/headphones/headphones/cherrypy/_cpdispatch.py", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/jp/devel/headphones/headphones/webServer.py", line 40, in index
    c.execute('''SELECT AlbumTitle, ReleaseDate, DateAdded, AlbumID from albums WHERE ArtistName="%s" order by ReleaseDate DESC''' % results[i][0])
ProgrammingError: Cannot operate on a closed cursor.
User avatar
jcfp
Release Testers
Release Testers
 
Posts: 692
Joined: February 7th, 2008, 1:45 pm

Re: Sickbeard for Music albums and artists

Postby nomar383 » May 25th, 2011, 2:41 pm

Glad you had some time to work on this since I never got around to it  :D
SABCommand for iPad Developer
SABConnect for Safari 5 Developer

Bug Tracking:
http://redmine.kalenhansen.com

Twitter:
http://twitter.com/SABCommand
User avatar
nomar383
Release Testers
Release Testers
 
Posts: 224
Joined: April 14th, 2010, 2:34 am
Location: Rexburg, ID

Re: Sickbeard for Music albums and artists

Postby rembo10 » May 25th, 2011, 2:55 pm

Check out the latest - I also fixed the wonky search bar

there may be some other issues since I'm on 2.6 but I'll make it work

Any suggestions and what not definitely let me know. I'm going to rewrite the whole deal so I'd love to make it as awesome as possible
rembo10
Jr. Member
Jr. Member
 
Posts: 56
Joined: April 26th, 2011, 3:29 am

Next

Return to Third-party Addons