Пример #1
0
    def __init__(self, channel='', epgMode=False, osdMode=False):
        super(OSD, self).__init__()

        self.channel = channel
        self.closeTimer = None
        self.list = None
        self.showInfo = False
        self.epgMode = epgMode
        self.osdMode = osdMode
        self.infoService = InfoService()
        self.now = None
        self.next = None
        self.other = None

        self.streamingService = streaming.StreamsService()
Пример #2
0
    def getDataFromExternal(self, date, progress_callback=None):
        channels = self.sapoMeoApi.getChannelList()
        entries = dict()
        streamsService = streaming.StreamsService()
        
        for channel in channels:
            
            if not channel['Sigla'].startswith( 'M ' ):
                entries[channel['Sigla']]=channel        	
        
        for idx, channelKey in enumerate(sorted(entries.keys())):
            channel = entries[channelKey]
            c = Channel(id=channel['Sigla'], title=channel['Name'], logo=None)
            
            if self.filterTVportuguesa:
                matches = streamsService.detectStream(c)
                if matches == None or len(matches)==0:
                    c.visible=False
            print c.title.encode('utf-8')
            yield c
            
            if c.visible:
                try:
                    for program in self.sapoMeoApi.getChannelByDateInterval(c.id, date):
                        description = program['Description']
                        if description is None:
                            description = strings(NO_DESCRIPTION)
                        
                      
                        
                        p = Program(
                            c,
                            program['Title'],                    
                            self.convertDate(program['StartTime']),
                            self.convertDate(program['EndTime']),
                            description
                        )
                        print "  "+p.title.encode('utf-8')            
                        yield p
                except Exception, ex:
                	xbmc.log('[script.tvguide] Uncaugt exception in source.py: %s' % str(ex) , xbmc.LOGDEBUG)

                
            if progress_callback:
                if not progress_callback(100.0 / len(channels) * idx):
                    raise SourceUpdateCanceledException()
Пример #3
0
def clean_ini(url):
    import streaming
    streamingService = streaming.StreamsService()
    ini_channel_array = []
    # Grab a list of ini entries
    inifiles = streamingService.getIniFiles()
    for inifile in inifiles:
        xbmc.log('### checking ini file for streams: %s' % inifile)

        # Split eaach line into array so we can grab channel names
        with open(inifile) as f:
            content = f.readlines()

        writefile = open(inifile, 'w')
        for line in content:
            if not url in line:
                writefile.write(line)
        writefile.close()
Пример #4
0
def CheckForIniChannels():
    import streaming
    streamingService = streaming.StreamsService()
    ini_channel_array = []
    # Grab a list of ini entries
    inifiles = streamingService.getIniFiles()
    for inifile in inifiles:
        xbmc.log('### checking ini file for streams: %s' % inifile)

        # Split eaach line into array so we can grab channel names
        with open(inifile) as f:
            content = f.readlines()

# Split at the = which gives us channel name then clean up
        for line in content:
            if '=' in line:
                try:
                    channel = CleanFilename(line.split('=')[0])
                    channel = channel.replace(' ', '').replace(
                        '_', '').replace('HD', '').replace('1', 'ONE').replace(
                            '2', 'TWO').replace('3', 'THREE').replace(
                                '4', 'FOUR').replace('5', 'FIVE').replace(
                                    '6', 'SIX').replace('7', 'SEVEN').replace(
                                        '8',
                                        'EIGHT').replace('9', 'NINE').replace(
                                            '0', 'ZERO').replace(
                                                'SPORTS', 'SPORT').replace(
                                                    '|', '').replace(
                                                        ':', '').replace(
                                                            '(', '').replace(
                                                                ')',
                                                                '').replace(
                                                                    '=', '')
                    if len(channel) > 9:
                        channel = channel.replace('CINEMA',
                                                  '').replace('MOVIES', '')

# If clean name is not in the ini array we add it
                    if not channel in ini_channel_array and channel != '':
                        ini_channel_array.append(channel)
                except Exception as e:
                    xbmc.log('Failed to pull channel name: %s' % e)

    return ini_channel_array
Пример #5
0
def getStreams(channel):
    dialog = xbmcgui.Dialog()
    result = streaming.StreamsService(ADDON).detectReminder(channel)

    if len(result) < 1:
        dialog.ok('Sorry, we could not detect a stream for %s' % channel, '',
                  'Please use iVue creator to link more streams')
        return None

    if not getCustomStreamUrl(channelName):

        import gui
        r = gui.ChooseStreamAddonDialog(result)
        r.doModal()
        if r.stream is not None:
            if ADDON.getSetting('ignore.stream') == 'false':
                setCustomStreamUrl(channelName, r.stream)
            playChannel(r.stream)
    else:
        playChannel(getCustomStreamUrl(channelName))
Пример #6
0
    def __init__(self, channel='', epgMode=False, osdMode=False):
        super(OSD, self).__init__()

        self.channel = channel
        self.closeTimer = None
        self.list = None
        self.showInfo = False
        self.epgMode = epgMode
        self.osdMode = osdMode
        self.infoService = InfoService()
        self.now = None
        self.next = None
        self.other = None
        self.protected = dixie.isProtected()
        self.categories = []

        cats = dixie.getCategories()
        for cat in cats:
            if len(cat) > 0:
                self.categories.append(cat)

        self.streamingService = streaming.StreamsService()