Merge pull request #929 from kingosticks/fix/utf8-chars-in-m3u-playlists
Support utf-8 chars in m3u playlists
This commit is contained in:
commit
378daeb35a
@ -93,6 +93,14 @@ v0.20.0 (UNRELEASED)
|
|||||||
- Add basic tests for the stream library provider.
|
- Add basic tests for the stream library provider.
|
||||||
|
|
||||||
|
|
||||||
|
v0.19.6 (UNRELEASED)
|
||||||
|
====================
|
||||||
|
|
||||||
|
**Audio**
|
||||||
|
|
||||||
|
- Support UTF-8 in M3U playlists. (Fixes: :issue:`853`)
|
||||||
|
|
||||||
|
|
||||||
v0.19.5 (2014-12-23)
|
v0.19.5 (2014-12-23)
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|||||||
@ -58,11 +58,11 @@ def parse_m3u(data):
|
|||||||
# TODO: convert non URIs to file URIs.
|
# TODO: convert non URIs to file URIs.
|
||||||
found_header = False
|
found_header = False
|
||||||
for line in data.readlines():
|
for line in data.readlines():
|
||||||
if found_header or line.startswith('#EXTM3U'):
|
if found_header or line.startswith(b'#EXTM3U'):
|
||||||
found_header = True
|
found_header = True
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
if not line.startswith('#') and line.strip():
|
if not line.startswith(b'#') and line.strip():
|
||||||
yield line.strip()
|
yield line.strip()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ BAD = b'foobarbaz'
|
|||||||
M3U = b"""#EXTM3U
|
M3U = b"""#EXTM3U
|
||||||
#EXTINF:123, Sample artist - Sample title
|
#EXTINF:123, Sample artist - Sample title
|
||||||
file:///tmp/foo
|
file:///tmp/foo
|
||||||
#EXTINF:321,Example Artist - Example title
|
#EXTINF:321,Example Artist - Example \xc5\xa7\xc5\x95
|
||||||
file:///tmp/bar
|
file:///tmp/bar
|
||||||
#EXTINF:213,Some Artist - Other title
|
#EXTINF:213,Some Artist - Other title
|
||||||
file:///tmp/baz
|
file:///tmp/baz
|
||||||
@ -25,7 +25,7 @@ File1=file:///tmp/foo
|
|||||||
Title1=Sample Title
|
Title1=Sample Title
|
||||||
Length1=123
|
Length1=123
|
||||||
File2=file:///tmp/bar
|
File2=file:///tmp/bar
|
||||||
Title2=Example title
|
Title2=Example \xc5\xa7\xc5\x95
|
||||||
Length2=321
|
Length2=321
|
||||||
File3=file:///tmp/baz
|
File3=file:///tmp/baz
|
||||||
Title3=Other title
|
Title3=Other title
|
||||||
@ -40,7 +40,7 @@ ASX = b"""<ASX version="3.0">
|
|||||||
<REF href="file:///tmp/foo" />
|
<REF href="file:///tmp/foo" />
|
||||||
</ENTRY>
|
</ENTRY>
|
||||||
<ENTRY>
|
<ENTRY>
|
||||||
<TITLE>Example title</TITLE>
|
<TITLE>Example \xc5\xa7\xc5\x95</TITLE>
|
||||||
<REF href="file:///tmp/bar" />
|
<REF href="file:///tmp/bar" />
|
||||||
</ENTRY>
|
</ENTRY>
|
||||||
<ENTRY>
|
<ENTRY>
|
||||||
@ -65,7 +65,7 @@ XSPF = b"""<?xml version="1.0" encoding="UTF-8"?>
|
|||||||
<location>file:///tmp/foo</location>
|
<location>file:///tmp/foo</location>
|
||||||
</track>
|
</track>
|
||||||
<track>
|
<track>
|
||||||
<title>Example title</title>
|
<title>Example \xc5\xa7\xc5\x95</title>
|
||||||
<location>file:///tmp/bar</location>
|
<location>file:///tmp/bar</location>
|
||||||
</track>
|
</track>
|
||||||
<track>
|
<track>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user