How to use the m3u8.getCookieProcessor function in m3u8

To help you get started, we’ve selected a few m3u8 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github epiclabs-io / hls-analyzer / hls-analyzer.py View on Github external
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