def play():
    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl') and oInputParameterHandler.exist('sTitle')):
        sUrl = oInputParameterHandler.getValue('sUrl')
        sTitle = oInputParameterHandler.getValue('sTitle')
        
        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        sPattern = 'ake_playlist.php%3Fflv%3D(.*?)%26'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sUrl = URL_GET_STREAM + str(aResult[1][0])
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_NAME)
            oGuiElement.setMediaUrl(sUrl)
            oGuiElement.setTitle(sTitle)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
    return
def play():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl')):
        sUrl = oInputParameterHandler.getValue('sUrl')

        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        sPattern = 'ake_playlist.php%3Fflv%3D(.*?)%26'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
            sUrl = URL_GET_STREAM + str(aResult[1][0])
            
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setMediaUrl(sUrl)

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
        return
    oGui.setEndOfDirectory()
示例#3
0
    def play(self, siteResult=False):
        oGui = cGui()
        logger.info('attempt to play file')
        data = self._getInfoAndResolve(siteResult)
        if not data: return False
        logger.info('play file link: ' + str(data['link']))
        listItem = xbmcgui.ListItem(path=self._addUserAgent(data['link']))
        info = {}
        info['Title'] = data['title']
        if data['thumb']:
            listItem.setThumbnailImage(data['thumb'])
        if data['showTitle']:
            info['Episode'] = data['episode']
            info['Season'] = data['season']
            info['TvShowTitle'] = data['showTitle']
        oPlayer = cPlayer()
        if self.dialog:
            try:
                self.dialog.close()
            except:
                pass
        listItem.setInfo(type="Video", infoLabels=info)
        listItem.setProperty('IsPlayable', 'true')

        pluginHandle = oGui.pluginHandle
        xbmcplugin.setResolvedUrl(pluginHandle, True, listItem)
        res = oPlayer.startPlayer() #Necessary for autoStream
        return res
示例#4
0
    def play(self, siteResult=False):
        oGui = cGui()
        logger.info('attempt to play file')
        data = self._getInfoAndResolve(siteResult)
        if not data: return False
        logger.info('play file link: ' + str(data['link']))
        listItem = xbmcgui.ListItem(path=self._addUserAgent(data['link']))
        info = {}
        info['Title'] = data['title']
        if data['thumb']:
            listItem.setThumbnailImage(data['thumb'])
        if data['showTitle']:
            info['Episode'] = data['episode']
            info['Season'] = data['season']
            info['TvShowTitle'] = data['showTitle']
        oPlayer = cPlayer()
        if self.dialog:
            try:
                self.dialog.close()
            except:
                pass
        listItem.setInfo(type="Video", infoLabels=info)
        listItem.setProperty('IsPlayable', 'true')

        pluginHandle = oGui.pluginHandle
        xbmcplugin.setResolvedUrl(pluginHandle, True, listItem)
        res = oPlayer.startPlayer() #Necessary for autoStream
        return res
示例#5
0
    def addToPlaylist(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call play: ' + sMediaUrl)

        sLink = urlresolver.resolve(sMediaUrl)

        if (sLink != False):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oGui.showInfo('Playlist', 'Stream wurde hinzugefuegt', 5);
            return

        #except:
        #    logger.fatal('could not load plugin: ' + sHosterFileName)

        oGui.setEndOfDirectory()
示例#6
0
def play__():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    #sUrl = '[REGEX]{"url": "([^"]+)"}[URL]http://hdfauthftv-a.akamaihd.net/esi/TA?format=json&url=http%3A%2F%2Flive.francetv.fr%2Fsimulcast%2FFrance_2%2Fhds%2Findex.m3u8&callback=_jsonp_loader_callback_request_2'
    #Special url
    if '[REGEX]' in sUrl:
        sUrl = GetRealUrl(sUrl)
        sUrl = sUrl + '|User-Agent=Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.116 Chrome/48.0.2564.116 Safari/537.36'

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setTitle(sTitle)
    oGuiElement.setMediaUrl(sUrl)
    oGuiElement.setThumbnail(sThumbnail)

    #cConfig().log("Hoster - play " + str(sTitle))
    oPlayer = cPlayer()
    oPlayer.clearPlayList()
    oPlayer.addItemToPlaylist(oGuiElement)
    #tout repetter
    #xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")

    oPlayer.startPlayer()
    return

    oGui.setEndOfDirectory()
示例#7
0
    def __init__(self):

        message = "Add-on: TvWatch2\n"
        message += "Repo: http://tvwatch2.000webhostapp.com/\n"
        message += "\n"
        message += "Afficher la procédure d'installation ?\n"

        if dialog().VSyesno(
                message, "Une nouvelle version de Tvwatch est disponible !"):

            url = 'https://www.youtube.com/watch?v=614nwd3J_x0'
            from resources.hosters.youtube import cHoster
            hote = cHoster()
            hote.setUrl(url)
            api_call = hote.getMediaLink()[1]
            if not api_call:
                return

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName('youtube')
            oGuiElement.setTitle("Procédure d'installation TvWatch2")
            oGuiElement.setMediaUrl(api_call)
            oGuiElement.setThumbnail(oGuiElement.getIcon())

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()

        return
def playAllMovieParts():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('aParts')):
        sParts = oInputParameterHandler.getValue('aParts')
        aParts = eval(sParts)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        for sPartUrl in aParts:
            oHoster = cHosterHandler().getHoster('southpark')
            oHoster.setUrl(sPartUrl)

            aLink = oHoster.getMediaLink()
            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(SITE_IDENTIFIER)
                oGuiElement.setMediaUrl(aLink[1])
                oPlayer.addItemToPlaylist(oGuiElement)

        oPlayer.startPlayer()
        return

    oGui.setEndOfDirectory()
示例#9
0
    def addToPlaylist(self):
        oGui = cGui()

        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        VSlog("Hoster - playlist " + sMediaUrl)
        oHoster = self.getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()

        if (aLink[0] == True):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(aLink[1])
            oGuiElement.setTitle(oHoster.getFileName())

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            self.DIALOG.VSinfo(str(oHoster.getFileName()), 'Playlist')
            return

        oGui.setEndOfDirectory()
示例#10
0
    def play(self):
        #oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call play: ' + sMediaUrl)

        sLink = urlresolver.resolve(sMediaUrl)

        if (sLink != False):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
        return
