コード例 #1
0
def DownloaderCreator(url):
    printDBG("DownloaderCreator url[%r]" % url)
    downloader = None

    url = urlparser.decorateUrl(url)
    iptv_proto = url.meta.get('iptv_proto', '')
    if 'm3u8' == iptv_proto:
        if config.plugins.iptvplayer.hlsdl_download.value:
            downloader = HLSDownloader()
        else:
            downloader = M3U8Downloader()
    elif 'em3u8' == iptv_proto:
        if config.plugins.iptvplayer.hlsdl_download.value:
            downloader = EHLSDownloader()
        else:
            downloader = EM3U8Downloader()
    elif 'f4m' == iptv_proto:
        downloader = F4mDownloader()
    elif 'rtmp' == iptv_proto:
        downloader = RtmpDownloader()
    elif iptv_proto in ['https', 'http']:
        downloader = WgetDownloader()
    elif 'merge' == iptv_proto:
        if url.meta.get('prefered_merger') == 'hlsdl' and config.plugins.iptvplayer.hlsdl_download.value and config.plugins.iptvplayer.prefer_hlsdl_for_pls_with_alt_media.value:
            downloader = HLSDownloader()
        elif IsExecutable('ffmpeg'):
            downloader = FFMPEGDownloader()
        else:
            downloader = MergeDownloader()
    elif 'mpd' == iptv_proto and IsExecutable('ffmpeg'):
        downloader = FFMPEGDownloader()
    
    return downloader
コード例 #2
0
def DownloaderCreator(url):
    printDBG("DownloaderCreator url[%r]" % url)
    downloader = None

    url = urlparser.decorateUrl(url)
    iptv_proto = url.meta.get('iptv_proto', '')
    if 'm3u8' == iptv_proto:
        if config.plugins.iptvplayer.hlsdlpath.value != '':
            downloader = HLSDownloader()
        else:
            downloader = M3U8Downloader()
    elif 'em3u8' == iptv_proto:
        if config.plugins.iptvplayer.hlsdlpath.value != '':
            downloader = EHLSDownloader()
        else:
            downloader = EM3U8Downloader()
    elif 'f4m' == iptv_proto:
        downloader = F4mDownloader()
    elif 'rtmp' == iptv_proto:
        downloader = RtmpDownloader()
    elif iptv_proto in ['https', 'http']:
        downloader = WgetDownloader()
    elif 'merge' == iptv_proto:
        if IsExecutable('ffmpeg') and config.plugins.iptvplayer.cmdwrappath.value != '':
            downloader = FFMPEGDownloader()
        else:
            downloader = MergeDownloader()
    elif 'mpd' == iptv_proto and IsExecutable('ffmpeg') and config.plugins.iptvplayer.cmdwrappath.value != '':
        downloader = FFMPEGDownloader()
    
    return downloader
コード例 #3
0
 def isDashAllowed():
     value = config.plugins.iptvplayer.ytShowDash.value
     printDBG('ALLOW DASH: >> %s' % value)
     if value == 'true' and IsExecutable('ffmpeg'):
         return True
     elif value == 'auto' and IsExecutable('ffmpeg') and IsExecutable(config.plugins.iptvplayer.exteplayer3path.value):
         return True
     else:
         return False
コード例 #4
0
 def isDashAllowed():
     value = config.plugins.iptvplayer.ytShowDash.value
     printDBG("ALLOW DASH: >> %s" % value)
     if value == "true" and IsExecutable('ffmpeg'):
         return True
     elif value == "auto" and IsExecutable('ffmpeg'):
         return True
     else:
         return False
コード例 #5
0
def runMain(session, nextFunction=doRunMain):
    wgetpath     = IsExecutable(config.plugins.iptvplayer.wgetpath.value)
    rtmpdumppath = IsExecutable(config.plugins.iptvplayer.rtmpdumppath.value)
    f4mdumppath  = IsExecutable(config.plugins.iptvplayer.f4mdumppath.value)
    platform     = config.plugins.iptvplayer.plarform.value
    if platform in ["auto", "unknown"] or not wgetpath or not rtmpdumppath or not f4mdumppath:
        session.openWithCallback(boundFunction(nextFunction, session), IPTVSetupMainWidget)
    elif IPTVPlayerNeedInit():
        session.openWithCallback(boundFunction(nextFunction, session), IPTVSetupMainWidget, True)
    else:
        nextFunction(session)
