WIP New add-on: ListenBrainz - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: WIP New add-on: ListenBrainz (/showthread.php?tid=342538) |
New add-on: ListenBrainz - Freso - 2019-03-29 Hi all! The last few days I've been tinkering with making an add-on for submitting listening data to ListenBrainz. The add-on was based on the Last.fm add-on. I tagged version 0.0.1 yesterday and it's working for me; I'd love to get some more people to test it and give feedback though, before I submit it for inclusion in the official Kodi repository. Source code: https://gitlab.com/Freso/service.listenbrainz Download (Kodi 18/Leia): service.listenbrainz-v0.2.1.zip (latest snapshot) Download (Kodi 19/Matrix): service.listenbrainz-v0.3.1.zip (latest snapshot) Changelogs: Leia / Matrix Features:
Setup:
Please report any issues and feature requests to the issue tracker on GitLab if you're able. Alternatively, you can post here… but I'd prefer GitLab. Enjoy, and let me know your thoughts! (Also, any recommendations for code style/best practices for Kodi add-ons would be greatly appreciated. This is my first Kodi add-on, so I'm a bit uncertain regards how to best do some things. Also if you can spot anything that would prevent this from adoption into the official repository!) RE: New add-on: ListenBrainz - docwra - 2019-03-29 Awesome! I tested but get a dependency error on the script.module.future I had a quick google but couldn't find that 0.17.1 version online. Code: 2019-03-29 14:09:06.207 T:7504 DEBUG: ------ Window Deinit (FileBrowser.xml) ------ Testing with the latest 18.1 Kodi. RE: New add-on: ListenBrainz - Freso - 2019-03-29 (2019-03-29, 16:14)docwra Wrote: Awesome! Ah, yeah. I've had a bit of trouble figuring out where to find what versions were available of the various Python libraries. I just pushed a fix for this. Can you try with https://gitlab.com/Freso/service.listenbrainz/-/archive/master/service.listenbrainz-master.zip and see if that works for you? RE: New add-on: ListenBrainz - docwra - 2019-03-29 Great, seems to work as expected! The only thing I noticed was the Listenbrainz token is crazy long, no way I could be bothered to type that in on my Android setup without a keyboard For info I did something similar on TheAudioDB with user tokens and got it down to 5 capital letters with some MD5 shortening and a little algorithm on the username. I think Trakt does the same for their user tokens as well to make them easy to type in. Anyway its working great! RE: New add-on: ListenBrainz - Freso - 2019-03-29 (2019-03-29, 16:51)docwra Wrote: The only thing I noticed was the Listenbrainz token is crazy long, no way I could be bothered to type that in on my Android setup without a keyboard Yeah. I'm really not happy with that either (see also my comment in the OP), but I'm not sure what to do about it. It's not in my power to change the ListenBrainz side of things (I could request it, sure, but…). Is there no other way to get a token (or password as it may also be in some other add-on cases) into Kodi? Oh, and thanks for testing and reporting back that it's not just for me it's working! And thanks for the screenshot too! Would you mind if I maybe included that with the add-on as a, well, screenshot? RE: New add-on: ListenBrainz - docwra - 2019-03-29 Sure go for it, but can blank out my username and name RE: New add-on: ListenBrainz - ronie - 2019-03-29 regarding https://gitlab.com/Freso/service.listenbrainz/issues/6 you should be able to retrieve musicbrainzartistid and musicbrainztrackid (and other info) using json-rpc. it's a bit of a workaround as you would first need to retrieve the library id from InfoTagMusic using the getDbId() (https://codedocs.xyz/xbmc/xbmc/group__python___info_tag_music.html#ga323ecf0ddf8dc83984fbc0e91b2b691b) then use this id in a AudioLibrary.GetSongDetails json query (https://kodi.wiki/view/JSON-RPC_API/v9#AudioLibrary.GetSongDetails) RE: New add-on: ListenBrainz - Freso - 2019-03-30 (2019-03-29, 23:37)ronie Wrote: regarding https://gitlab.com/Freso/service.listenbrainz/issues/6 Thanks! I hadn't even considered the JSON-RPC, but yeah, that's definitely also a venue that needs exploration. Thank you for pointing it out! Do you know if there are any plans of having the Python API be fully-featured compared to the C one? What repository would I want to poke at if I want to submit PRs for adding more of the C class methods to the Python library? I'm thinking I may want to make the logic so it first tries to get as much as possible straight from the (Python) API, then it'll check the JSON-RPC to fill in blanks, and I'll probably still want to pull in mutagen to directly check file tags — as this also lets me include information that Kodi doesn't consider at all, like MusicBrainz Track IDs and MusicBrainz Work IDs. RE: New add-on: ListenBrainz - ronie - 2019-03-30 (2019-03-30, 07:25)Freso Wrote: Do you know if there are any plans of having the Python API be fully-featured compared to the C one? What repository would I want to poke at if I want to submit PRs for adding more of the C class methods to the Python library? i don't think anyone is actively working on it. if you're interested, Kodi improvements are always welcome! PR's can be submitted to the Kodi repo. the python code lives here: https://github.com/xbmc/xbmc/tree/master/xbmc/interfaces/legacy (2019-03-30, 07:25)Freso Wrote: I'm thinking I may want to make the logic so it first tries to get as much as possible straight from the (Python) API, then it'll check the JSON-RPC to fill in blanks, and I'll probably still want to pull in mutagen to directly check file tags — as this also lets me include information that Kodi doesn't consider at all, like MusicBrainz Track IDs and MusicBrainz Work IDs. that will work fine for local files, but you'll likely run into issues when your files are on a network share (smb/nfs). ...at least i did when trying to use the mutagen library to grep embedded lyrics from the file tags. i ended up patching mutagen to handle file objects created with our xbmcvfs module. there may be other/better workarounds though... RE: New add-on: ListenBrainz - Freso - 2019-04-29 Version 0.1.0 has been released. Download from https://gitlab.com/Freso/service.listenbrainz/-/archive/v0.1.0/service.listenbrainz-v0.1.0.zip. This should submit all information that can be gotten directly from Kodi’s internal API. Next step is making the addon use the JSON-RPC interface (and maybe fiddle with mutagen or some such) to get additional information, including MusicBrainz identifiers. As always, please let me know any issues you have and either report here or on GitLab. RE: New add-on: ListenBrainz - docwra - 2019-04-29 Awesome, thanks signed up on Patreon as a show of appreciation for this. Open Data FTW! RE: New add-on: ListenBrainz - meowmoo - 2019-11-16 im getting this error lately Quote:ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--https://pastebin.com/iGvmSQ1D RE: New add-on: ListenBrainz - STEELBAS - 2021-02-17 I get the same error: Quote:2021-02-17 19:07:14.296 T:140352308618816 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--I suppose development on this plugin has ceased, a shame. RE: New add-on: ListenBrainz - STEELBAS - 2021-02-17 (2021-02-17, 23:22)STEELBAS Wrote: I get the same error:I saw this hadn't been submitted to the Gitlab issues yet, though, that probably doesn't help. Did so now. RE: New add-on: ListenBrainz - murnaz - 2021-04-11 I get some errors kodi 19 matrix 2021-04-11 12:55:43.889 T:8352 DEBUG <general>: service.listenbrainz - listener: "tag_overrides" set to: {} 2021-04-11 12:55:43.889 T:8352 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <class 'AttributeError'> Error Contents: 'dict' object has no attribute 'iteritems' Traceback (most recent call last): File "C:\Users\ZERO TAKIMI\AppData\Roaming\Kodi\addons\service.listenbrainz\listener.py", line 224, in onPlayBackStarted listen = self._get_listen() File "C:\Users\ZERO TAKIMI\AppData\Roaming\Kodi\addons\service.listenbrainz\listener.py", line 266, in _get_listen listen = Listen(tags, timestamp=timestamp, **tag_overrides) File "C:\Users\ZERO TAKIMI\AppData\Roaming\Kodi\addons\service.listenbrainz\utils.py", line 188, in __init__ self.metadata = self.get_metadata_from_kodi_tags(tags) File "C:\Users\ZERO TAKIMI\AppData\Roaming\Kodi\addons\service.listenbrainz\utils.py", line 277, in get_metadata_from_kodi_tags for k, v in kodi_mapping.iteritems(): AttributeError: 'dict' object has no attribute 'iteritems' -->End of Python script error report<-- |