示例#11
0
    def SearchBA_old(self):
        self.url = 'https://www.youtube.com/results?q=' + self.search + '&sp=EgIYAQ%253D%253D'

        oRequestHandler = cRequestHandler(self.url)
        sHtmlContent = oRequestHandler.request()

        list = re.findall('<a href="\/watch\?v=([^"<>]+)" class=',sHtmlContent)

        if list:
            url = 'http://www.youtube.com/watch?v=' + list[0]
            exec "from resources.hosters.youtube import cHoster"
            hote = cHoster()
            hote.setUrl(url)
            api_call = hote.getMediaLink()[1]
            if not api_call:
                return

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setTitle(self.search.replace('+',' '))
            oGuiElement.setMediaUrl(api_call)
            oGuiElement.setThumbnail(oGuiElement.getIcon())

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()

        return
示例#12
0
def play__():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setTitle(sTitle)
    oGuiElement.setMediaUrl(sUrl)
    oGuiElement.setThumbnail(sThumbnail)

    #cConfig().log("Hoster - play " + str(sTitle))
    oPlayer = cPlayer()
    oPlayer.clearPlayList()
    oPlayer.addItemToPlaylist(oGuiElement)
    #tout repetter
    #xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")
    
    oPlayer.startPlayer()
    return
        
    oGui.setEndOfDirectory()
def playAllMovieParts():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('aParts')):
        sParts = oInputParameterHandler.getValue('aParts')
        aParts = eval(sParts)

        oPlayer = cPlayer()
	oPlayer.clearPlayList()
        for sPartUrl in aParts:
            oHoster = cHosterHandler().getHoster('southpark')
            oHoster.setUrl(sPartUrl)
           
            aLink = oHoster.getMediaLink()            
            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(SITE_IDENTIFIER)
                oGuiElement.setMediaUrl(aLink[1])
                oPlayer.addItemToPlaylist(oGuiElement)
       
        oPlayer.startPlayer()
        return
        
    oGui.setEndOfDirectory()
示例#14
0
    def addToPlaylist(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()
        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if bGetRedirectUrl == 'True':
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        VSlog('Hoster - playlist ' + sMediaUrl)
        oHoster = self.getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()

        if aLink[0]:
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(aLink[1])
            oGuiElement.setTitle(oHoster.getFileName())

            from resources.lib.player import cPlayer
            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            dialog().VSinfo(str(oHoster.getFileName()), 'Playlist')
            return

        oGui.setEndOfDirectory()
示例#15
0
def play__():#Lancer les liens
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl').replace('P_L_U_S', '+')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    #Special url with tag
    if '[' in sUrl and ']' in sUrl:
        sUrl = GetRealUrl(sUrl)

    if 'f4mTester' in sUrl:
        xbmc.executebuiltin('XBMC.RunPlugin(' + sUrl + ')')
        return
    else:
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sTitle)
        sUrl = sUrl.replace(' ','%20')
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        #tout repetter
        xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")

        oPlayer.startPlayer()
        return
示例#16
0
    def SearchBA(self):
        self.url = 'https://www.youtube.com/results?q=' + self.search + '&sp=EgIYAQ%253D%253D'

        oRequestHandler = cRequestHandler(self.url)
        sHtmlContent = oRequestHandler.request()

        list = re.findall('"url":"\/watch\?v=([^"]+)"', sHtmlContent)

        if list:
            url = 'http://www.youtube.com/watch?v=' + list[0]
            exec 'from resources.hosters.youtube import cHoster'
            hote = cHoster()
            hote.setUrl(url)
            api_call = hote.getMediaLink()[1]
            if not api_call:
                return

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setTitle(self.search.replace('+', ' '))
            oGuiElement.setMediaUrl(api_call)
            oGuiElement.setThumbnail(oGuiElement.getIcon())

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()

        return
示例#17
0
def play__():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl').replace('P_L_U_S','+')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    #Special url with tag
    if '[' in sUrl and ']' in sUrl:
        sUrl = GetRealUrl(sUrl)

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setTitle(sTitle)
    sUrl = sUrl.replace(' ','%20')
    oGuiElement.setMediaUrl(sUrl)
    oGuiElement.setThumbnail(sThumbnail)

    #cConfig().log("Hoster - play " + str(sTitle))
    oPlayer = cPlayer()
    oPlayer.clearPlayList()
    oPlayer.addItemToPlaylist(oGuiElement)
    #tout repetter
    #xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")

    oPlayer.startPlayer()
    return

    oGui.setEndOfDirectory()
示例#18
0
    def play(self):
        oGui = cGui()
        oDialog = dialog()

        oInputParameterHandler = cInputParameterHandler()
        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        sTitle = oInputParameterHandler.getValue('title')

        if not sTitle:
            sTitle = sFileName

        if bGetRedirectUrl == 'True':
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        try:
            mediaDisplay = sMediaUrl.split('/')
            VSlog('Hoster - play : %s/ ... /%s' %
                  ('/'.join(mediaDisplay[0:3]), mediaDisplay[-1]))
        except:
            VSlog('Hoster - play : ' + sMediaUrl)

        oHoster = self.getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        sHosterName = oHoster.getDisplayName()
        oDialog.VSinfo(sHosterName, 'Resolve')

        try:

            oHoster.setUrl(sMediaUrl)
            aLink = oHoster.getMediaLink()

            if aLink[0]:
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(self.SITE_NAME)
                oGuiElement.setMediaUrl(aLink[1])
                oGuiElement.setTitle(sTitle)
                oGuiElement.getInfoLabel()

                oPlayer = cPlayer()

                # sous titres ?
                if len(aLink) > 2:
                    oPlayer.AddSubtitles(aLink[2])

                oPlayer.run(oGuiElement, oHoster.getFileName(), aLink[1])
                return
            else:
                oDialog.VSerror(self.ADDON.VSlang(30020))
                return

        except:
            oDialog.VSerror(self.ADDON.VSlang(30020))
            return

        oGui.setEndOfDirectory()
示例#19
0
def play():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl')):
        sUrl = oInputParameterHandler.getValue('sUrl')

        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        sPattern = 'ake_playlist.php%3Fflv%3D(.*?)%26'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            sUrl = URL_GET_STREAM + str(aResult[1][0])

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setMediaUrl(sUrl)

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
        return
    oGui.setEndOfDirectory()
