DerpyChap / Winamp-Discord-RPC

Reports to Discord your now playing song as a Rich Presence status. Mostly made as a proof of concept.
MIT License
3 stars 1 forks source link

Error while listening to stream #1

Open fixator10 opened 6 years ago

fixator10 commented 6 years ago
λ python winamprpc.py
None
OP Code: 1; Length: 175
Response:
{'cmd': 'DISPATCH', 'data': {'v': 1, 'config': {'cdn_host': 'cdn.discordapp.com', 'api_endpoint': '//canary.discordapp.com/api', 'environment': 'production'}}, 'evt': 'READY', 'nonce': None}

Traceback (most recent call last):
  File "winamprpc.py", line 42, in song_info
    audio = TinyTag.get(filepath)
  File "D:\Program Files\Python36-32\lib\site-packages\tinytag\tinytag.py", line 97, in get
    size = os.path.getsize(filename)
  File "D:\Program Files\Python36-32\lib\genericpath.py", line 50, in getsize
    return os.stat(filename).st_size
OSError: [WinError 123] Синтаксическая ошибка в имени файла, имени папки или метке тома: 'http://animeradio.su:8000/'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "winamprpc.py", line 92, in <module>
    songinfo = song_info(songpath, playlist_pos) #Time to get that tasty metadata.
  File "winamprpc.py", line 46, in song_info
    files = os.listdir(folder)
OSError: [WinError 123] Синтаксическая ошибка в имени файла, имени папки или метке тома: 'http://animeradio.su:8000'

WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect

DerpyChap commented 6 years ago

I figured streams would be an issue, although it was something I was unable to test myself since I don't usually listen to them. If the stream URL is saved to the generated .m3u file Winamp created (which it does seem to be doing) then it might be possible to pull the stream metadata. Otherwise, I can add a fallback method of reading the window title instead.