Esempio n. 1
0
def getHDManifest(video_url):
    Log.Debug("Downloading HD Manifest")
    video_url_parsed = compat_urllib_parse_urlparse(video_url)
    #HTTP.ClearCookies()
    #f4m_url = 'http://hdfauth.francetv.fr/esi/urltokengen2.html?url=%s' % video_url_parsed.path
    f4m_url = 'http://hdfauth.francetv.fr/esi/TA?url=%s' % video_url
    f4m = HTTP.Request(f4m_url,cacheTime=0)
    #HTTP.CookiesForURL(f4m_url) 
    f4m.load()
    a = compat_urllib_parse_urlparse(f4m.content)

    authorized_url = "%s://%s%s?%s" % (a.scheme,a.netloc,a.path.replace('//','/'),a.query)
    Log.Debug("New: %s" % authorized_url)
    return authorized_url
Esempio n. 2
0
def getHDManifest(video_url):
    Log.Debug("Downloading HD Manifest")
    video_url_parsed = compat_urllib_parse_urlparse(video_url)
    #HTTP.ClearCookies()
    #f4m_url = 'http://hdfauth.francetv.fr/esi/urltokengen2.html?url=%s' % video_url_parsed.path
    f4m_url = 'http://hdfauth.francetv.fr/esi/TA?url=%s' % video_url
    f4m = HTTP.Request(f4m_url, cacheTime=0)
    #HTTP.CookiesForURL(f4m_url)
    f4m.load()
    a = compat_urllib_parse_urlparse(f4m.content)

    authorized_url = "%s://%s%s?%s" % (a.scheme, a.netloc,
                                       a.path.replace('//', '/'), a.query)
    Log.Debug("New: %s" % authorized_url)
    return authorized_url
Esempio n. 3
0
def escape_url(url):
    """Escape URL as suggested by RFC 3986"""
    url_parsed = compat_urllib_parse_urlparse(url)
    return url_parsed._replace(
        path=escape_rfc3986(url_parsed.path),
        params=escape_rfc3986(url_parsed.params),
        query=escape_rfc3986(url_parsed.query),
        fragment=escape_rfc3986(url_parsed.fragment)
    ).geturl()
Esempio n. 4
0
 def strip_url_params(self, thumbnail_url):
     o = compat_urllib_parse_urlparse(thumbnail_url)
     return '{scheme}://{host}{path}'.format(scheme=o.scheme,
                                             host=o.netloc,
                                             path=o.path)
Esempio n. 5
0
def url_basename(url):
    path = compat_urllib_parse_urlparse(url).path
    return path.strip('/').split('/')[-1]
Esempio n. 6
0
def url_basename(url):
    path = compat_urllib_parse_urlparse(url).path
    return path.strip('/').split('/')[-1]