示例#20
0
    def SearchBA_old(self):
        url = 'https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=%s&maxResults=1&relevanceLanguage=fr&key=%s' % (
            self.search, self.key)
        oRequestHandler = cRequestHandler(url)
        sHtmlContent = oRequestHandler.request(jsonDecode=True)

        try:
            ids = result['items'][0]['id']['videoId']

            url = 'http://www.youtube.com/watch?v=%s' % ids
            hote = cHoster()
            hote.setUrl(url)
            api_call = hote.getMediaLink()[1]
            if not api_call:
                return

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setTitle(self.search.replace('+', ' '))
            oGuiElement.setMediaUrl(api_call)
            oGuiElement.setThumbnail(oGuiElement.getIcon())

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()

        except:
            dialog().VSinfo(addon().VSlang(30204))
            return
        return
示例#21
0
def play__():  #Lancer les liens
    # oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl').replace('P_L_U_S', '+')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    #Special url with tag
    if '[' in sUrl and ']' in sUrl:
        sUrl = GetRealUrl(sUrl)

    if 'f4mTester' in sUrl:
        xbmc.executebuiltin('XBMC.RunPlugin(' + sUrl + ')')
        return
    else:
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sTitle)
        sUrl = sUrl.replace(' ', '%20')
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        #tout repetter
        xbmc.executebuiltin('xbmc.playercontrol(RepeatAll)')

        oPlayer.startPlayer()
        return
示例#22
0
    def AddtoDownloadListandview(self):

        oInputParameterHandler = cInputParameterHandler()
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        # sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')

        VSlog('Téléchargement ' + sMediaUrl)

        meta = {}
        meta['url'] = sMediaUrl
        meta['cat'] = oInputParameterHandler.getValue('sCat')
        meta['title'] = sFileName
        meta['icon'] = xbmc.getInfoLabel('ListItem.Art(thumb)')

        if (self.AddDownload(meta)):
            #Si pas de telechargement en cours on lance le notre
            if not self.isDownloading():
                row = cDb().get_Download(meta)
                if row:

                    title = row[0][1]
                    url = urllib.unquote_plus(row[0][2])
                    path = row[0][3]
                    #thumbnail = urllib.unquote_plus(row[0][4])
                    #status = row[0][8]
                    if (self.download(url, title, path, True) == True): #Download in fastmode

                        #ok on attend un peu, et on lance le stream
                        tempo = 100
                        progress_ = progress().VScreate('Bufferisation')

                        while (tempo > 0):
                            #if canceled do nothing
                            if progress_.iscanceled():
                                break
                            progress_.VSupdate(progress_, 100)
                            tempo = tempo - 1
                            xbmc.sleep(500)

                        progress_.VSclose(progress_)

                        oGuiElement = cGuiElement()
                        oGuiElement.setSiteName(SITE_IDENTIFIER)
                        oGuiElement.setMediaUrl(path)
                        oGuiElement.setTitle(title)
                        #oGuiElement.getInfoLabel()

                        oPlayer = cPlayer()

                        if not (sys.argv[ 1 ] == '-1'):
                            oPlayer.run(oGuiElement, title, path)
                        else:
                            oPlayer.clearPlayList()
                            oPlayer.addItemToPlaylist(oGuiElement)
                            oPlayer.startPlayer()

                    else:
                        self.DIALOG.VSinfo('Echec du téléchargement', 'Erreur')
        return
    def addToPlaylist(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue("sMediaUrl")
        bGetRedirectUrl = oInputParameterHandler.getValue("bGetRedirectUrl")
        sFileName = oInputParameterHandler.getValue("sFileName")

        if bGetRedirectUrl == "True":
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info("call play: " + sMediaUrl)

        sLink = urlresolver.resolve(sMediaUrl)

        if sLink != False:
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oGui.showInfo("Playlist", "Stream wurde hinzugefügt", 5)
            return
        oGui.showError("Playlist", "Stream wurde nicht hinzugefügt", 5)
        return False
    def play(self):
        # oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue("sMediaUrl")
        bGetRedirectUrl = oInputParameterHandler.getValue("bGetRedirectUrl")
        sFileName = oInputParameterHandler.getValue("sFileName")

        if bGetRedirectUrl == "True":
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info("call play: " + sMediaUrl)

        sLink = urlresolver.resolve(sMediaUrl)

        if sLink != False:
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
        return
示例#25
0
    def addToPlaylist(self):
        oGui = cGui()

        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        VSlog("Hoster - playlist " + sMediaUrl)
        oHoster = self.getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()

        if (aLink[0] == True):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(aLink[1])
            oGuiElement.setTitle(oHoster.getFileName())

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            self.DIALOG.VSinfo(str(oHoster.getFileName()), 'Playlist')
            return

        oGui.setEndOfDirectory()
示例#26
0
    def play(self, siteResult=False):
        logger.info('attempt to play file')
        data = self._getInfoAndResolve(siteResult)
        if not data:
            return False

        if self.dialog:
            try:
                self.dialog.close()
            except:
                pass

        logger.info('play file link: ' + str(data['link']))
        list_item = xbmcgui.ListItem(path=data['link'])
        info = {'Title': data['title']}
        if data['thumb']:
            list_item.setThumbnailImage(data['thumb'])
        if data['showTitle']:
            info['Episode'] = data['episode']
            info['Season'] = data['season']
            info['TVShowTitle'] = data['showTitle']
        list_item.setInfo(type="Video", infoLabels=info)
        list_item.setProperty('IsPlayable', 'true')

        xbmcplugin.setResolvedUrl(cGui().pluginHandle, True, list_item)
        return cPlayer().startPlayer()
示例#27
0
    def addToPlaylist(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call play: ' + sMediaUrl)

        sLink = urlresolver.resolve(sMediaUrl)

        if (sLink is not False):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oGui.showInfo('Playlist', 'Stream wurde hinzugefügt', 5)
            return
        oGui.showError('Playlist', 'Stream wurde nicht hinzugefügt', 5)
        return False
示例#28
0
    def play(self):
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        noResolve = oInputParameterHandler.getValue('noResolve')
        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call play: ' + sMediaUrl)

        if noResolve == 'True':
            sLink = sMediaUrl
        else:
            try:
                sLink = urlresolver.resolve(sMediaUrl)
                if sLink is False:
                    cGui().showInfo('Info', 'Dead link')
                    return
            except:
                cGui().showError('Error', 'Cannot resolve URL')
                return

        if sLink is not False:
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
        return
def play():
    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl')
            and oInputParameterHandler.exist('sTitle')):
        sUrl = oInputParameterHandler.getValue('sUrl')
        sTitle = oInputParameterHandler.getValue('sTitle')

        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        sPattern = 'ake_playlist.php%3Fflv%3D(.*?)%26'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if aResult[0]:
            sUrl = URL_GET_STREAM + str(aResult[1][0])
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_NAME)
            oGuiElement.setMediaUrl(sUrl)
            oGuiElement.setTitle(sTitle)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
    return
