Пример #1
0
    def getCustomActions(self, Index=0):
        retCode = RetHost.ERROR
        retlist = []

        def addPasteAction(path):
            if os_path.isdir(path):
                if '' != self.cFilePath:
                    cutPath, cutFileName = os_path.split(self.cFilePath)
                    params = IPTVChoiceBoxItem(
                        _('Paste "%s"') % cutFileName, "", {
                            'action': 'paste_file',
                            'path': path
                        })
                    retlist.append(params)

        ok = False
        if not self.isValidIndex(Index):
            path = self.host.getCurrDir()
            addPasteAction(path)
            retCode = RetHost.OK
            return RetHost(retCode, value=retlist)

        if self.host.currList[Index]['type'] in ['video', 'audio', 'picture'] and \
           self.host.currList[Index].get('url', '').startswith('file://'):
            fullPath = self.host.currList[Index]['url'][7:]
            ok = True
        elif self.host.currList[Index].get("category", '') == 'm3u':
            fullPath = self.host.currList[Index]['path']
            ok = True
        elif self.host.currList[Index].get("category", '') == 'dir':
            fullPath = self.host.currList[Index]['path']
            ok = True
        elif self.host.currList[Index].get("category", '') == 'iso':
            fullPath = self.host.currList[Index]['path']
            ok = True
        if ok:
            path, fileName = os_path.split(fullPath)
            name, ext = os_path.splitext(fileName)

            if '' != self.host.currList[Index].get("iso_mount_path", ''):
                params = IPTVChoiceBoxItem(
                    _('Umount iso file'), "", {
                        'action':
                        'umount_iso_file',
                        'file_path':
                        fullPath,
                        'iso_mount_path':
                        self.host.currList[Index]['iso_mount_path']
                    })
                retlist.append(params)

            if os_path.isfile(fullPath):
                params = IPTVChoiceBoxItem(_('Rename'), "", {
                    'action': 'rename_file',
                    'file_path': fullPath
                })
                retlist.append(params)
                params = IPTVChoiceBoxItem(_('Remove'), "", {
                    'action': 'remove_file',
                    'file_path': fullPath
                })
                retlist.append(params)

                params = IPTVChoiceBoxItem(_('Copy'), "", {
                    'action': 'copy_file',
                    'file_path': fullPath
                })
                retlist.append(params)

                params = IPTVChoiceBoxItem(_('Cut'), "", {
                    'action': 'cut_file',
                    'file_path': fullPath
                })
                retlist.append(params)

            addPasteAction(path)
            retCode = RetHost.OK

        return RetHost(retCode, value=retlist)
Пример #2
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('filma24hdcomlogo.png')])
Пример #3
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value = [GetLogoDir('yifytvlogo.png')])
Пример #4
0
 def getLogoPath(self):
     return RetHost(RetHost.OK,
                    value=[GetLogoDir('seriesenstreamingcomlogo.png')])
Пример #5
0
 def getResolvedURL(self, url):
     return RetHost(RetHost.NOT_IMPLEMENTED, value=[])
Пример #6
0
 def getLogoPath(self):
     return RetHost(RetHost.OK,
                    value=[GetLogoDir('filmovizijastudiologo.png')])
Пример #7
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value = [GetLogoDir('webstreamslogo.png')])
Пример #8
0
 def getCurrentList(self, refresh=0):
     return RetHost(RetHost.NOT_IMPLEMENTED, value=[])
Пример #9
0
 def getMoreForItem(self, Index=0):
     return RetHost(RetHost.NOT_IMPLEMENTED, value=[])
Пример #10
0
 def getInitList(self):
     return RetHost(RetHost.NOT_IMPLEMENTED, value=[])
Пример #11
0
 def getListForItem(self, Index=0, refresh=0):
     return RetHost(RetHost.NOT_IMPLEMENTED, value=[])
Пример #12
0
 def getMoreForItem(self, Index=0):
     self.subProvider.handleService(Index, 2)
     convList = self.convertList(self.subProvider.getCurrList())
     return RetHost(RetHost.OK, value=convList)
Пример #13
0
 def getCurrentList(self, refresh=0):
     if refresh == 1:
         self.subProvider.handleService(self.currIndex, refresh)
     convList = self.convertList(self.subProvider.getCurrList())
     return RetHost(RetHost.OK, value=convList)
Пример #14
0
    def performCustomAction(self, privateData):
        retCode = RetHost.ERROR
        retlist = []
        if privateData['action'] == 'remove_file':
            try:
                ret = self.host.sessionEx.waitForFinishOpen(
                    MessageBox,
                    text=_('Are you sure you want to remove file "%s"?') %
                    privateData['file_path'],
                    type=MessageBox.TYPE_YESNO,
                    default=False)
                if ret[0]:
                    os_remove(privateData['file_path'])
                    retlist = ['refresh']
                    retCode = RetHost.OK
            except Exception:
                printExc()
        if privateData['action'] == 'rename_file':
            try:
                path, fileName = os_path.split(privateData['file_path'])
                name, ext = os_path.splitext(fileName)
                ret = self.host.sessionEx.waitForFinishOpen(
                    VirtualKeyBoard, title=_('Set file name'), text=name)
                printDBG('rename_file new name[%s]' % ret)
                if isinstance(ret[0], basestring):
                    newPath = os_path.join(path, ret[0] + ext)
                    printDBG('rename_file new path[%s]' % newPath)
                    if not os_path.isfile(newPath) and not os_path.islink(
                            newPath):
                        os_rename(privateData['file_path'], newPath)
                        retlist = ['refresh']
                        retCode = RetHost.OK
                    else:
                        retlist = [_('File "%s" already exists!') % newPath]
            except Exception:
                printExc()
        elif privateData['action'] == 'cut_file':
            self.cFilePath = privateData['file_path']
            self.cType = 'cut'
            retCode = RetHost.OK
        elif privateData['action'] == 'copy_file':
            self.cFilePath = privateData['file_path']
            self.cType = 'copy'
            retCode = RetHost.OK
        elif privateData['action'] == 'paste_file':
            try:
                ok = True
                cutPath, cutFileName = os_path.split(self.cFilePath)
                newPath = os_path.join(privateData['path'], cutFileName)
                if os_path.isfile(newPath):
                    retlist = [_('File "%s" already exists') % newPath]
                    ok = False
                else:
                    if self.cType == 'cut':
                        os_rename(self.cFilePath, newPath)
                        self.needRefresh = cutPath
                    elif self.cType == 'copy':
                        cmd = 'cp "%s" "%s"' % (self.cFilePath, newPath)
                        ret = iptv_execute_wrapper(cmd)
                if ok:
                    self.cType = ''
                    self.cFilePath = ''
                    retlist = ['refresh']
                    retCode = RetHost.OK
            except Exception:
                printExc()
        elif privateData['action'] == 'umount_iso_file':
            cmd = 'umount "{0}"'.format(
                privateData['iso_mount_path']) + ' 2>&1'
            ret = iptv_execute_wrapper(cmd)
            if ret['sts'] and 0 != ret['code']:
                # normal umount failed, so detach filesystem only
                cmd = 'umount -l "{0}"'.format(
                    privateData['iso_mount_path']) + ' 2>&1'
                ret = iptv_execute_wrapper(cmd)

        return RetHost(retCode, value=retlist)
Пример #15
0
 def getResolvedURL(self, url):
     try:
         return self.host.getResolvedURL(url)
     except Exception:
         return RetHost(RetHost.ERROR, value=[])
Пример #16
0
 def downloadSubtitleFile(
     self,
     Index=0,
 ):
     return RetHost(RetHost.NOT_IMPLEMENTED, value=[])
Пример #17
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('favouriteslogo.png')])
Пример #18
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('streamlivetologo.png')])
 def getLogoPath(self):
     return RetHost(RetHost.OK, value = [GetLogoDir('greekdocumentaries3logo.png')])
Пример #20
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value = [GetLogoDir('serialnetlogo.png')])
Пример #21
0
    def getLinksForVideo(self, Index = 0, selItem = None):
        listLen = len(self.host.currList)
        if listLen <= Index or Index < 0:
            printDBG( "ERROR getLinksForVideo - current list is to short len: %d, Index: %d" % (listLen, Index) )
            return RetHost(RetHost.ERROR, value = [])
        
        if self.host.currList[Index]["type"] not in ['video', 'audio', 'picture']:
            printDBG( "ERROR getLinksForVideo - current item has wrong type" )
            return RetHost(RetHost.ERROR, value = [])

        retlist = []
        cItem = self.host.currList[Index]
        url   = self.host.currList[Index].get("url", '')
        name  = self.host.currList[Index].get("name", '')
        
        printDBG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [%s] [%s]" % (name, url))
        urlList = None
        
        if -1 != url.find('teledunet'):
            new_url = TeledunetParser().get_rtmp_params(url)
            if 0 < len(url): retlist.append(CUrlItem("Własny link", new_url))
        elif url.startswith('http://goldvod.tv/'): urlList = self.host.getGoldVodTvLink(cItem)
        elif name == 'livemass.net':                urlList = self.host.getLivemassNetLink(cItem)
        elif name == "sport365.live":              urlList = self.host.getSport365LiveLink(cItem)
        elif name == 'wagasworld.com':             urlList = self.host.getWagasWorldLink(cItem)
        elif name == 'others':                     urlList = self.host.getOthersLinks(cItem)
        elif 'weeb.tv' in name:                    url = self.host.getWeebTvLink(url)
        elif name == "filmon_channel":             urlList = self.host.getFilmOnLink(channelID=url)
        elif name == "videostar.pl":               urlList = self.host.getVideostarLink(cItem)
        elif name == 'bilasport.com':              urlList = self.host.getBilaSportPwLink(cItem)
        elif name == 'canlitvlive.io':             urlList = self.host.getCanlitvliveIoLink(cItem)
        elif name == 'djing.com':                  urlList = self.host.getDjingComLink(cItem)
        elif name == 'ustvnow':                    urlList = self.host.getUstvnowLink(cItem)
        elif name == 'wizja.tv':                   urlList = self.host.getWizjaTvLink(cItem)
        elif name == 'meteo.pl':                   urlList = self.host.getMeteoPLLink(cItem)
        elif name == 'edem.tv':                    urlList = self.host.getEdemTvLink(cItem)
        elif name == 'skylinewebcams.com':         urlList = self.host.getWkylinewebcamsComLink(cItem)
        elif name == "webcamera.pl":               urlList = self.host.getWebCameraLink(cItem)
        elif name == "prognoza.pogody.tv":         urlList = self.host.prognozaPogodyLink(url)
        elif name == "mlbstream.tv":               urlList = self.host.getMLBStreamTVLink(cItem)
        elif name == "beinmatch.com":              urlList = self.host.getBeinmatchLink(cItem)
        elif name == "wiz1.net":                   urlList = self.host.getWiz1NetLink(cItem)

        if isinstance(urlList, list):
            for item in urlList:
                retlist.append(CUrlItem(item['name'], item['url'], item.get('need_resolve', 0)))
        elif isinstance(url, basestring):
            if url.endswith('.m3u'):
                tmpList = self.host.getDirectVideoHasBahCa(name, url)
                for item in tmpList:
                    retlist.append(CUrlItem(item['name'], item['url']))
            else:
                url = urlparser.decorateUrl(url)
                iptv_proto = url.meta.get('iptv_proto', '')
                if 'm3u8' == iptv_proto:
                    if '84.114.88.26' == url.meta.get('X-Forwarded-For', ''):
                        url.meta['iptv_m3u8_custom_base_link'] = '' + url
                        url.meta['iptv_proxy_gateway'] = 'http://webproxy.at/surf/printer.php?u={0}&b=192&f=norefer'
                        url.meta['Referer'] =  url.meta['iptv_proxy_gateway'].format(urllib.quote_plus(url))
                        meta = url.meta
                        tmpList = getDirectM3U8Playlist(url, checkExt=False)
                        if 1 == len(tmpList):
                            url = urlparser.decorateUrl(tmpList[0]['url'], meta)
                            
                    tmpList = getDirectM3U8Playlist(url, checkExt=False)
                    for item in tmpList:
                        retlist.append(CUrlItem(item['name'], item['url']))
                elif 'f4m' == iptv_proto:
                    tmpList = getF4MLinksWithMeta(url, checkExt=False)
                    for item in tmpList:
                        retlist.append(CUrlItem(item['name'], item['url']))
                else:
                    if '://' in url:
                        ua  = strwithmeta(url).meta.get('User-Agent', '')
                        if 'balkanstream.com' in url:
                            if '' == ua: url.meta['User-Agent'] = 'Mozilla/5.0'
                                
                        retlist.append(CUrlItem("Link", url))
            
        return RetHost(RetHost.OK, value = retlist)
Пример #22
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('liveleaklogo.png')])
Пример #23
0
 def getCurrentList(self, refresh=0):
     if refresh == 1:
         self.host.handleService(self.currIndex, refresh,
                                 self.searchPattern)
     convList = self.convertList(self.host.getCurrList())
     return RetHost(RetHost.OK, value=convList)
Пример #24
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('spryciarzelogo.png')])
Пример #25
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('fighttubelogo.png')])
Пример #26
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('filmy3deulogo.png')])
Пример #27
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('wgranelogo.png')])
Пример #28
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('jooglepllogo.png')])
Пример #29
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value=[GetLogoDir('tvjworglogo.png')])
Пример #30
0
 def getLogoPath(self):
     return RetHost(RetHost.OK, value = [GetLogoDir('dardarkomcomlogo.png')])