Skip to content

Instantly share code, notes, and snippets.

@galennare
Created October 7, 2017 02:29
Show Gist options
  • Save galennare/58862f16e5c0ca4810d131c4d69bfd88 to your computer and use it in GitHub Desktop.
Save galennare/58862f16e5c0ca4810d131c4d69bfd88 to your computer and use it in GitHub Desktop.
A script I made to parse files out of WMP playlists so I could move them into a new player.
import json
from shutil import copyfile
import os
fil = open("playlist.json")
jstring = json.loads(fil.read())
medialist = jstring['media']
os.mkdir("newplaylist")
for item in medialist:
try:
newfil = item['_src']
except:
continue
print newfil
copyfile(newfil, 'newplaylist/' + newfil[newfil.rfind("\\"):])
@galennare
Copy link
Author

Steps to use:

  1. Create a WMP playlist and dump all of your Groove music songs into it.
  2. Extract the tags ONLY from the wpl file and convert them to JSON.
  3. dump the json into a playlist.json next to the script and run the script
  4. Drop your files into your new media player or playlist.

This script will not overwrite its old folder or files. Be sure to delete the "newplaylist" directory if you're running it multiple times!

@galennare
Copy link
Author

Pardon the hardcoding, I did this late at night.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment