Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
modifying a script
#1
I have jellyfin running on an ubuntu server in my house. I have a playlist that I have put a lot of effort into (1000 songs).

I also installed jellyfin on my windows 10 laptop. Would like have a python script that I could run that would modify my XML playfirst file from ubuntu to my windows 10 jellyfin installation. Was able to make a script that changes the root path, but now I see that the those pesky slashes all need to be changed. "/" need to be converted to "\" for it to work in windows. I branched the jellyfind migrator, that converts windows playlists to linux ..... any suggestions on how to tackle this greatly appreciated.

I have also added the playlist.xml file into the github link below, note the <path> was already changed with a script that I created.

https://github.com/mackconsult/Jellyfin-Migrator
Reply
#2
(Mar-17-2025, 03:37 AM)mackconsult Wrote: ut now I see that the those pesky slashes all need to be changed. "/" need to be converted to "\" for it to work in windows
No,it's more a problem with single \ because of escape character,/ work fine on Windows.
>>> p = 'E:\music/Phish/Phish New Years Run 2010-2011 SBD/12_30_10'
<interactive input>:1: SyntaxWarning: invalid escape sequence '\m'
>>> p = p.replace('\\', '/')
# Ok
>>> p
'E:/music/Phish/Phish New Years Run 2010-2011 SBD/12_30_10' 
So it's better to convert all \ to /

Not look so much into this,but some path look like can make some problems.
<PlaylistItem>
  <Path>E:\music/Mama's and the Papa's/Greatest Hits/The Mamas &amp; The Papas-04-California Dreamin'.mp3</Path>
</PlaylistItem>
<PlaylistItem>
  <Path>E:\music/Blackberry Smoke - You Hear Georgia (2021) Mp3 320kbps [PMEDIA] ⭐️/10. Old Scarecrow.mp3</Path>
Quote:I branched the jellyfind migrator, that converts windows playlists to linux ..... any suggestions on how to tackle this greatly appreciated.
How dos the original playlist list look before convert,if you can post a sample.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020