コード例 #6
0
def GetConfigList():
    optionList = []
    optionList.append(
        getConfigListEntry(_("Sort by:"), config.plugins.iptvplayer.ytSortBy))
    optionList.append(
        getConfigListEntry(_("Path to ytlist.txt, urllist.txt"),
                           config.plugins.iptvplayer.Sciezkaurllist))
    optionList.append(
        getConfigListEntry(_("Video format:"),
                           config.plugins.iptvplayer.ytformat))
    optionList.append(
        getConfigListEntry(_("Default video quality:"),
                           config.plugins.iptvplayer.ytDefaultformat))
    optionList.append(
        getConfigListEntry(_("Use default video quality:"),
                           config.plugins.iptvplayer.ytUseDF))
    optionList.append(
        getConfigListEntry(_("Age-gate bypass:"******"Allow dash format:"),
                               config.plugins.iptvplayer.ytShowDash))
    return optionList
コード例 #7
0
ファイル: hostyoutube.py プロジェクト: khaled2358/e2iPlayer
def GetConfigList():
    optionList = []
    optionList.append(
        getConfigListEntry(_("Sort by:"), config.plugins.iptvplayer.ytSortBy))
    optionList.append(
        getConfigListEntry(_("Path to ytlist.txt, urllist.txt"),
                           config.plugins.iptvplayer.Sciezkaurllist))
    optionList.append(
        getConfigListEntry(_("Video format:"),
                           config.plugins.iptvplayer.ytformat))
    optionList.append(
        getConfigListEntry(_("Default video quality:"),
                           config.plugins.iptvplayer.ytDefaultformat))
    optionList.append(
        getConfigListEntry(_("Use default video quality:"),
                           config.plugins.iptvplayer.ytUseDF))
    optionList.append(
        getConfigListEntry(_("Korhatár ellenőrzés kihagyása:"),
                           config.plugins.iptvplayer.ytAgeGate))

    # temporary, the ffmpeg must be in right version to be able to merge file without transcoding
    # checking should be moved to setup
    if IsExecutable('ffmpeg'):
        optionList.append(
            getConfigListEntry(_("Allow dash format:"),
                               config.plugins.iptvplayer.ytShowDash))
        if config.plugins.iptvplayer.ytShowDash.value != 'false':
            optionList.append(
                getConfigListEntry(_("VP9 kodec használata:"),
                                   config.plugins.iptvplayer.ytVP9))
    return optionList
コード例 #8
0
def UpdateDownloaderCreator(url):
    printDBG("UpdateDownloaderCreator url[%s]" % url)
    if url.startswith('https'):
        if IsExecutable(DMHelper.GET_WGET_PATH()):
            printDBG("UpdateDownloaderCreator WgetDownloader")
            return WgetDownloader()
        elif IsExecutable('python'):
            printDBG("UpdateDownloaderCreator PwgetDownloader")
            return PwgetDownloader()
    else:
        if IsExecutable('wget'):
            printDBG("UpdateDownloaderCreator BuxyboxWgetDownloader")
            return BuxyboxWgetDownloader()
        elif IsExecutable(DMHelper.GET_WGET_PATH()):
            printDBG("UpdateDownloaderCreator WgetDownloader")
            return WgetDownloader()
        elif IsExecutable('python'):
            printDBG("UpdateDownloaderCreator PwgetDownloader")
            return PwgetDownloader()
    printDBG("UpdateDownloaderCreator downloader not available")
    return PwgetDownloader()
コード例 #9
0
def SetupDownloaderCmdCreator(url, file):
    printDBG("SetupDownloaderCreator url[%s]" % url)
    if url.startswith('https'):
        if IsExecutable(DMHelper.GET_WGET_PATH()):
            printDBG("SetupDownloaderCreator WgetDownloader")
            return '%s "%s" -O "%s" ' % (DMHelper.GET_WGET_PATH(), url, file)
        elif IsExecutable('python'):
            printDBG("SetupDownloaderCreator PwgetDownloader")
            return 'python "%s" "%s" "%s" ' % (DMHelper.GET_PWGET_PATH(), url,
                                               file)
    else:
        if IsExecutable('wget'):
            printDBG("SetupDownloaderCreator BuxyboxWgetDownloader")
            return 'wget "%s" -O "%s" ' % (url, file)
        elif IsExecutable(DMHelper.GET_WGET_PATH()):
            printDBG("SetupDownloaderCreator WgetDownloader")
            return '%s "%s" -O "%s" ' % (DMHelper.GET_WGET_PATH(), url, file)
        elif IsExecutable('python'):
            printDBG("SetupDownloaderCreator PwgetDownloader")
            return 'python "%s" "%s" "%s" ' % (DMHelper.GET_PWGET_PATH(), url,
                                               file)
    printDBG("SetupDownloaderCreator downloader not available")
    return 'python "%s" "%s" "%s" ' % (DMHelper.GET_PWGET_PATH(), url, file)
