Exemplo n.º 1
0
def LINK(mname,murl):
        ok=True
        if re.findall('(.+?)\ss(\d+)e(\d+)\s',mname,re.I):
                infoLabels =main.GETMETAEpiT(mname,'','')
                video_type='episode'
                season=infoLabels['season']
                episode=infoLabels['episode']
        elif re.findall('Season(.+?)Episode([^<]+)',mname,re.I):
                infoLabels =main.GETMETAEpiT(mname,'','')
                video_type='episode'
                season=infoLabels['season']
                episode=infoLabels['episode']
        else:
                infoLabels =main.GETMETAT(mname,'','','')
                video_type='movie'
                season=''
                episode=''
        img=infoLabels['cover_url']
        fanart =infoLabels['backdrop_url']
        imdb_id=infoLabels['imdb_id']
        infolabels = { 'supports_meta' : 'true', 'video_type':video_type, 'name':str(infoLabels['title']), 'imdb_id':str(infoLabels['imdb_id']), 'season':str(season), 'episode':str(episode), 'year':str(infoLabels['year']) }
        stream_url = murl
        infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
        # play with bookmark
        player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']),season=str(season), episode=str(episode), year=str(infoLabels['year']),img=img,infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams,imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            wh.add_item(mname+' '+'[COLOR green]DownloadedContent[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_folder=False)
        player.KeepAlive()
        return ok
