def selectLink(self):
     if int(addon.getSetting(u'video_type')) != 0:
         selection = 0
     else:
         dia = xbmcgui.Dialog()
         selection = dia.select(__language__(30055), self.selectionList)
     self.urlList[selection] = clean_safe(urllib.unquote(self.urlList[selection]))
     if self.dkey != None:
         self.dkey = clean_safe(urllib.unquote(self.dkey))
         self.urlList[selection] = sesame.decrypt(self.urlList[selection], self.dkey, 256)
     elif self.decryptList[selection] != None:
         self.decryptList[selection] = clean_safe(urllib.unquote(self.decryptList[selection]))
         self.urlList[selection] = sesame.decrypt(self.urlList[selection], self.decryptList[selection], 256)
     self.link = self.urlList[selection]
     self.videoExtension = u'.' + self.extensionList[selection]
     self.player = self.playerList[selection]
     return None
def parseActions(item, convActions, url = None):
    for convAction in convActions:
        if convAction.find(u"(") != -1:
            print(convAction)
            action = convAction[0:convAction.find(u'(')]
            param = convAction[len(action) + 1:-1]
            print(action)
            print(param)
            if param.find(u', ') != -1:
                params = param.split(u', ')
                print(item[params[0]])
                if action == u'replace':
                    print(params[1])
                    print(params[2])
                    item[params[0]] = item[params[0]].replace(params[1], params[2])
                    print(item[params[0]])
                elif action == u'join':
                    j = []
                    for i in range(1, len(params)):
                        j.append(item[params[i]])
                    item[params[1]] = params[0].join(j)
                elif action == u'decrypt':
                    item[u'match'] = sesame.decrypt(item[params[0]], item[params[1]], 256)
            else:
                if action == u'unquote':
                    item[param] = urllib.unquote(item[param])
                elif action == u'quote':
                    item[param] = urllib.quote(item[param])
                elif action == u'decode':
                    item[param] = decode(item[param])
        else:
            action = convAction
            if action == u'append':
                item[u'url'] = url + item[u'url']
            elif action == u'appendparam':
                if url[-1] == u'?':
                    item[u'url'] = url + item[u'url']
                else:
                    item[u'url'] = url + u'&' + item[u'url']
            elif action == u'replaceparam':
                if url.rfind(u'?') == -1:
                    item[u'url'] = url + u'?' + item[u'url']
                else:
                    item[u'url'] = url[:url.rfind(u'?')] + u'?' + item[u'url']
            elif action == u'striptoslash':
                if url.rfind(u'/'):
                    idx = url.rfind(u'/')
                    if url[:idx + 1] == u'http://':
                        item[u'url'] = url + u'/' + item[u'url']
                    else:
                        item[u'url'] = url[:idx + 1] + item[u'url']
#            elif action == u'space':
#                try:
#                    item[u'title'] = u'  ' + item[u'title'].strip(u' ') + u'  '
#                except:
#                    pass
    return item
Exemplo n.º 3
0
def PlayVideo(sender, url):

	page = HTTP.Request(url, cacheTime=1).content

	video_title = re.search('"video_title":"([^"]+)"', page).group(1)
	video_title = String.Unquote(video_title, usePlus=True)

	video_url = re.search('"quality_\d+p":"([^"]+)"', page).group(1)
	video_url = String.Unquote(video_url, usePlus=True)

	video_url = sesame.decrypt(video_url, video_title, 256)
	#Log('video_url: %s' % video_url)

	return Redirect(VideoItem(video_url))
Exemplo n.º 4
0
def PlayVideo(sender, url):

    page = HTTP.Request(url, cacheTime=1).content

    video_title = re.search('"video_title":"([^"]+)"', page).group(1)
    video_title = String.Unquote(video_title, usePlus=True)

    video_url = re.search('"quality_\d+p":"([^"]+)"', page).group(1)
    video_url = String.Unquote(video_url, usePlus=True)

    video_url = sesame.decrypt(video_url, video_title, 256)
    #Log('video_url: %s' % video_url)

    return Redirect(VideoItem(video_url))
