Kodi Community Forum

Full Version: [RELEASE] Last.FM Playlist Generator Script - Auto Generate Similar Music Playlists
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Of course the script would still only be choosing from similar tracks. Smile

I think we both just meant randomisation of the similar tracks found on last.fm.

This way if you start the script twice with the same song, the generated playlist won't be the same both times. Smile
New version up:
http://lastfmplaylistgenerator.googlecod...-1.0.4.zip

Added: Artist fanart to the listitem (Might not show everywhere, but I should work for fanart music vizualisation - I'm using a mod of confulence where artist fanart is shown as music visualization)

Changed: Randomizing the last.fm result (this might not give the most similar track, but at least it gives different results for the same seed track)
The reason it might not give the best result is because last.fm returns 250 similar tracks, where I believe the first ones are the most similar. I now shuffle these before looking for the track in your music database.

I probably need to make some settings for this soon Smile
I had to rename the file again to another different name when I updated.

Trying it out right now. Fanart is working for me.

The file name instead of the song name in the now playing list has changed somehow. It will now show the name of the file but without the path. Definitely a huge improvement. Thanks a lot for your work.
New version is working brilliantly thanks.

In the addon settings, we can limit song playlist generation a minimum 10 per track. Is there a reason we couldn't take this lower to say, 3 tracks?
ErlendSB Wrote:New version up:
http://lastfmplaylistgenerator.googlecod...-1.0.4.zip

Added: Artist fanart to the listitem (Might not show everywhere, but I should work for fanart music vizualisation - I'm using a mod of confulence where artist fanart is shown as music visualization)

Changed: Randomizing the last.fm result (this might not give the most similar track, but at least it gives different results for the same seed track)
The reason it might not give the best result is because last.fm returns 250 similar tracks, where I believe the first ones are the most similar. I now shuffle these before looking for the track in your music database.

I probably need to make some settings for this soon Smile

I think you are able to limit the number of tracks returned from last.fm with the limit parameter. If you set this to say 20, then last.fm would return the top 20 similar tracks for the playing song and then you could pick randomly from this. This would mean that you would still get different results each play but from more similar tracks.
kiboy6 Wrote:New version is working brilliantly thanks.

In the addon settings, we can limit song playlist generation a minimum 10 per track. Is there a reason we couldn't take this lower to say, 3 tracks?

This setting is not in use in the Partmode version, and I should remove it. The current version is hardcoded to add 3 tracks. Thanks for letting me know.

Useful settings are on the roadmap though. Smile
mortstar Wrote:I think you are able to limit the number of tracks returned from last.fm with the limit parameter. If you set this to say 20, then last.fm would return the top 20 similar tracks for the playing song and then you could pick randomly from this. This would mean that you would still get different results each play but from more similar tracks.

How about that. Nice!

My only concern about limiting the result from last.fm is that the changes to find a local match will be smaller.
Now, it's very probable that the sript will find 3 songs among the 250 last.fm tracks. But if I'd lower the result to 20, the chance to find 3 local song will not be so great. I'll do some experimenting, and at some point I'll most likely create som settings for it.
The addon is now hosted through Mortstar's repo. I updated the first post.
Cool that we can now update through a repo Smile

I'm using this awesome script daily - thanks so much again.

Quick question - is there a mechanism in place to prevent a song playing more than onc during a partymode session?

It's weird - I never noticed this being a problem but today I heard several songs repeating during the same session (ie I stated party mode, selected a single track and then left the pc alone). Anything that can be done to stop this occurring?

Cheers!
kiboy6 Wrote:Quick question - is there a mechanism in place to prevent a song playing more than onc during a partymode session?

At the moment, no. But I agree it should be.
Adding to the todo list. Smile
I will have to try out your addon.

I wrote (one of) the last.fm addons for mediamonkey which does essentially the same thing, provide an endless playlist of similar songs, along with generating nodes based upon last.fm data and your library.


http://www.mediamonkey.com/forum/viewtop...=2&t=24879
TeknoJnky Wrote:I will have to try out your addon.

I wrote (one of) the last.fm addons for mediamonkey which does essentially the same thing, provide an endless playlist of similar songs, along with generating nodes based upon last.fm data and your library.


http://www.mediamonkey.com/forum/viewtop...=2&t=24879

Hey! I remember this. I used Media monkey as my nr 1 media player before i got an Apple device (and reluctantly moved to their locked-up piece of software)
Your addon along with mediaportal´s lastfm implementation was the inspiration for creating something similar for xbmc.

I´ve had a look at your code, and see it has evolved a lot since I last used it. Great job!!

If you don´t mind, I´d like to implement some of the features you have into my addon. Especially some of the settings you have.
I have tried to run your script in nightly build but I get the following error:

Code:
13:10:10 T:139986756912896 M:3171987456   DEBUG: Python thread: start processing
13:10:10 T:139986756912896 M:3171987456  NOTICE: -->Python Interpreter Initialized<--
13:10:10 T:139986756912896 M:3171987456   DEBUG: Process - The source file to load is /home/xbmc/.xbmc/addons/script.lastfmplaylistgeneratorPM/pm.py
13:10:10 T:139986756912896 M:3171987456   DEBUG: Process - Setting the Python path to /home/xbmc/.xbmc/addons/script.lastfmplaylistgeneratorPM:/home/xbmc/.xbmc/addons/script.module.simplejson/lib:/home/xbmc/.xbmc/addons/script.module.beautifulsoup/lib:/usr/share/xbmc/addons/script.module.pil/lib:/home/xbmc/.xbmc/addons/script.module.elementtree/lib:/usr/share/xbmc/addons/script.module.pysqlite/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PIL:/usr/lib/pymodules/python2.7/gtk-2.0:/usr/lib/python2.7/dist-packages/gst-0.10:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/pymodules/python2.7:/usr/lib/pymodules/python2.7/libubuntuone:/usr/lib/pymodules/python2.7/ubuntuone-control-panel:/usr/lib/pymodules/python2.7/ubuntuone-storage-protocol:/usr/lib/pymodules/python2.7/ubuntuone-client:/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode:
13:10:10 T:139986756912896 M:3171987456   DEBUG: Process - Entering source directory /home/xbmc/.xbmc/addons/script.lastfmplaylistgeneratorPM
13:10:10 T:139986756912896 M:3171860480    INFO: -->Python script returned the following error<--
13:10:10 T:139986756912896 M:3171860480   ERROR: Error Type: <type 'exceptions.IOError'>
13:10:10 T:139986756912896 M:3171860480   ERROR: Error Contents: (2, 'No such file or directory', 'special://masterprofile/autoexec.py')
13:10:10 T:139986756912896 M:3171860480   ERROR: Traceback (most recent call last):
                                              File "/home/xbmc/.xbmc/addons/script.lastfmplaylistgeneratorPM/pm.py", line 149, in <module>
                                                p=MyPlayer()
                                              File "/home/xbmc/.xbmc/addons/script.lastfmplaylistgeneratorPM/pm.py", line 35, in __init__
                                                addauto("if os.path.exists('" + os.path.normpath(process).replace('\\','\\\\') + "'):#lastfmplaylistgeneratorpm\n\tos.remove('" + os.path.normpath(process).replace('\\','\\\\') + "')","lastfmplaylistgeneratorpm")
                                              File "/home/xbmc/.xbmc/addons/script.lastfmplaylistgeneratorPM/pm.py", line 131, in addauto
                                                f = open(autoexecfile, "w")
                                            IOError: (2, 'No such file or directory', 'special://masterprofile/autoexec.py')
I haven´t installed the latest nightly, so I´m not sure the latest version fixed this problem. But I made a change to how the addon finds the autoexec.py file. Try the latest version 1.0.5 and let me know if the problem is still there.
Okay, something weird was happening here. I deinstalled both scripts (normal and party mode), because I thought I could install them both fresh from the repository. However only the party mode script is available on the repo. So I installed that and installed the normal version from your google code page. Now I get "no similar tracks were found" for every song in party mode. I now have party mode version 1.05 installed and normal version 1.01.

I suggest you upload both scripts to the repo and make it clear that the party mode needs the normal script.

A restart solved the issue, yet still this could lead to frustration by new users.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20