Kodi Community Forum
Headphones - Music albums & artists auto download program - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Headphones - Music albums & artists auto download program (/showthread.php?tid=103688)



- HenryFord - 2011-12-20

You shouldn't use notepad for python since python relies heavily on intendation - and notepad tends to just f**k with that.
I recommend Notepad++ for Windows-Users (seriously - you don't have that? Wink ). With Linux any text-editor will do (lol at using nano Wink Go VI already Big Grin)

However - I'll push a merge-request out tonight for rembo10, but I don't think a update will happen soon...
Maybe I should get into python already and fork over the project Smile


- ZestyChicken - 2011-12-21

HenryFord Wrote:You shouldn't use notepad for python since python relies heavily on intendation - and notepad tends to just f**k with that.
I recommend Notepad++ for Windows-Users (seriously - you don't have that? Wink ). With Linux any text-editor will do (lol at using nano Wink Go VI already Big Grin)

However - I'll push a merge-request out tonight for rembo10, but I don't think a update will happen soon...
Maybe I should get into python already and fork over the project Smile

This seems to be working fine for me now too! Woot. Of course the system wants me to update constantly now. Oh well. Will just have to keep an eye on things.

By the way, for the Windows installation recs, you might want to add something like they do for the Maraschino install to prevent the little command prompt window:


http://htpc.ictcsc.net/wiki/index.php/MaraschinoWindows

Advanced Auto-Start
A tip was brought to my attention by XBMC Forum Member _Mikie_ that allows you to hide the Console (Command Prompt) Window while still allowing Maraschino to run. This can be useful for people that still use the system running Maraschino for other tasks and don't want it to display on screen or in the taskbar. I took his original idea and modified it below to make it "Update Proof" and save users from having to make this change each time the main file is updated.
Instead of using the above code for your "maraschino.bat" file, substitute it with the following:
cd "C:\HTPC-Apps\Maraschino"
del "maraschino-cherrypy.pyw"
copy "maraschino-cherrypy.py" "maraschino-cherrypy.pyw"
start "Maraschino" maraschino-cherrypy.pyw
exit
When you use this method, a Command Prompt will quickly flash on your screen during boot but will instantly disappear and you wont have to worry about seeing it and closing it by accident.


- frieten - 2011-12-21

can anyone upload the fixed file? i'm having the same issues as everyone else with it returning 503 errors.

it worked for a bit but now i get the errors.

also tried editing the file in notepad++ but i can't find the part you describe.

EDIT: derp nvm i was using the compiled version.

edit edit: goddamn now the bloody non compiled version wont run!

ARGHHH

hope there is a fix for this soon i deleted a hell of alot of my music so i could just reorganise everything with this lol


- apex82 - 2011-12-21

What file do I edit in windows 7? I cant find the one specified above...


- silencery - 2011-12-21

@apex82

are you running the python version? If so, it's located in \headphones\lib\musicbrainz2\webservice.py. Just edit that python file with the new useragent data, restart headphones, and you're set.

If you're using a pre-compiled binary (does this exist? I'm not sure), i'm afraid you're out of luck. You may have to install python and run the source from git.


- frieten - 2011-12-21

silencery Wrote:@apex82

are you running the python version? If so, it's located in \headphones\lib\musicbrainz2\webservice.py. Just edit that python file with the new useragent data, restart headphones, and you're set.

If you're using a pre-compiled binary (does this exist? I'm not sure), i'm afraid you're out of luck. You may have to install python and run the source from git.

i've tried that and for some reason running headphones.py i just get a dos box blink and thats it.

the only way i can get it to run is with the pre-compiled version linked in the first post but then i get the errors.

im using python 3.2 x64 version should i be using something else?

running headphones.py in the shell returns this:

Code:
Traceback (most recent call last):
  File "C:\Users\Bowan\Downloads\rembo10-headphones-8d80c6d\rembo10-headphones-8d80c6d\Headphones.py", line 5, in <module>
    from lib.configobj import ConfigObj
  File "C:\Users\Bowan\Downloads\rembo10-headphones-8d80c6d\rembo10-headphones-8d80c6d\lib\configobj.py", line 1644
    except Exception, e:
                    ^
SyntaxError: invalid syntax
>>>



- BigladUK - 2011-12-21

Here is the updated file

http://www.box.com/s/343jfe9i814aa4v454h7


- HenryFord - 2011-12-21

frieten Wrote:the only way i can get it to run is with the pre-compiled version linked in the first post but then i get the errors.
The compiled version is created by me and is based on the repo-version. My script always checks the current version from git out and thus the fix has to be implemented into the rep... Sorry.

Quote:im using python 3.2 x64 version should i be using something else?
Yes: Python 2.7

@ZestyChicken:
This - unfortunately - won't work since the compiled binary is a console-application and it isn't easy to surpress the console-window (At some point I will look into how Sickbeard, Couchpotato are doing it, but this will take time...).
If you're running the python-version however it is much, much, much simpler than using a batch-file:
1. Right-Click the python-file and click on "Create Shortcut"
2. Right-Click the created shortcut and add "pythonw" at the beginning of the "Target"-line. Then you won't see a console-window popping up.


- silencery - 2011-12-21

@frieten

The reason you're seeing a prompt is because you've double-clicked the webservice.py file. Python thinks you're trying to execute the script.

What we're actually doing is patching the code with a minor fix. So instead of double-clicking, edit the webservice.py file with a text editor (i.e. gedit/editplus/notepad++) and alter the line starting with (this was line 249 in my copy):

Quote:userAgent = 'python-musicbrainz/' + musicbrainz2.__version__

Change that line to read:

Quote:userAgent = 'python-headphonesalpha/' + musicbrainz2.__version__

Save your text file. Restart headphones, and you're set.

Good luck.


- ZestyChicken - 2011-12-22

You know, one thing I noted is that the Musicbrainz database is a bit for shit. A lot of mistakes and missing information. Seems like AllMusic is better though also not perfect. I had a lot of luck with Audio-Matic except that it was Windows only (I'm looking to move away from Windows) and no web interface. I think it used Discogs...

I know the Audio-Matic guys was looking to combine forces. That would be ideal...


- frieten - 2011-12-22

silencery Wrote:@frieten

The reason you're seeing a prompt is because you've double-clicked the webservice.py file. Python thinks you're trying to execute the script.

What we're actually doing is patching the code with a minor fix. So instead of double-clicking, edit the webservice.py file with a text editor (i.e. gedit/editplus/notepad++) and alter the line starting with (this was line 249 in my copy):



Change that line to read:



Save your text file. Restart headphones, and you're set.

Good luck.

thanks for the info but im not completely new to this. i already edited the webserver file with notepadd ++ the prompt was coming when i was trying to run the headphones.py file to start headphones, which was returning an error, which i posted about on the previous page. Im assuming its because i was using the wrong version of python as pointed out by HenryFord, thanks btw.

HenryFord Wrote:The compiled version is created by me and is based on the repo-version. My script always checks the current version from git out and thus the fix has to be implemented into the rep... Sorry.

Yes: Python 2.7

@ZestyChicken:
This - unfortunately - won't work since the compiled binary is a console-application and it isn't easy to surpress the console-window (At some point I will look into how Sickbeard, Couchpotato are doing it, but this will take time...).
If you're running the python-version however it is much, much, much simpler than using a batch-file:
1. Right-Click the python-file and click on "Create Shortcut"
2. Right-Click the created shortcut and add "pythonw" at the beginning of the "Target"-line. Then you won't see a console-window popping up.

thanks for clearing this up, it was pretty much what i thought. will get python 2.7 and try to do it this way.

hopefully this will fix the issue. but also yeah i agree that musicbrainz seems to be a bit retarded in terms of finding the right artists etc. its a shame theres no way to select the one we want it to scrape like with sickbeard etc

is there anyway to make headphones come up with an option to select what artist if it can't find it properly? a perfect example is p!nk. it comes up as pink and not the real p!ink, but i can't find a way to select it properly.

i spent ages yesterday renaming my folders to match musibrainz and it still doesn't find certain artists, like Ke$ha, comes up as KE


EDIT: python 2.7.2 and its working fine, thanks for the info henryford why is it that it wont work on a newer version of python??


- silencery - 2011-12-22

ah, sorry, didn't mean to be patronizing. just wanted to clarify.

You can pick different scrapers in sickbeard? Wow. How do you do that?

Music is tough to normalize since there are so many different combinations variations of artists, albums, concerts, distributors, specials, etc. I wonder if there's a better scraper out there? It'd be nice if there was something as well-organized as tvdb or themoviedb for music. It's too bad allmusic, musicbrainz, last.fm all seem to have different shortcomings.


- frieten - 2011-12-22

silencery Wrote:ah, sorry, didn't mean to be patronizing. just wanted to clarify.

You can pick different scrapers in sickbeard? Wow. How do you do that?

Music is tough to normalize since there are so many different combinations variations of artists, albums, concerts, distributors, specials, etc. I wonder if there's a better scraper out there? It'd be nice if there was something as well-organized as tvdb or themoviedb for music. It's too bad allmusic, musicbrainz, last.fm all seem to have different shortcomings.

nah no worries mate, and yeah not that i know of in sickbeard as for picking scrapers just meant that when you add shows manually it actually searches from TVDB and lets you pick the right show.

just wish headphones had this feature for when it query's musicbrainz, when you search musicbrainz manually it shows up pink as in like the 3rd spot, just need the ability to select the proper artist thru headphones or give it the right info to search for it.

surely there is a way to add in manually what to make it look for? ie when i use musicbrainz website it returns f4d5cc07-3bc9-4836-9b15-88a08359bc63 as the right place to look for the P!nk artist i want it to find, instead of it defaulting to the pink artist from the 60s with one stupid album.


- ZestyChicken - 2011-12-22

Another thought: would be nice to add an option to pass the nzb priority to sabnzbd. For instance, now I have TV from SB as high, movie from CPas medium.


- DrMedia - 2011-12-22

BigladUK Wrote:Here is the updated file

http://www.box.com/s/343jfe9i814aa4v454h7

Nice.. thanks.. that fixed it for me!!!