Created
September 27, 2010 17:50
-
-
Save tlvince/599472 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# lastexport2mpd.py | |
# Copyright 2010 Tom Vincent <http://www.tlvince.com/contact/> | |
import os | |
import sys | |
import time | |
file = sys.path[0] + "/exported_tracks.txt" | |
with open(file) as tracks: | |
with open(sys.path[0] + "/mpd-formatted-tracks.txt", mode='w', encoding='utf-8') as outFile: | |
for line in tracks: | |
timestamp, track, artist, album, trackmbid, artistmbid, albummbid = line.strip("\n").split("\t") | |
timestamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.localtime(int(timestamp))) | |
outFile.write(timestamp + " " + artist + " - " + track + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment