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

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