notandy/ympd

Queue display crashes on long entries

kousu opened this issue · 0 comments

kousu commented

I added a huge youtube playlist to mpd thanks to youtube-dl:

$ youtube-dl -gx "https://www.youtube.com/watch?v=m3lF2qEA2cw&list=PLd3udltX2Fih-fkvfbw0zENvao9bm8Awh" | \
   tee youtube-links.txt | \
   mpc add 

I hear the tracks coming out, and mpc and ncmpc can both see and interact with the playlist, but ympd doesn't show a playlist:

capture d ecran le 2018-12-13 a 12 43 06

Looking at the console, I see it's crashing in socket.onmessage:

https://github.com/notandy/ympd/blob/master/htdocs/js/mpd.js#L214-L218

with:

SyntaxError: JSON.parse: bad control character in string literal at line 1 column 102400 of the JSON data

Here is the msg.data that crashes:

msg.data.txt

Notably, there's some nulls that got embedded by (your?) JSON encoder.

Here's that list of streams (in case youtube takes down those videos/blocks youtube-dl again):
youtube-links.txt

You should be able to reproduce this by:

  1. Installing ympd and mpd and mpc and pointing them all at each other as necessary
  2. cat youtube-links.txt | mpc add
  3. mpc playlist and diff youtube-links.txt <(mpc playlist) to verify it loaded correctly
  4. View in ympd to see that the playlist does not load.