Exemplo n.º 2
0
def PlayB(name,url):
        ok=True
        hname=name
        name  = name.split('[COLOR blue]')[0]
        name  = name.split('[COLOR red]')[0]
        infoLabels = main.GETMETAT(name,'','','')
        video_type='movie'
        season=''
        episode=''
        img=infoLabels['cover_url']
        fanart =infoLabels['backdrop_url']
        imdb_id=infoLabels['imdb_id']
        infolabels = { 'supports_meta' : 'true', 'video_type':video_type, 'name':str(infoLabels['title']), 'imdb_id':str(infoLabels['imdb_id']), 'season':str(season), 'episode':str(episode), 'year':str(infoLabels['year']) }

        try:
            xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
            stream_url = main.resolve_url(url)

            infoL={'Title': infoLabels['metaName'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']}
            # play with bookmark
            player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']),season=str(season), episode=str(episode), year=str(infoLabels['year']),img=img,infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams,imdb_id=imdb_id)
            #WatchHistory
            if selfAddon.getSetting("whistory") == "true":
                wh.add_item(hname+' '+'[COLOR green]Movie25[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_folder=False)
            player.KeepAlive()
            return ok
        except Exception, e:
            if stream_url != False:
                    main.ErrorReport(e)
            return ok
Exemplo n.º 3
0
def PLAYB(name, url):
    ok = True
    hname = name
    name = name.split('[COLOR blue]')[0]
    name = name.split('[COLOR red]')[0]
    infoLabels = main.GETMETAT(name, '', '', '')
    video_type = 'movie'
    season = ''
    episode = ''
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }

    try:
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,3000)")
        stream_url = urlresolver.resolve(url)

        infoL = {
            'Title': infoLabels['metaName'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        # play with bookmark
        from resources.universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Exemplo n.º 4
0
def Play(url, name):
    codelink = url
    url = base64.b64decode(codelink)
    hostUrl = url
    infoLabels = main.GETMETAT(name, '', '', '')
    videoLink = urlresolver.resolve(hostUrl)
    player = xbmc.Player(xbmc.PLAYER_CORE_AUTO)
    listitem = xbmcgui.ListItem(name)
    listitem.setInfo('video', infoLabels=infoLabels)
    listitem.setThumbnailImage(infoLabels['cover_url'])
    player.play(videoLink, listitem)
    main.addLink('Restart Video ' + name, str(videoLink), '')
    xbmcplugin.endOfDirectory(int(sys.argv[1]))
Exemplo n.º 5
0
def Play(url,name):
        xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)")
        codelink = url
        url = url
        name = name
        hostUrl = url
        infoLabels = main.GETMETAT(name,'','','')
        videoLink = urlresolver.resolve(hostUrl)      
        player = xbmc.Player(xbmc.PLAYER_CORE_AUTO)
        listitem = xbmcgui.ListItem(name)
        listitem.setInfo('video', infoLabels=infoLabels)
        listitem.setThumbnailImage(infoLabels['cover_url'])
        player.play(str(videoLink),listitem)
        main.addLink('Restart Video '+ name,str(videoLink),'')
        xbmcplugin.endOfDirectory(int(sys.argv[1]))
Exemplo n.º 6
0
def PlayB(name, url):
    ok = True
    namelist = []
    urllist = []
    infoLabels = main.GETMETAT(name, '', '', '')
    video_type = 'show'
    season = ''
    episode = ''
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }
    link = main.OPENURL(url)
    link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(
        '&nbsp;', '').replace('\/', '/').replace('\\', '=')
    match = re.compile('url_encoded_fmt_stream_map\":\"(.+?),\"').findall(link)
    if match:
        streams_map = str(match)
        stream = re.compile(
            'url=u003d(.+?)=u0026type=u003d.+?=u0026quality=u003d(.+?),itag'
        ).findall(streams_map)
        for group1, group2 in stream:  #Thanks to the-one for google-doc resolver
            stream_url = str(group1)
            stream_url = unescape(stream_url)
            urllist.append(stream_url)
            stream_qlty = str(group2.upper())
            if (stream_qlty == 'HD720'):
                stream_qlty = 'HD-720p'
            elif (stream_qlty == 'LARGE'):
                stream_qlty = 'SD-480p'
            elif (stream_qlty == 'MEDIUM'):
                stream_qlty = 'SD-360p'
            namelist.append(stream_qlty)
        dialog = xbmcgui.Dialog()
        answer = dialog.select("Quality Select", namelist)
        if answer != -1:
            try:
                xbmc.executebuiltin(
                    "XBMC.Notification(Please Wait!,Resolving Link,3000)")
                stream_url2 = urllist[int(answer)]
                infoL = {
                    'Title': infoLabels['title'],
                    'Plot': infoLabels['plot'],
                    'Genre': infoLabels['genre']
                }
                # play with bookmark
                from resources.universal import playbackengine
                player = playbackengine.PlayWithoutQueueSupport(
                    resolved_url=stream_url2,
                    addon_id=addon_id,
                    video_type=video_type,
                    title=str(infoLabels['title']),
                    season=str(season),
                    episode=str(episode),
                    year=str(infoLabels['year']),
                    img=img,
                    infolabels=infoL,
                    watchedCallbackwithParams=main.WatchedCallbackwithParams,
                    imdb_id=imdb_id)
                player.KeepAlive()
                return ok
            except Exception, e:
                if stream_url != False:
                    main.ErrorReport(e)
        return ok
Exemplo n.º 7
0
def Play(name, url):
    ok = True
    namelist = []
    urllist = []
    infoLabels = main.GETMETAT(name, '', '', '')
    video_type = 'movie'
    season = ''
    episode = ''
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }
    link = main.OPENURL(url)
    link = link.replace('\r',
                        '').replace('\n',
                                    '').replace('\t',
                                                '').replace('&nbsp;', '')
    docUrl = re.compile('class="embeds-video"><iframe src="(.+?)"').findall(
        link)
    if docUrl:
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Collecting Links,3000)")
        link = main.OPENURL(docUrl[0])
        link = link.replace('\r',
                            '').replace('\n', '').replace('\t', '').replace(
                                '&nbsp;', '').replace('\/',
                                                      '/').replace('\\', '=')
        match = re.compile('url_encoded_fmt_stream_map\":\"(.+?),\"').findall(
            link)
        if match:
            streams_map = str(match)
            stream = re.compile(
                'url=u003d(.+?)=u0026type=u003d.+?=u0026quality=u003d(.+?),itag'
            ).findall(streams_map)
            for group1, group2 in stream:  #Thanks to the-one for google-doc resolver
                stream_url = str(group1)
                stream_url = main.unescapes(stream_url)
                urllist.append(stream_url)
                stream_qlty = str(group2.upper())
                if (stream_qlty == 'HD720'):
                    stream_qlty = 'HD-720p'
                elif (stream_qlty == 'LARGE'):
                    stream_qlty = 'SD-480p'
                elif (stream_qlty == 'MEDIUM'):
                    stream_qlty = 'SD-360p'
                namelist.append(stream_qlty)
            dialog = xbmcgui.Dialog()
            answer = dialog.select("Quality Select", namelist)
            if answer != -1:
                xbmc.executebuiltin(
                    "XBMC.Notification(Please Wait!,Opening Link,3000)")
                stream_url2 = urllist[int(answer)]
                infoL = {
                    'Title': infoLabels['title'],
                    'Plot': infoLabels['plot'],
                    'Genre': infoLabels['genre']
                }
                # play with bookmark
                from resources.universal import playbackengine
                player = playbackengine.PlayWithoutQueueSupport(
                    resolved_url=stream_url,
                    addon_id=addon_id,
                    video_type=video_type,
                    title=str(infoLabels['title']),
                    season=str(season),
                    episode=str(episode),
                    year=str(infoLabels['year']),
                    img=img,
                    infolabels=infoL,
                    watchedCallbackwithParams=main.WatchedCallbackwithParams,
                    imdb_id=imdb_id)
                #WatchHistory
                #if selfAddon.getSetting("whistory") == "true":
                #   wh.add_item(mname+' '+'[COLOR green]FilmesOnline2[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False)
                player.KeepAlive()

            return ok
    else:
        xbmc.executebuiltin("XBMC.Notification(Sorry!,Protected Link,5000)")