示例#30
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    oParser = cParser()

    sPattern = 'var url = "([^<]+)" +'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        m3url = aResult[1][0]
        m3url = 'http://shoofvod.com' + m3url

        oRequest = cRequestHandler(m3url)
        sHtmlContent = oRequest.request()

    oParser = cParser()
    # (.+?) ([^<]+) .+?
    sPattern = '<iframe src="(.+?)"'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        m3url = aResult[1][0]
        m3url = 'http:' + m3url

        oRequest = cRequestHandler(m3url)
        sHtmlContent = oRequest.request()
    #recup du lien mp4
    sPattern = '<source src="(.+?)" type='
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):

        sUrl = str(aResult[1][0])
        if sUrl.startswith('//'):
            sUrl = 'http:' + sUrl

        #on lance video directement
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sMovieTitle)
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.startPlayer()
        return

    else:
        return

    oGui.setEndOfDirectory()
示例#31
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();

    oParser = cParser()
            
    sPattern =  'href="([^<]+)" class="btn btn-awaanbluebtn btn-viewall">شاهد الآن</a' 
    aResult = oParser.parse(sHtmlContent,sPattern)
    if (aResult[0] == True):
        m3url = aResult[1][0]
        if m3url.startswith('//'):
			m3url = 'http:' + m3url 	
        oRequest = cRequestHandler(m3url)
        sHtmlContent = oRequest.request()

    oParser = cParser()
            
    sPattern =  'id="video_embedd" src="([^<]+)" allowfullscreen=' 
    aResult = oParser.parse(sHtmlContent,sPattern)
    if (aResult[0] == True):
        m3url = aResult[1][0]
        if m3url.startswith('//'):
			m3url = 'http:' + m3url 	
        oRequest = cRequestHandler(m3url)
        sHtmlContent = oRequest.request()
    #recup du lien mp4
    sPattern = 'src: "([^<]+)",'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    
    if (aResult[0] == True):
        
        sUrl = str(aResult[1][0])
        if sUrl.startswith('//'):
			sUrl = 'http:' + sUrl 
                 
        #on lance video directement
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sMovieTitle)
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.startPlayer()
        return
    
    else:
        return

    oGui.setEndOfDirectory()	
示例#32
0
    def play(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        #sThumbnail = oInputParameterHandler.getValue('sThumbnail')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        cConfig().log("Hoster - play " + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        sHosterName = oHoster.getDisplayName()
        cConfig().showInfo(sHosterName, 'Resolve')

        try:

            oHoster.setUrl(sMediaUrl)
            aLink = oHoster.getMediaLink()

            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(self.SITE_NAME)
                oGuiElement.setMediaUrl(aLink[1])
                oGuiElement.setTitle(oHoster.getFileName())
                oGuiElement.getInfoLabel()

                oPlayer = cPlayer()
                oPlayer.run(oGuiElement, oHoster.getFileName(), aLink[1])

                # oGuiElement = cGuiElement()
                # oGuiElement.setSiteName(self.SITE_NAME)
                # oGuiElement.setMediaUrl(aLink[1])
                # oGuiElement.setTitle(oHoster.getFileName())
                # oGuiElement.getInfoLabel()

                # oPlayer = cPlayer()
                # oPlayer.clearPlayList()
                # oPlayer.addItemToPlaylist(oGuiElement)
                # oPlayer.startPlayer()
                return
            else:
                #cConfig().showInfo(sHosterName, 'Fichier introuvable')
                cConfig().error("Fichier introuvable ")
                return

        except:
            #cConfig().showInfo(sHosterName, 'Fichier introuvable')
            cConfig().error("Fichier introuvable ")
            return

        oGui.setEndOfDirectory()
示例#33
0
def play__():  # Lancer les liens
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl').replace('P_L_U_S', '+')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    # Special url with tag
    if '[' in sUrl and ']' in sUrl:
        sUrl = GetRealUrl(sUrl)

    playmode = ''

    if playmode == 0:
        stype = ''
        if '.ts' in sUrl:
            stype = 'TSDOWNLOADER'
        elif '.m3u' in sUrl:
            stype = 'HLS'
        if stype:
            from F4mProxy import f4mProxyHelper
            f4mp = f4mProxyHelper()
            xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=False)
            f4mp.playF4mLink(sUrl,
                             sTitle,
                             proxy=None,
                             use_proxy_for_chunks=False,
                             maxbitrate=0,
                             simpleDownloader=False,
                             auth=None,
                             streamtype=stype,
                             setResolved=False,
                             swf=None,
                             callbackpath="",
                             callbackparam="",
                             iconImage=sThumbnail)
            return

    if 'f4mTester' in sUrl:
        xbmc.executebuiltin('XBMC.RunPlugin(' + sUrl + ')')
        return
    else:
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sTitle)
        sUrl = sUrl.replace(' ', '%20')
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        # tout repetter
        # xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")

        oPlayer.startPlayer()
        return