コード例 #10
0
def GetMoviePlayer(buffering=False, useAlternativePlayer=False):
    printDBG("GetMoviePlayer buffering[%r], useAlternativePlayer[%r]" % (buffering, useAlternativePlayer))
    # select movie player
    
    availablePlayers = []
    if config.plugins.iptvplayer.plarform.value in ['sh4', 'mipsel', 'armv7', 'armv5t'] and IsExecutable(config.plugins.iptvplayer.exteplayer3path.value):
        availablePlayers.append('exteplayer')
    if IsExecutable(config.plugins.iptvplayer.gstplayerpath.value): #config.plugins.iptvplayer.plarform.value in ['sh4', 'mipsel', 'i686'] and 
        availablePlayers.append('extgstplayer')
    availablePlayers.append('mini')
    availablePlayers.append('standard')
        
    player = None
    alternativePlayer = None

    if 'sh4' == config.plugins.iptvplayer.plarform.value:
        if buffering:
            player = config.plugins.iptvplayer.defaultSH4MoviePlayer
            alternativePlayer = config.plugins.iptvplayer.alternativeSH4MoviePlayer
        else:
            player = config.plugins.iptvplayer.defaultSH4MoviePlayer0
            alternativePlayer = config.plugins.iptvplayer.alternativeSH4MoviePlayer0
            
    elif 'mipsel' == config.plugins.iptvplayer.plarform.value:
        if buffering:
            player = config.plugins.iptvplayer.defaultMIPSELMoviePlayer
            alternativePlayer = config.plugins.iptvplayer.alternativeMIPSELMoviePlayer
        else:
            player = config.plugins.iptvplayer.defaultMIPSELMoviePlayer0
            alternativePlayer = config.plugins.iptvplayer.alternativeMIPSELMoviePlayer0

    elif 'armv7' == config.plugins.iptvplayer.plarform.value:
        if buffering:
            player = config.plugins.iptvplayer.defaultARMV7MoviePlayer
            alternativePlayer = config.plugins.iptvplayer.alternativeARMV7MoviePlayer
        else:
            player = config.plugins.iptvplayer.defaultARMV7MoviePlayer0
            alternativePlayer = config.plugins.iptvplayer.alternativeARMV7MoviePlayer0
            
    elif 'armv5t' == config.plugins.iptvplayer.plarform.value:
        if buffering:
            player = config.plugins.iptvplayer.defaultARMV5TMoviePlayer
            alternativePlayer = config.plugins.iptvplayer.alternativeARMV5TMoviePlayer
        else:
            player = config.plugins.iptvplayer.defaultARMV5TMoviePlayer0
            alternativePlayer = config.plugins.iptvplayer.alternativeARMV5TMoviePlayer0

    elif 'i686' == config.plugins.iptvplayer.plarform.value:
        if buffering:
            player = config.plugins.iptvplayer.defaultI686MoviePlayer
            alternativePlayer = config.plugins.iptvplayer.alternativeI686MoviePlayer
        else:
            player = config.plugins.iptvplayer.defaultI686MoviePlayer0
            alternativePlayer = config.plugins.iptvplayer.alternativeI686MoviePlayer0
    else:
        player = config.plugins.iptvplayer.NaszPlayer
        alternativePlayer = config.plugins.iptvplayer.NaszPlayer
        
    if player.value == 'auto': player = CFakeMoviePlayerOption(availablePlayers[0], GetMoviePlayerName(availablePlayers[0]))
    try: availablePlayers.remove(player.value)
    except Exception: printExc()
    
    if alternativePlayer.value == 'auto': alternativePlayer = CFakeMoviePlayerOption(availablePlayers[0], GetMoviePlayerName(availablePlayers[0]))
    try: availablePlayers.remove(alternativePlayer.value)
    except Exception: printExc()
    
    if useAlternativePlayer:
        return alternativePlayer
    
    return player
コード例 #11
0
 def GET_FFMPEG_PATH():
     altFFMPEGPath = '/iptvplayer_rootfs/usr/bin/ffmpeg'
     if IsExecutable(altFFMPEGPath):
         return altFFMPEGPath
     return "ffmpeg"
コード例 #12
0
def runMain(session, nextFunction=doRunMain):
    wgetpath     = IsExecutable(config.plugins.iptvplayer.wgetpath.value)
    rtmpdumppath = IsExecutable(config.plugins.iptvplayer.rtmpdumppath.value)
    f4mdumppath  = IsExecutable(config.plugins.iptvplayer.f4mdumppath.value)
    platform     = config.plugins.iptvplayer.plarform.value
    nextFunction(session)