Ejemplo n.º 1
0
def __check_video_list(refer_url,
                       vidlist,
                       add_referer=False,
                       ignore_cookie=False):
    nlist = []
    for item in vidlist:
        try:
            item_url = item[1]
            if add_referer:
                item_url = http.add_referer_url(item_url, refer_url)

            temp_req = http.head_request(item_url)
            if temp_req.status_code != 200:
                print "[*] Skiping Invalid Url: %s - status = %d" % (
                    item[1], temp_req.status_code)
                continue  # Skip Item.

            out_url = temp_req.url
            if ignore_cookie:
                out_url = http.strip_cookie_url(out_url)

            nlist.append((item[0], out_url))
        except Exception, e:
            # Just don't add source.
            pass
def __check_video_list(refer_url, vidlist):
    referer = __set_referer(refer_url)
    nlist = []
    for item in vidlist:
        try:
            temp_req = http.head_request(item[1], set_request=referer)
            nlist.append((item[0], temp_req.url))
        except Exception, e:
            # Just don't add source.
            pass
Ejemplo n.º 3
0
def __check_video_list(refer_url, vidlist):
    referer = __set_referer(refer_url)
    nlist = []
    for item in vidlist:
        try:
            temp_req = http.head_request(item[1], set_request=referer)
            playUrl = "%s|Referer=%s" % (temp_req.url,
                                         urllib.quote_plus(refer_url))
            nlist.append((item[0], playUrl))
        except Exception, e:
            # Just don't add source.
            pass
Ejemplo n.º 4
0
def _prefetch_play_link(link):
    if callable(link):
        link = link()

    if not link:
        return None

    linkInfo = http.head_request(link)
    if linkInfo.status_code != 200:
        raise Exception('could not resolve %s. status_code=%d' %
                        (link, linkInfo.status_code))
    return {
        "url": linkInfo.url,
        "headers": linkInfo.headers,
    }
Ejemplo n.º 5
0
def _prefetch_play_link(link):
    if callable(link):
        link = link()

    if not link:
        return None

    linkInfo = http.head_request(link);
    if linkInfo.status_code != 200:
        raise Exception('could not resolve %s. status_code=%d' %
                        (link, linkInfo.status_code))
    return {
        "url": linkInfo.url,
        "headers": linkInfo.headers,
    }
Ejemplo n.º 6
0
def __extract_openload(url, content):
    splice = lambda s, start, end: s[:start] + s[start + end:]

    ol_id = re.findall('<span[^>]+id=\"[^\"]+\"[^>]*>([0-9a-z]+)</span>',
                       content)[0]
    arrow = ord(ol_id[0])
    pos = arrow - 52
    nextOpen = max(2, pos)
    pos = min(nextOpen, len(ol_id) - 30 - 2)
    part = ol_id[pos:pos + 30]
    arr = [0] * 10
    i = 0
    while i < len(part):
        arr[i / 3] = int(part[i:i + 3], 8)
        i += 3

    chars = [i for i in ol_id]
    chars = splice(chars, pos, 30)

    a = ''.join(chars)
    tagNameArr = []
    i = 0
    n = 0
    while i < len(a):
        text = a[i:i + 2]
        cDigit = a[i:i + 3]
        ch = a[i:i + 4]
        code = int(text, 16)
        i += 2
        if n % 3 is 0:
            code = int(cDigit, 8)
            i += 1
        else:
            if n % 2 is 0:
                if 0 is not n:
                    if ord(a[n - 1][0]) < 60:
                        code = int(ch, 10)
                        i += 2

        val = arr[n % 9]
        code ^= 213
        code ^= val
        tagNameArr.append(chr(code))
        n += 1

    video_url = "https://openload.co/stream/" + ''.join(
        tagNameArr) + "?mime=true"
    return http.head_request(video_url).url
Ejemplo n.º 7
0
def play_source(link):
    if callable(link):
        link = link()

    if link:
        linkInfo = http.head_request(link);
        if linkInfo.status_code != 200:
            raise Exception('could not resolve %s. status_code=%d' %
                            (link, linkInfo.status_code))

        item = xbmcgui.ListItem(path=linkInfo.url)
        if 'Content-Type' in linkInfo.headers:
            item.setProperty('mimetype', linkInfo.headers['Content-Type'])

        xbmcplugin.setResolvedUrl(HANDLE, True, item)
    else:
        xbmcplugin.setResolvedUrl(HANDLE, False, xbmcgui.ListItem())
def __extract_openload(url, content):
    splice = lambda s, start, end: s[:start] + s[start + end:]

    ol_id = re.findall('<span[^>]+id=\"[^\"]+\"[^>]*>([0-9a-z]+)</span>', content)[0]
    arrow = ord(ol_id[0])
    pos = arrow - 52
    nextOpen = max(2, pos)
    pos = min(nextOpen, len(ol_id) - 30 - 2)
    part = ol_id[pos: pos + 30]
    arr = [0] * 10
    i = 0
    while i < len(part):
      arr[i / 3] = int(part[i: i + 3], 8)
      i += 3

    chars = [i for i in ol_id]
    chars = splice(chars, pos, 30)

    a = ''.join(chars)
    tagNameArr = []
    i = 0
    n = 0
    while i < len(a):
      text = a[i: i + 2]
      cDigit = a[i: i + 3]
      ch = a[i: i + 4]
      code = int(text, 16)
      i += 2
      if n % 3 is 0:
        code = int(cDigit, 8)
        i += 1
      else:
        if n % 2 is 0:
          if 0 is not n:
            if ord(a[n - 1][0]) < 60:
              code = int(ch, 10)
              i += 2

      val = arr[n % 9]
      code ^= 213
      code ^= val
      tagNameArr.append(chr(code))
      n += 1

    video_url = "https://openload.co/stream/" + ''.join(tagNameArr) + "?mime=true"
    return http.head_request(video_url).url
def __check_video_list(refer_url, vidlist, add_referer=False,
                       ignore_cookie=False):
    nlist = []
    for item in vidlist:
        try:
            item_url = item[1]
            if add_referer:
                item_url = http.add_referer_url(item_url, refer_url)

            temp_req = http.head_request(item_url)
            if temp_req.status_code != 200:
                print "[*] Skiping Invalid Url: %s - status = %d" % (item[1],
                                                             temp_req.status_code)
                continue # Skip Item.

            out_url = temp_req.url
            if ignore_cookie:
                out_url = http.strip_cookie_url(out_url)

            nlist.append((item[0], out_url))
        except Exception, e:
            # Just don't add source.
            pass