示例#34
0
    def play(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        #sThumbnail = oInputParameterHandler.getValue('sThumbnail')

        if (bGetRedirectUrl == 'True'):            
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        cConfig().log("Hoster - play " + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        sHosterName = oHoster.getDisplayName()
        cConfig().showInfo(sHosterName, 'Resolve')
        
        try:
        
            oHoster.setUrl(sMediaUrl)
            aLink = oHoster.getMediaLink()

            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(self.SITE_NAME)
                oGuiElement.setMediaUrl(aLink[1])
                oGuiElement.setTitle(oHoster.getFileName())
                oGuiElement.getInfoLabel()
                
                oPlayer = cPlayer()
                oPlayer.run(oGuiElement, oHoster.getFileName(), aLink[1])
                
                # oGuiElement = cGuiElement()
                # oGuiElement.setSiteName(self.SITE_NAME)
                # oGuiElement.setMediaUrl(aLink[1])
                # oGuiElement.setTitle(oHoster.getFileName())
                # oGuiElement.getInfoLabel()
                
                # oPlayer = cPlayer()
                # oPlayer.clearPlayList()
                # oPlayer.addItemToPlaylist(oGuiElement)
                # oPlayer.startPlayer()
                return
            else:
                #cConfig().showInfo(sHosterName, 'Fichier introuvable')
                cConfig().error("Fichier introuvable ")
                return

        except:
            #cConfig().showInfo(sHosterName, 'Fichier introuvable')
            cConfig().error("Fichier introuvable ")
            return

        oGui.setEndOfDirectory()
示例#35
0
    def play(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        sTitle = oInputParameterHandler.getValue('title')
        #sThumbnail = oInputParameterHandler.getValue('sThumbnail')

        if not sTitle:
            sTitle = sFileName

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        VSlog("Hoster - play " + sMediaUrl)

        oHoster = self.getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        sHosterName = oHoster.getDisplayName()
        self.DIALOG.VSinfo(sHosterName, 'Resolve')

        try:

            oHoster.setUrl(sMediaUrl)
            aLink = oHoster.getMediaLink()

            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(self.SITE_NAME)
                oGuiElement.setMediaUrl(aLink[1])
                oGuiElement.setTitle(sTitle)
                #oGuiElement.setTitle(oHoster.getFileName())
                oGuiElement.getInfoLabel()

                oPlayer = cPlayer()

                #sous titres ?
                if len(aLink) > 2:
                    oPlayer.AddSubtitles(aLink[2])

                oPlayer.run(oGuiElement, oHoster.getFileName(), aLink[1])
                return
            else:
                self.DIALOG.VSerror("Fichier introuvable")
                return

        except:
            self.DIALOG.VSerror("Fichier introuvable")
            return

        oGui.setEndOfDirectory()
示例#36
0
    def play(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        sTitle = oInputParameterHandler.getValue('title')
        #sThumbnail = oInputParameterHandler.getValue('sThumbnail')

        if not sTitle:
            sTitle = sFileName

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        VSlog("Hoster - play " + sMediaUrl)

        oHoster = self.getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        sHosterName = oHoster.getDisplayName()
        self.DIALOG.VSinfo(sHosterName, 'Resolve')

        try:

            oHoster.setUrl(sMediaUrl)
            aLink = oHoster.getMediaLink()

            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(self.SITE_NAME)
                oGuiElement.setMediaUrl(aLink[1])
                oGuiElement.setTitle(sTitle)
                #oGuiElement.setTitle(oHoster.getFileName())
                oGuiElement.getInfoLabel()

                oPlayer = cPlayer()

                #sous titres ?
                if len(aLink) > 2:
                    oPlayer.AddSubtitles(aLink[2])

                oPlayer.run(oGuiElement, oHoster.getFileName(), aLink[1])
                return
            else:
                self.DIALOG.VSerror("Fichier introuvable")
                return

        except:
            self.DIALOG.VSerror("Fichier introuvable")
            return

        oGui.setEndOfDirectory()
示例#37
0
def play__():  # Lancer les liens

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl').replace('P_L_U_S', '+')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    # Special url with tag
    if '[' in sUrl and ']' in sUrl:
        sUrl = GetRealUrl(sUrl)
    elif not xbmc.getInfoLabel('system.buildversion')[0:2] >= '19':
        stype = ''
        if '.ts' in sUrl:
            stype = 'TSDOWNLOADER'
        elif '.m3u' in sUrl:
            pass
        if stype:
            from F4mProxy import f4mProxyHelper
            f4mp = f4mProxyHelper()
            xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True)
            f4mp.playF4mLink(sUrl,
                             sTitle,
                             proxy=None,
                             use_proxy_for_chunks=False,
                             maxbitrate=0,
                             simpleDownloader=True,
                             auth=None,
                             streamtype=stype,
                             setResolved=True,
                             swf=None,
                             callbackpath='',
                             callbackparam='',
                             iconImage=sThumbnail)
            return

    if 'dailymotion' in sUrl:
        showDailymotionStream(sUrl, sTitle, sThumbnail)
        return

    if 'f4mTester' in sUrl:
        xbmc.executebuiltin('XBMC.RunPlugin(' + sUrl + ')')
        return

    else:
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sTitle)
        sUrl = sUrl.replace(' ', '%20')
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.startPlayer()
示例#38
0
def showHosters1():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0'

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    oParser = cParser()
    #recup du lien mp4
    sPattern = '<a href="(.+?)" target="_blank"'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        m3url = aResult[1][0]
        oRequest = cRequestHandler(m3url)
        sHtmlContent = oRequest.request()

    oParser = cParser()
    sPattern = '<a href="([^<]+)".+?class="download-link"'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        m3url = aResult[1][0]
        oRequest = cRequestHandler(m3url)
        sHtmlContent = oRequest.request()
# (.+?) .+? ([^<]+)
    sPattern = '<a href="([^<]+)" download class="link btn btn-light"><span '
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):

        sUrl = str(
            aResult[1][0]) + '|AUTH=TLS&verifypeer=false' + '&User-Agent=' + UA

        #on lance video directement
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sMovieTitle)
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.startPlayer()
        return

    else:
        return
    oGui.setEndOfDirectory()
