示例#1
0
    def keyOK(self):
        if self.keyLocked:
            return
        cannaName = self['streamlist'].getCurrent()[0][0]
        cannaUrl = self['streamlist'].getCurrent()[0][1]
        print cannaName, cannaUrl

        if re.match('.*?-', cannaName):
            playinfos = cannaName.split(' - ')
            if playinfos:
                if len(playinfos) == 2:
                    self["artist"].setText(playinfos[0])
                    self["songtitle"].setText(playinfos[1])
            else:
                playinfos = cannaName.split('-')
                if playinfos:
                    if len(playinfos) == 2:
                        self["artist"].setText(playinfos[0])
                        self["songtitle"].setText(playinfos[1])
        else:
            self["artist"].setText(cannaName)

        #stream_url = self.getDLurl(cannaUrl)
        stream_url = CannaLink(self.session).getDLurl(cannaUrl)
        if stream_url:
            print stream_url
            sref = eServiceReference(0x1001, 0, stream_url)
            self.session.nav.playService(sref)
            self.playing = True
示例#2
0
    def getVideo(self):
        title = self.playList[self.playIdx][self.title_inr]
        url = self.playList[self.playIdx][1]

        cannaName = title
        if re.match('.*?-', cannaName):
            playinfos = cannaName.split(' - ')
            if playinfos:
                if len(playinfos) == 2:
                    artist = playinfos[0]
                    title = playinfos[1]
            else:
                playinfos = cannaName.split('-')
                if playinfos:
                    if len(playinfos) == 2:
                        artist = playinfos[0]
                        title = playinfos[1]
        else:
            artist = ''
            title = cannaName

        CannaLink(self.session).getLink(
            self.playStream, self.dataError, title, artist, self.listTitle,
            url,
            'file:///usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/images/none.png'
        )
示例#3
0
    def getVideo2(self):
        print "getVideo2:"
        if self.playLen > 0:
            titel = self.playList2[self.playIdx][1]
            url = self.playList2[self.playIdx][2]
            album = self.playList2[self.playIdx][3]
            artist = self.playList2[self.playIdx][4]
            if len(self.playList2[self.playIdx]) < 6:
                ltype = ''
            else:
                ltype = self.playList2[self.playIdx][5]

            if ltype == 'youtube':
                YoutubeLink(self.session).getLink(self.playStream,
                                                  self.dataError, titel, url)
            elif ltype == 'putpattv':
                token = self.playList2[self.playIdx][6]
                PutpattvLink(self.session).getLink(self.playStream,
                                                   self.dataError, titel, url,
                                                   token)
            elif ltype == 'myvideo':
                token = self.playList2[self.playIdx][6]
                MyvideoLink(self.session).getLink(self.playStream,
                                                  self.dataError, titel, url,
                                                  token)
            elif ltype == 'songsto':
                #print "songsto",titel,artist,album,token
                token = self.playList2[self.playIdx][6]
                SongstoLink(self.session).getLink(self.playStream,
                                                  self.dataError, titel,
                                                  artist, album, token)
            elif ltype == 'canna':
                #print "canna",titel,artist,album,token
                token = self.playList2[self.playIdx][6]
                CannaLink(self.session).getLink(self.playStream,
                                                self.dataError, titel, artist,
                                                album, url)
            else:
                self.playStream(titel, url, album, artist)
        else:
            self.close()
示例#4
0
    def getVideo(self):
        title = self.playList[self.playIdx][self.title_inr]
        url = self.playList[self.playIdx][1]

        cannaName = title
        if re.match('.*?-', cannaName):
            playinfos = cannaName.split(' - ')
            if playinfos:
                if len(playinfos) == 2:
                    artist = playinfos[0]
                    title = playinfos[1]
            else:
                playinfos = cannaName.split('-')
                if playinfos:
                    if len(playinfos) == 2:
                        artist = playinfos[0]
                        title = playinfos[1]
        else:
            artist = ''
            title = cannaName

        CannaLink(self.session).getLink(self.playStream, self.dataError, title,
                                        artist, self.listTitle, url, None)
示例#5
0
    def doEofInternal(self, playing):
        print "Play Next Song.."

        if self.playmode == "Next":
            self['streamlist'].down()
        else:
            count = len(self.filmliste) - 1
            get_random = random.randint(0, int(count))
            print "Got Random %s" % get_random
            self['streamlist'].moveToIndex(get_random)

        cannaName = self['streamlist'].getCurrent()[0][0]
        cannaUrl = self['streamlist'].getCurrent()[0][1]
        print cannaName, cannaUrl

        if re.match('.*?-', cannaName):
            playinfos = cannaName.split(' - ')
            if playinfos:
                if len(playinfos) == 2:
                    self["artist"].setText(playinfos[0])
                    self["songtitle"].setText(playinfos[1])
            else:
                playinfos = cannaName.split('-')
                if playinfos:
                    if len(playinfos) == 2:
                        self["artist"].setText(playinfos[0])
                        self["songtitle"].setText(playinfos[1])
        else:
            self["artist"].setText(cannaName)

        #stream_url = self.getDLurl(cannaUrl)
        stream_url = CannaLink(self.session).getDLurl(cannaUrl)
        if stream_url:
            print stream_url
            sref = eServiceReference(0x1001, 0, stream_url)
            self.session.nav.playService(sref)
            self.playing = True