Exemplo n.º 5
0
def playVideo(localpath, handle, url):
    f = urllib2.urlopen(url)
    a = f.read()
    f.close()

    p = re.compile('"video_url":"([^"]+)')
    match = p.findall(a)
    eurl = match[0].replace('\/', '/')

    p2 = re.compile('"video_title":"([^"]+)')
    iv = p2.findall(a)[0]

    video = sesame.decrypt(eurl, iv, 256)
    print "Playing: " + video
    xbmc.Player().play(video)
Exemplo n.º 6
0
def playVideo(localpath, handle, url):
	f=urllib2.urlopen(url)
	a=f.read()
	f.close()

	p=re.compile('"video_url":"([^"]+)')
	match=p.findall(a)
	eurl=match[0].replace('\/', '/')

	p2=re.compile('"video_title":"([^"]+)')
	iv=p2.findall(a)[0]

	video=sesame.decrypt(eurl, iv, 256)
	print "Playing: " + video
	xbmc.Player().play(video)
Exemplo n.º 7
0
def GET_LINK(url, collections):
    # Get the real video link and feed it into XBMC
    print 'GET_LINK URL: %s' % url
    html = get_html(url)
    if collections == 1:  # Make sure we get a url we can parse
        match = re.compile('<link rel="canonical" href="(.+?)" />').findall(
            html)
        for each in match:
            url = each

    if 'xvideos' in url:
        match = re.compile('(http://www.xvideos.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('flv_url=(.+?)&amp').findall(html)
        fetchurl = urllib.unquote(match[0])
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'pornhub' in url:
        match = re.compile('href="([^"]+viewkey[^"]+)"').findall(html)
        html = get_html(match[0])
        match = re.compile('"quality_[^"]+":"([^"]+)"').findall(html)
        fetchurl = urllib2.unquote(match[-1])
        match = re.compile('"video_title":"([^"]+)"').findall(html)
        title = urllib.unquote_plus(match[0])
        fetchurl = sesame.decrypt(fetchurl, title, 256)
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'empflix' in url:
        match = re.compile(
            '<a style="color:#BBB;" href="([^"]+)"'
            ' target="_blank" rel="nofollow">empflix</a></span>').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('name="config" value="([^"]+)"').findall(html)
        for configurl in match:
            linkurl = urllib.unquote(configurl)
        html = get_html(linkurl)
        match2 = re.compile('<videoLink>([^<]+)</videoLink>').findall(html)
        fetchurl = match2[0]
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'tnaflix' in url:
        match = re.compile('iframe src="(http://player[^"]+)').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile(
            'flashvars\.config\s*=\s*escape\("([^"]*)"\);').findall(html)
        for each in match:
            html = get_html(each)
            match = re.compile('<videoLink>([^<]*)').findall(html)
        for each in match:
            fetchurl = each
            print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'xhamster' in url:
        match = re.compile('xhamster.com/movies/(.+?)/').findall(html)
        html = get_html('http://xhamster.com/xembed.php?video=%s' % match[0])
        match = re.compile('srv=(.+?)&image').findall(html)
        fetchurl = match[0].replace('&file', '/key')
        fetchurl = urllib.unquote(fetchurl)
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'xtube' in url:
        match = re.compile('(http://www.xtube.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('videoMp4 = "(.+?)"').findall(html)
        for each in match:
            fetchurl = each.replace('\\', '')
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'deviantclip' in url:
        match = re.compile(
            '<a style="color:#BBB;" href="(.+?)" target="_blank"'
            ' rel="nofollow">deviantclip</a>').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('"file":"(.+?)"').findall(html)
        for each in match:
            fetchurl = urllib.unquote(each)
        return fetchurl
    elif 'redtube' in url:
        match = re.compile('(http://www.redtube.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('flv_h264_url=(.+?)"').findall(html)
        fetchurl = urllib.unquote(match[0])
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'tube8' in url:
        match = re.compile('href="(http://www.tube8.com/[^"]+)"').findall(html)
        html = get_html(match[0])
        match = re.compile('"video_url":"([^"]+)"').findall(html)
        fetchurl = urllib2.unquote(match[0])
        match = re.compile('"video_title":"([^"]+)"').findall(html)
        title = urllib2.unquote(match[0])
        fetchurl = sesame.decrypt(fetchurl, title, 256)
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'you_porn' in url:
        match = re.compile(
            'href="(http://www.youporn.com/watch/[^"]+)"').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('</span><a href="([^"]+mp4[^"]+)">.+?iPad').findall(
            html)
        for each in match:
            fetchurl = each.replace('&amp;', '&')
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    else:
        #Clipnabber
        #get the name of the resource
        r = re.compile('permalink/(.*?)/').findall(url)[0]
        print 'Unknown source (%s). Trying clipnabber' % r

        #get the link
        try:
            gurl = re.compile('<a[^>]+href="(.*?)"[^>]*>%s</a>' %
                              r).findall(html)[0]
            kid = re.compile('id="Math">(\d+)').findall(
                get_html('http://clipnabber.com/mini.php'))[0]
            html = get_html('http://clipnabber.com/gethint.php'
                            '?mode=1&sid=%s&url=%s' %
                            (kid, urllib.quote(gurl)))
            fetchurl = re.compile("<a href='(.*?)'").findall(html)[0]
            print 'Fetchurl: %s' % fetchurl
        except:
            fetchurl = None
        return fetchurl
Exemplo n.º 8
0
def GET_LINK(url, collections, url2):
# Get the real video link and feed it into XBMC
    print 'GET_LINK URL: %s' % url
    html = get_html(url)
    if collections == 1:   # Make sure we get a url we can parse
        match = re.compile('<link rel="canonical" href="(.+?)" />'
                          ).findall(html)
        for each in match:
            url = each

    if 'xvideos' in url2:
        match = re.compile('(http://www.xvideos.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('flv_url=(.+?)&amp').findall(html)
        fetchurl = urllib.unquote(match[0])
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'pornhub' in url2:
        match = re.compile('source="([^"]+)').findall(html)
        html = get_html(match[0])
        match = re.compile('"quality_[^"]+":"([^"]+)"').findall(html)
        fetchurl = urllib2.unquote(match[-1])
        match = re.compile('"video_title":"([^"]+)"').findall(html)
        title = urllib.unquote_plus(match[0])
        fetchurl = sesame.decrypt(fetchurl, title, 256)
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'empflix' in url2:
        match = re.compile('<a style="color:#BBB;" href="([^"]+)"'
                           ' target="_blank" rel="nofollow">empflix</a></span>'
                          ).findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('name="config" value="([^"]+)"').findall(html)
        for configurl in match:
            linkurl = urllib.unquote(configurl)
        html = get_html(linkurl)
        match2 = re.compile('<videoLink>([^<]+)</videoLink>').findall(html)
        fetchurl = match2[0]
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'tnaflix' in url2:
        match = re.compile('iframe src="(http://player[^"]+)').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('flashvars\.config\s*=\s*escape\("([^"]*)"\);'
                          ).findall(html)
        for each in match:
            html = get_html(each)
            match = re.compile('<videoLink>([^<]*)').findall(html)
        for each in match:
            fetchurl = each
            print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'xhamster' in url2:
        match = re.compile('http://xhamster.com/movies/[^"]*').findall(html)
        html = get_html(match[0])
        match = re.compile('file: \'([^\']+)\'').findall(html)
        fetchurl = match[0]
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'hardsextube' in url2:
        match = re.compile(
            'http://www.hardsextube.com/(video/.+?)"').findall(html)
        html = get_html('http://m.hardsextube.com/%s' % match[0])
        match = re.compile('href="(.+?)" .*playVideoLink').findall(html)
        fetchurl = match[0]
        fetchurl = fetchurl.replace(' ', '+')
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'xtube' in url2:
        match = re.compile('(http://www.xtube.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('videoMp4 = "(.+?)"').findall(html)
        for each in match:
            fetchurl = each.replace('\\', '')
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'deviantclip' in url2:
        match = re.compile('<a style="color:#BBB;" href="(.+?)" target="_blank"'
                           ' rel="nofollow">deviantclip</a>').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('"file":"(.+?)"').findall(html)
        for each in match:
            fetchurl = urllib.unquote(each)
        return fetchurl
    elif 'redtube' in url2:
        match = re.compile('(http://www.redtube.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('p=([^&]+)').findall(html)
        fetchurl = urllib.unquote(match[-1]) # get highest quality
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'tube8' in url2:
        match = re.compile('source='
                           '"(http://www.tube8.com/[^"]+)"').findall(html)
        html = get_html(match[0])
        match = re.compile('"video_url":"([^"]+)"').findall(html)
        fetchurl = urllib2.unquote(match[0])
        match = re.compile('"video_title":"([^"]+)"').findall(html)
        title = urllib2.unquote(match[0])
        fetchurl = sesame.decrypt(fetchurl, title, 256)
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'you_porn' in url2:
        match = re.compile('href="(http://www.youporn.com/watch/[^"]+)"'
                          ).findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('video[^>]+src = \'([^\']+mp4[^\']+)\';'
                          ).findall(html)
        for each in match:
            fetchurl = each.replace('&amp;', '&')
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    elif 'madthumbs' in url2:
        match = re.compile('href="(http://www.madthumbs.com/[^"]+)"'
                          ).findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('<source src="([^"]+mp4[^"]+)"').findall(html)
        for each in match:
            fetchurl = each.replace('&amp;', '&')
        print 'fetchurl: %s' % fetchurl
        return fetchurl
    else:
        #Clipnabber
        #get the name of the resource
        r = re.compile('permalink/(.*?)/').findall(url)[0]
        print 'Unknown source (%s). Trying clipnabber' % r

        #get the link
        try:
            gurl = re.compile('<a[^>]+href="(.*?)"[^>]*>%s</a>' % r
                             ).findall(html)[0]
            kid = re.compile('id="Math">(\d+)'
                            ).findall(get_html('http://clipnabber.com/mini.php'
                                              ))[0]
            html = get_html('http://clipnabber.com/gethint.php'
                            '?mode=1&sid=%s&url=%s' % (kid, urllib.quote(gurl)))
            fetchurl = re.compile("<a href='(.*?)'").findall(html)[0]
            print 'Fetchurl: %s' % fetchurl
        except:
            fetchurl = None
        return fetchurl
Exemplo n.º 9
0
def GET_LINK(url, collections, url2):
    # Get the real video link and feed it into XBMC
    xbmc.log('GET_LINK URL: %s' % url)
    html = get_html(url)
    if collections == 1:  # Make sure we get a url we can parse
        match = re.compile('<link rel="canonical" href="(.+?)" />').findall(
            html)
        for each in match:
            url = each

    if 'xvideos' in url2:
        match = re.compile('(http://www.xvideos.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('flv_url=(.+?)&amp').findall(html)
        fetchurl = urllib.unquote(match[0])
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'pornhub' in url2:
        match = re.compile('source="([^"]+)').findall(html)
        html = get_html(match[0])
        match = re.compile('"quality_[^"]+":"([^"]+)"').findall(html)
        fetchurl = urllib2.unquote(match[-1])
        match = re.compile('"video_title":"([^"]+)"').findall(html)
        title = urllib.unquote_plus(match[0])
        fetchurl = sesame.decrypt(fetchurl, title, 256)
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'empflix' in url2:
        match = re.compile(
            '<a style="color:#BBB;" href="([^"]+)"'
            ' target="_blank" rel="nofollow">empflix</a></span>').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('name="config" value="([^"]+)"').findall(html)
        for configurl in match:
            linkurl = urllib.unquote(configurl)
        html = get_html(linkurl)
        match2 = re.compile('<videoLink>([^<]+)</videoLink>').findall(html)
        fetchurl = match2[0]
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'tnaflix' in url2:
        match = re.compile('iframe src="(http://player[^"]+)').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile(
            'flashvars\.config\s*=\s*escape\("([^"]*)"\);').findall(html)
        for each in match:
            html = get_html(each)
            match = re.compile('<videoLink>([^<]*)').findall(html)
        for each in match:
            fetchurl = each
            xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'xhamster' in url2:
        match = re.compile('http://xhamster.com/movies/[^"]*').findall(html)
        html = get_html(match[0])
        match = re.compile('file: \'([^\']+)\'').findall(html)
        fetchurl = match[0]
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'hardsextube' in url2:
        match = re.compile('http://www.hardsextube.com/(video/.+?)"').findall(
            html)
        html = get_html('http://m.hardsextube.com/%s' % match[0])
        match = re.compile('href="(.+?)" .*playVideoLink').findall(html)
        fetchurl = match[0]
        fetchurl = fetchurl.replace(' ', '+')
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'xtube' in url2:
        match = re.compile('(http://www.xtube.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('videoMp4 = "(.+?)"').findall(html)
        for each in match:
            fetchurl = each.replace('\\', '')
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'deviantclip' in url2:
        match = re.compile(
            '<a style="color:#BBB;" href="(.+?)" target="_blank"'
            ' rel="nofollow">deviantclip</a>').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('"file":"(.+?)"').findall(html)
        for each in match:
            fetchurl = urllib.unquote(each)
        return fetchurl
    elif 'redtube' in url2:
        match = re.compile('(http://www.redtube.com/.+?)"').findall(html)
        html = get_html(match[0])
        match = re.compile('p=([^&]+)').findall(html)
        fetchurl = urllib.unquote(match[-1])  # get highest quality
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'tube8' in url2:
        match = re.compile('source='
                           '"(http://www.tube8.com/[^"]+)"').findall(html)
        html = get_html(match[0])
        match = re.compile('page_params.videoUrlJS = "([^"]+)').findall(html)
        fetchurl = urllib2.unquote(match[0])
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'you_porn' in url2:
        match = re.compile(
            'href="(http://www.youporn.com/watch/[^"]+)"').findall(html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('video[^>]+src = \'([^\']+mp4[^\']+)\';').findall(
            html)
        for each in match:
            fetchurl = each.replace('&amp;', '&')
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    elif 'madthumbs' in url2:
        match = re.compile('href="(http://www.madthumbs.com/[^"]+)"').findall(
            html)
        for gurl in match:
            urlget2 = gurl
        html = get_html(urlget2)
        match = re.compile('<source src="([^"]+mp4[^"]+)"').findall(html)
        for each in match:
            fetchurl = each.replace('&amp;', '&')
        xbmc.log('fetchurl: %s' % fetchurl)
        return fetchurl
    else:
        #Clipnabber
        #get the name of the resource
        r = re.compile('permalink/(.*?)/').findall(url)[0]
        xbmc.log('Unknown source (%s). Trying clipnabber' % r)

        #get the link
        try:
            gurl = re.compile('<a[^>]+href="(.*?)"[^>]*>%s</a>' %
                              r).findall(html)[0]
            kid = re.compile('id="Math">(\d+)').findall(
                get_html('http://clipnabber.com/mini.php'))[0]
            html = get_html('http://clipnabber.com/gethint.php'
                            '?mode=1&sid=%s&url=%s' %
                            (kid, urllib.quote(gurl)))
            fetchurl = re.compile("<a href='(.*?)'").findall(html)[0]
            xbmc.log('Fetchurl: %s' % fetchurl)
        except:
            fetchurl = None
        return fetchurl