示例#39
0
def showHosters():

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    oParser = cParser()

    sPattern = 'src="(http:\/\/media\.vimple\.me.+?)"'
    aResult = oParser.parse(sHtmlContent, sPattern)

    # 1 seul resultat et sur leur propre hebergeur
    if (aResult[0] == True):

        sUrl2 = aResult[1][0]

        oRequestHandler = cRequestHandler(sUrl2)
        oRequestHandler.addHeaderEntry(
            'User-Agent',
            'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'
        )
        oRequestHandler.addHeaderEntry('Referer', sUrl)
        sHtmlContent = oRequestHandler.request()

        sPattern = 'src: *"(.+?)"'
        aResult = oParser.parse(sHtmlContent, sPattern)

        if not (aResult[0]):
            return

        cGui().showInfo('Info', 'Chargement film', 5)

        web_url = 'http://media.vimple.me/playerk.swf/' + aResult[1][0]

        sHosterUrl = web_url

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sMovieTitle)
        oGuiElement.setMediaUrl(sHosterUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.startPlayer()
示例#40
0
    def addToPlaylist(self, siteResult=False):
        import urlresolver

        oGui = cGui()
        params = ParameterHandler()

        sMediaUrl = params.getValue("sMediaUrl")
        sFileName = params.getValue("MovieTitle")
        if not sFileName:
            sFileName = params.getValue("title")
        if not sFileName:
            sFileName = params.getValue("Title")
        if not sFileName:  # nur vorrübergehend
            sFileName = params.getValue("sMovieTitle")
        if not sFileName:
            sFileName = params.getValue("title")
        sSeason = params.getValue("season")
        sEpisode = params.getValue("episode")
        sShowTitle = params.getValue("TvShowTitle")
        sThumbnail = params.getValue("thumb")
        if siteResult:
            sMediaUrl = siteResult["streamUrl"]
            if siteResult["resolved"]:
                sLink = sMediaUrl
            else:
                sLink = urlresolver.resolve(sMediaUrl)
        else:
            sLink = urlresolver.resolve(sMediaUrl)
        logger.info("call addToPlaylist: " + sMediaUrl)
        logger.info("file link: " + str(sLink))
        if sLink != False:
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)
            if sThumbnail:
                oGuiElement.setThumbnail(sThumbnail)
            if sShowTitle:
                oGuiElement.addItemProperties("Episode", sEpisode)
                oGuiElement.addItemProperties("Season", sSeason)
                oGuiElement.addItemProperties("TvShowTitle", sShowTitle)
            if self.dialog:
                self.dialog.close()
            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oGui.showInfo("Playlist", "Stream wurde hinzugefügt", 5)
        else:
            # oGui.showError('Playlist', 'File deleted or Link could not be resolved', 5);
            return False
        return True
示例#41
0
    def addToPlaylist(self, siteResult = False):
        import urlresolver
        oGui = cGui()
        params = ParameterHandler()

        sMediaUrl = params.getValue('sMediaUrl')
        sFileName = params.getValue('MovieTitle')
        if not sFileName:
            sFileName = params.getValue('title')
        if not sFileName:
            sFileName = params.getValue('Title')
        if not sFileName: #nur vorrübergehend
            sFileName = params.getValue('sMovieTitle')
        if not sFileName:
            sFileName = params.getValue('title')
        sSeason = params.getValue('season')
        sEpisode = params.getValue('episode')
        sShowTitle = params.getValue('TvShowTitle')
        sThumbnail = params.getValue('thumb')
        if siteResult:
            sMediaUrl = siteResult['streamUrl']
            if siteResult['resolved']:
                sLink = sMediaUrl
            else:
                sLink = urlresolver.resolve(sMediaUrl)
        else:
            sLink = urlresolver.resolve(sMediaUrl)
        logger.info('call addToPlaylist: ' + sMediaUrl)
        logger.info('file link: ' + str(sLink))
        if (sLink != False):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)
            if sThumbnail:
                oGuiElement.setThumbnail(sThumbnail)
            if sShowTitle:
                oGuiElement.addItemProperties('Episode',sEpisode)
                oGuiElement.addItemProperties('Season',sSeason)
                oGuiElement.addItemProperties('TvShowTitle',sShowTitle)
            if self.dialog:
                self.dialog.close()
            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oGui.showInfo('Playlist', 'Stream wurde hinzugefügt', 5);
        else:
            #oGui.showError('Playlist', 'File deleted or Link could not be resolved', 5);
            return False
        return True
示例#42
0
    def addToPlaylist(self, siteResult=False):
        import urlresolver
        oGui = cGui()
        params = ParameterHandler()

        sMediaUrl = params.getValue('sMediaUrl')
        sFileName = params.getValue('MovieTitle')
        if not sFileName:
            sFileName = params.getValue('title')
        if not sFileName:
            sFileName = params.getValue('Title')
        if not sFileName:  #nur vorrübergehend
            sFileName = params.getValue('sMovieTitle')
        if not sFileName:
            sFileName = params.getValue('title')
        sSeason = params.getValue('season')
        sEpisode = params.getValue('episode')
        sShowTitle = params.getValue('TvShowTitle')
        sThumbnail = params.getValue('thumb')
        if siteResult:
            sMediaUrl = siteResult['streamUrl']
            if siteResult['resolved']:
                sLink = sMediaUrl
            else:
                sLink = urlresolver.resolve(sMediaUrl)
        else:
            sLink = urlresolver.resolve(sMediaUrl)
        logger.info('call addToPlaylist: ' + sMediaUrl)
        logger.info('file link: ' + str(sLink))
        if (sLink != False):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)
            if sThumbnail:
                oGuiElement.setThumbnail(sThumbnail)
            if sShowTitle:
                oGuiElement.addItemProperties('Episode', sEpisode)
                oGuiElement.addItemProperties('Season', sSeason)
                oGuiElement.addItemProperties('TvShowTitle', sShowTitle)
            if self.dialog:
                self.dialog.close()
            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oGui.showInfo('Playlist', 'Stream wurde hinzugefügt', 5)
        else:
            #oGui.showError('Playlist', 'File deleted or Link could not be resolved', 5);
            return False
        return True
示例#43
0
    def ReadDownload(self):
        oInputParameterHandler = cInputParameterHandler()
        path = oInputParameterHandler.getValue('sPath')
        sTitle = oInputParameterHandler.getValue('sMovieTitle')

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setMediaUrl(path)
        oGuiElement.setTitle(sTitle)
        #oGuiElement.getInfoLabel()
        
        oPlayer = cPlayer()
        #oPlayer.clearPlayList()
        #oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.run(oGuiElement, sTitle, path)
示例#44
0
def showHosters():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    oParser = cParser()

    sPattern = 'iframe width=".+?" height=".+?" scrolling="false" frameborder="0" src="([^<]+)" allowfullscreen>'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        m3url = aResult[1][0]
        if m3url.startswith('//'):
            m3url = 'https:' + m3url
        oRequest = cRequestHandler(m3url)
        sHtmlContent = oRequest.request()
    #recup du lien mp4
    sPattern = "hls: '(.+?)'"

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):

        sUrl = str(aResult[1][0])

        #on lance video directement
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sMovieTitle)
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.startPlayer()
        return

    else:
        return

    oGui.setEndOfDirectory()
示例#45
0
    def SearchBA(self, window=False):

        sTitle = self.search + ' - Bande Annonce'

        # Le lien sur la BA est déjà connu
        urlTrailer = self.sTrailerUrl

        # Sinon recherche de la BA officielle dans TMDB
        if not urlTrailer:
            meta = cTMDb().get_meta(self.metaType, self.search, year=self.year)
            if 'trailer' in meta and meta['trailer']:
                self.SetTrailerUrl(meta['trailer'])
                urlTrailer = self.sTrailerUrl

        # Sinon recherche dans youtube
        if not urlTrailer:
            urlTrailer2 = 'https://www.youtube.com/results?q=' + QuotePlus(
                sTitle) + '&sp=EgIYAQ%253D%253D'

            oRequestHandler = cRequestHandler(urlTrailer2)
            sHtmlContent = oRequestHandler.request()

            listResult = re.findall('"url":"\/watch\?v=([^"]+)"', sHtmlContent)
            if listResult:
                # Premiere video trouvée
                urlTrailer = 'http://www.youtube.com/watch?v=' + listResult[0]

        # BA trouvée
        if urlTrailer:
            hote = cHoster()
            hote.setUrl(urlTrailer)
            hote.setResolution('720p')
            api_call = hote.getMediaLink()[1]
            if not api_call:
                return

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setTitle(sTitle)
            oGuiElement.setMediaUrl(api_call)
            oGuiElement.setThumbnail(oGuiElement.getIcon())

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer(window)

        return
示例#46
0
def showHosters():

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    
    oParser = cParser()

    sPattern = 'src="(http:\/\/media\.vimple\.me.+?)"'
    aResult = oParser.parse(sHtmlContent, sPattern)

    # 1 seul resultat et sur leur propre hebergeur
    if (aResult[0] == True):
        
        sUrl2 = aResult[1][0]

        oRequestHandler = cRequestHandler(sUrl2)
        oRequestHandler.addHeaderEntry('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0')
        oRequestHandler.addHeaderEntry('Referer',sUrl)
        sHtmlContent = oRequestHandler.request()
        
        sPattern = 'src: *"(.+?)"'
        aResult = oParser.parse(sHtmlContent, sPattern)

        if not (aResult[0]):
            return
            
        cGui().showInfo('Info', 'Chargement film' , 5)
            
        web_url = 'http://media.vimple.me/playerk.swf/' + aResult[1][0]
            
        sHosterUrl = web_url

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sMovieTitle)
        oGuiElement.setMediaUrl(sHosterUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        oPlayer.startPlayer()
示例#47
0
def play__():#Lancer les liens
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl').replace('P_L_U_S', '+')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    #Special url with tag
    if '[' in sUrl and ']' in sUrl:
        sUrl = GetRealUrl(sUrl)

    playmode = ''

    if playmode == 0:
        stype = ''
        if '.ts' in sUrl:
            stype = 'TSDOWNLOADER'
        elif '.m3u' in sUrl:
            stype = 'HLS'
        if stype:
            from F4mProxy import f4mProxyHelper
            f4mp=f4mProxyHelper()
            xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=False)
            f4mp.playF4mLink(sUrl, sTitle, proxy=None, use_proxy_for_chunks=False, maxbitrate=0, simpleDownloader=False, auth=None, streamtype=stype, setResolved=False, swf=None, callbackpath="", callbackparam="", iconImage=sThumbnail)
            return

    if 'f4mTester' in sUrl:
        xbmc.executebuiltin('XBMC.RunPlugin(' + sUrl + ')')
        return
    else:
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setTitle(sTitle)
        sUrl = sUrl.replace(' ','%20')
        oGuiElement.setMediaUrl(sUrl)
        oGuiElement.setThumbnail(sThumbnail)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        oPlayer.addItemToPlaylist(oGuiElement)
        #tout repetter
        #xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")

        oPlayer.startPlayer()
        return
示例#48
0
    def play(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):            
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call play: ' + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        sHosterName = oHoster.getDisplayName()
        cConfig().showInfo(sHosterName, 'Resolve')

        try:
        
            oHoster.setUrl(sMediaUrl)
            aLink = oHoster.getMediaLink()

            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(self.SITE_NAME)
                oGuiElement.setMediaUrl(aLink[1])
                oGuiElement.setTitle(oHoster.getFileName())

                oPlayer = cPlayer()
                oPlayer.clearPlayList()
                oPlayer.addItemToPlaylist(oGuiElement)
                oPlayer.startPlayer()
                return
            else:
                cConfig().showInfo(sHosterName, 'Fichier introuvable')
                return

        except:
            cConfig().showInfo(sHosterName, 'Fichier introuvable')
            return

        oGui.setEndOfDirectory()
示例#49
0
def play():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('siteTitle')
    
    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setTitle(sTitle)
    oGuiElement.setMediaUrl(sUrl)

    oPlayer = cPlayer()
    oPlayer.clearPlayList()
    oPlayer.addItemToPlaylist(oGuiElement)
    oPlayer.startPlayer()
    return
        
    oGui.setEndOfDirectory()
def showHosters():
   
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail  = oInputParameterHandler.getValue('sThumbnail')
   
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
     
    url = ''
   
    oParser = cParser()
    sPattern = 'document.write\(unescape\("(.+?)"\)\);'
    aResult = oParser.parse(sHtmlContent, sPattern)
   
    if (aResult[0] == True):
        chainedecrypte = urllib.unquote(aResult[1][0])
        sPattern = 'file: "(http.+?mp4)"'
        aResult = re.findall(sPattern,chainedecrypte)
        if (aResult):
            url = aResult[0]
   
    #dialogue final
    if (url):
 
        sHosterUrl = str(url)
        oHoster = cHosterGui().checkHoster(sHosterUrl)
       
        if (oHoster != False):
            sHosterUrl = sHosterUrl + '|Referer='+ sUrl.replace(URL_MAIN,'http://www.hd-stream.in/')
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setTitle(sMovieTitle)
            oGuiElement.setMediaUrl(sHosterUrl)
            oGuiElement.setThumbnail(sThumbnail)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
def showHosters():

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue("siteUrl")
    sMovieTitle = oInputParameterHandler.getValue("sMovieTitle")
    sThumbnail = oInputParameterHandler.getValue("sThumbnail")

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    url = ""

    oParser = cParser()
    sPattern = 'document.write\(unescape\("(.+?)"\)\);'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if aResult[0] == True:
        chainedecrypte = urllib.unquote(aResult[1][0])
        sPattern = 'file: "(http.+?mp4)"'
        aResult = re.findall(sPattern, chainedecrypte)
        if aResult:
            url = aResult[0]

    # dialogue final
    if url:

        sHosterUrl = str(url)
        oHoster = cHosterGui().checkHoster(sHosterUrl)

        if oHoster != False:
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setTitle(sMovieTitle)
            oGuiElement.setMediaUrl(sHosterUrl)
            oGuiElement.setThumbnail(sThumbnail)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
