I’ve been trying to figure out how to do specific operations, such as importing ratings and building playlists, automated. I’ve started with a selenium python script which will (eventually) allow me to query my Amarok Music database to pull ratings and ultimately use these to set the same ratings in Plex.
On the plex side, I’ve managed to use Selenium on the web interface to
- Select “Music” from the side menu.
- Select “Tracks”.
- Select “List View”.
- Select “Title”.
- Read the number of items.
- Read the list (requires iterative reading the list and scrolling).
- The idea is to edit each of the items and select the proper rating.
For the most part things work as expected except:
- The app seems to sometimes fully and sometimes partially update the item “div” list when scrolling. It’s not a big issue as I end up with repeated items so nothing is lost.
- I need to hover over an item to display the “edit” button. The issue is:
- It hovers over the wrong item. This doesn’t make sense as the contents of the item returned by Selenium have the expected contents. There must be some sort of positioning discrepancy I haven’t discovered.
- I can’t get hold of the edit button. It finds it, but when I click it it performs an list item click which brings up the album page.
I am a beginner with Selenium so if anyone has any experience to get me passed these problems it could be a way of anyone automating a big manual effort like this (I have ~22k songs to rate).
BTW, the next step is to take my 4+ starred songs and put them in a playlist.
The code is only about 50 lines (with debugging) so I’d be happy to post what I’ve got.