Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def download_url(uri, httpRange=None):
print("\n\t** Downloading {url}, Range: {httpRange} **".format(url=uri, httpRange=httpRange))
opener = urllib2.build_opener(m3u8.getCookieProcessor())
if(httpRange is not None):
opener.addheaders.append(('Range', httpRange))
response = opener.open(uri)
content = response.read()
response.close()
return content