fixing m3u Problem
This commit is contained in:
parent
a6b3de0c92
commit
ce9f83dc96
1 changed files with 3 additions and 5 deletions
|
@ -123,11 +123,9 @@ def record(args):
|
||||||
if streamurl.endswith('.m3u'):
|
if streamurl.endswith('.m3u'):
|
||||||
verboseprint('Seems to be an M3U playlist. Trying to parse...')
|
verboseprint('Seems to be an M3U playlist. Trying to parse...')
|
||||||
pool = urllib3.PoolManager()
|
pool = urllib3.PoolManager()
|
||||||
with pool.request('GET',streamurl) as remotefile:
|
remotefile = pool.request('GET', streamurl)
|
||||||
for line in remotefile:
|
if not remotefile.data.decode('utf-8').startswith('#') and len(remotefile.data) > 1:
|
||||||
if not line.decode('utf-8').startswith('#') and len(line) > 1:
|
tmpstr = remotefile.data.decode('utf-8')
|
||||||
tmpstr = line.decode('utf-8')
|
|
||||||
break
|
|
||||||
streamurl = tmpstr
|
streamurl = tmpstr
|
||||||
|
|
||||||
verboseprint(print_time() + " ... Stream URL: " + streamurl)
|
verboseprint(print_time() + " ... Stream URL: " + streamurl)
|
||||||
|
|
Loading…
Reference in a new issue