No mor open with, plain fileobject
This commit is contained in:
parent
a8ad2c03e7
commit
b4988e7299
1 changed files with 4 additions and 2 deletions
|
@ -124,8 +124,10 @@ def record(args):
|
|||
verboseprint('Seems to be an M3U playlist. Trying to parse...')
|
||||
pool = urllib3.PoolManager()
|
||||
remotefile = pool.request('GET', streamurl)
|
||||
if not remotefile.data.decode('utf-8').startswith('#') and len(remotefile.data) > 1:
|
||||
tmpstr = remotefile.data.decode('utf-8')
|
||||
for line in remotefile.data.decode().split():
|
||||
if not line.startswith('#') and len(line) > 1:
|
||||
tmpstr = line
|
||||
break
|
||||
streamurl = tmpstr
|
||||
|
||||
verboseprint(print_time() + " ... Stream URL: " + streamurl)
|
||||
|
|
Loading…
Reference in a new issue