示例#52
0
    def SearchBA(self):

            url = "https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=%s&maxResults=1&relevanceLanguage=fr&key=%s" % (self.search, self.key)

            req = urllib2.Request(url)
            try:
                gcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
                response = urllib2.urlopen(req,context=gcontext)
            except:
                response = urllib2.urlopen(req)
            sHtmlContent = response.read()
            result = json.loads(sHtmlContent)
            response.close()

            try:
                ids = result['items'][0]['id']['videoId']

                url = 'http://www.youtube.com/watch?v=%s' % ids
                from resources.hosters.youtube import cHoster
                hote = cHoster()
                hote.setUrl(url)
                api_call = hote.getMediaLink()[1]
                if not api_call:
                    return

                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(SITE_IDENTIFIER)
                oGuiElement.setTitle(self.search.replace('+',' '))
                oGuiElement.setMediaUrl(api_call)
                oGuiElement.setThumbnail(oGuiElement.getIcon())

                oPlayer = cPlayer()
                oPlayer.clearPlayList()
                oPlayer.addItemToPlaylist(oGuiElement)
                oPlayer.startPlayer()

            except:
                dialog().VSinfo(addon().VSlang(30204))
                return
            return
示例#53
0
def play():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue("siteUrl")
    sTitle = oInputParameterHandler.getValue("sMovieTitle")
    sThumbnail = oInputParameterHandler.getValue("sThumbnail")

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setTitle(sTitle)
    oGuiElement.setMediaUrl(sUrl)
    oGuiElement.setThumbnail(sThumbnail)

    # cConfig().log("Hoster - play " + str(sTitle))
    oPlayer = cPlayer()
    oPlayer.clearPlayList()
    oPlayer.addItemToPlaylist(oGuiElement)
    oPlayer.startPlayer()
    return

    oGui.setEndOfDirectory()
示例#54
0
    def addToPlaylist(self, siteResult = False):
        oGui = cGui()
        logger.info('attempt addToPlaylist')
        data = self._getInfoAndResolve(siteResult)
        if not data: return False

        logger.info('addToPlaylist file link: ' + str(data['link']))
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(self.SITE_NAME)
        oGuiElement.setMediaUrl(data['link'])
        oGuiElement.setTitle(data['title'])
        if data['thumb']:
            oGuiElement.setThumbnail(data['thumb'])
        if data['showTitle']:
            oGuiElement.setEpisode(data['episode'])
            oGuiElement.setSeason(data['season'])
            oGuiElement.setTVShowTitle(data['showTitle'])
        if self.dialog:
            self.dialog.close()
        oPlayer = cPlayer()
        oPlayer.addItemToPlaylist(oGuiElement)
        oGui.showInfo('Playlist', 'Stream wurde hinzugefügt', 5);
        return True
示例#55
0
    def addToPlaylist(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        cConfig().log("Hoster - play " + sMediaUrl)
        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        #try:

        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()

        if (aLink[0] == True):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(aLink[1])
            oGuiElement.setTitle(oHoster.getFileName())

            oPlayer = cPlayer()
            oPlayer.addItemToPlaylist(oGuiElement)
            oGui.showInfo('Playlist', str(oHoster.getFileName()), 5);
            return

        #except:
        # cConfig().log("could not load plugin " + sHosterFileName)

        oGui.setEndOfDirectory()
    def play(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):            
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call play: ' + sMediaUrl)
        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        #try:
        
        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()
        
        if (aLink[0] == True):
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(aLink[1])
	    oGuiElement.setTitle(oHoster.getFileName())

            oPlayer = cPlayer()
	    oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
            return

        #except:
        #    logger.fatal('could not load plugin: ' + sHosterFileName)

        oGui.setEndOfDirectory()
示例#57
0
 def play(self, siteResult=False):
     oGui = cGui()
     oInputParameterHandler = ParameterHandler()
     sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
     sFileName = oInputParameterHandler.getValue('sFileName')
     if not sFileName:
         sFileName = oInputParameterHandler.getValue('Title')
     if not sFileName:
         sFileName = oInputParameterHandler.getValue('title')
     if not sFileName: #nur vorrübergehend
         sFileName = oInputParameterHandler.getValue('sMovieTitle')
     sSeason = oInputParameterHandler.getValue('season')
     sEpisode = oInputParameterHandler.getValue('episode')
     sShowTitle = oInputParameterHandler.getValue('TvShowTitle')
     sThumbnail = oInputParameterHandler.getValue('thumb')       
     if siteResult:
         sMediaUrl = siteResult['streamUrl']
         logger.info('call play: ' + sMediaUrl)
         if siteResult['resolved']:
             sLink = sMediaUrl
         else:
             try:
                 sLink = urlresolver.resolve(sMediaUrl)
             except:
                 sLink = False
                 #raise
     elif sMediaUrl:
         logger.info('call play: ' + sMediaUrl)
         sLink = urlresolver.resolve(sMediaUrl)
     else:
         oGui.showError('xStream', 'Hosterlink not found', 5)
         return False
     if sLink != False:            
         logger.info('file link: ' + sLink)
         oGuiElement = cGuiElement()
         oGuiElement.setSiteName(self.SITE_NAME)
         oGuiElement.setMediaUrl(sLink)
         oGuiElement.setTitle(sFileName)
         if sThumbnail:
             oGuiElement.setThumbnail(sThumbnail)
         if sShowTitle:
             oGuiElement.addItemProperties('Episode',sEpisode)
             oGuiElement.addItemProperties('Season',sSeason)
             oGuiElement.addItemProperties('TvShowTitle',sShowTitle)
         #listItem = xbmcgui.ListItem(path=sLink)
         #listItem.setProperty('IsPlayable', 'true')
         #pluginHandle = cPluginHandler().getPluginHandle()
         #return xbmcplugin.setResolvedUrl(pluginHandle, True, listItem)
         oPlayer = cPlayer()
         oPlayer.clearPlayList()
         oPlayer.addItemToPlaylist(oGuiElement)
         if self.dialog:
             try:
                 self.dialog.close()
             except:
                 pass
         oPlayer.startPlayer()
     else:
         logger.info('file link: ' + str(sLink))
         oGui.showError('xStream', 'File deleted or Link could not be resolved', 5)
         return False
     return True