AbyssHunted
New Member
Had an issue with this tool. It would crash whenever I was playing any file in VLC that had Unicode characters in its meta-data.
Fortunately, was able to fix the problem by modifying 5 lines of python code.
If you could publish a fixed version of the tool, I'm sure other folks might appreciate it.
Details on the code fixes below.
Fortunately, was able to fix the problem by modifying 5 lines of python code.
If you could publish a fixed version of the tool, I'm sure other folks might appreciate it.
Details on the code fixes below.
1)Change
import os, time, datetime, requests
to
import os, time, datetime, requests, codecs
2)Change
root = ET.fromstring(r.text)
to
root = ET.fromstring(r.content)
3)Change
print(currentSongInfo)
to
print(currentSongInfo.encode('utf-8', 'ignore'))
4)Change
textFile = open('NowPlaying.txt', 'w')
to
textFile = codecs.open('NowPlaying.txt', 'w', encoding='utf-8', errors='ignore')
5)Change
textFile = open('NowPlaying_History.txt', 'a')
to
textFile = codecs.open('NowPlaying_History.txt', 'a', encoding='utf-8', errors='ignore')
import os, time, datetime, requests
to
import os, time, datetime, requests, codecs
2)Change
root = ET.fromstring(r.text)
to
root = ET.fromstring(r.content)
3)Change
print(currentSongInfo)
to
print(currentSongInfo.encode('utf-8', 'ignore'))
4)Change
textFile = open('NowPlaying.txt', 'w')
to
textFile = codecs.open('NowPlaying.txt', 'w', encoding='utf-8', errors='ignore')
5)Change
textFile = open('NowPlaying_History.txt', 'a')
to
textFile = codecs.open('NowPlaying_History.txt', 'a', encoding='utf-8', errors='ignore')
Last edited: