No mor open with, plain fileobject

This commit is contained in:
georg 2020-12-21 22:34:20 +01:00
parent a8ad2c03e7
commit b4988e7299

View file

@ -124,8 +124,10 @@ def record(args):
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()
remotefile = pool.request('GET', streamurl) remotefile = pool.request('GET', streamurl)
if not remotefile.data.decode('utf-8').startswith('#') and len(remotefile.data) > 1: for line in remotefile.data.decode().split():
tmpstr = remotefile.data.decode('utf-8') if not line.startswith('#') and len(line) > 1:
tmpstr = line
break
streamurl = tmpstr streamurl = tmpstr
verboseprint(print_time() + " ... Stream URL: " + streamurl) verboseprint(print_time() + " ... Stream URL: " + streamurl)