예제 #1
0
파일: __init__.py 프로젝트: mpie/repo
 def playLiveStream(self, name, url, thumb):
     try:
         from resources.lib.libraries.player import player
         item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb)
         player().play(url, item)
     except:
         pass
예제 #2
0
    def play(self, name, title, year, imdb, tmdb, tvdb, tvrage, season,
             episode, tvshowtitle, alter, date, meta, url):
        control.log('############# PLAY # %s' % url)
        try:
            if not control.infoLabel('Container.FolderPath').startswith(
                    'plugin://'):
                control.playlist.clear()

            control.resolve(int(sys.argv[1]), True, control.item(path=''))
            control.execute('Dialog.Close(okdialog)')

            if imdb == '0': imdb = '0000000'
            imdb = 'tt' + re.sub('[^0-9]', '', str(imdb))

            content = 'movie' if tvshowtitle == None else 'episode'

            self.sources = self.getSources(name, title, year, imdb, tmdb, tvdb,
                                           tvrage, season, episode,
                                           tvshowtitle, alter, date)
            if self.sources == []: raise Exception()

            self.sources = self.sourcesFilter()

            if control.window.getProperty('PseudoTVRunning') == 'True':
                url = self.sourcesDirect()

            elif url == 'dialog://':
                url = self.sourcesDialog()

            elif url == 'direct://':
                url = self.sourcesDirect()

            elif not control.infoLabel('Container.FolderPath').startswith(
                    'plugin://') and control.setting(
                        'autoplay_library') == 'false':
                url = self.sourcesDialog()

            elif control.infoLabel('Container.FolderPath').startswith(
                    'plugin://') and control.setting('autoplay') == 'false':
                url = self.sourcesDialog()

            else:
                url = self.sourcesDirect()

            if url == None: raise Exception()
            if url == 'close://': return

            if control.setting('playback_info') == 'true':
                control.infoDialog(self.selectedSource, heading=name)

            control.sleep(200)

            from resources.lib.libraries.player import player
            player().run(content, name, url, year, imdb, tvdb, meta)

            return url
        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
예제 #3
0
파일: __init__.py 프로젝트: mpie/repo
 def playLiveStream(self, name, url, thumb):
     try:
         from resources.lib.libraries.player import player
         item = control.item(label=name,
                             iconImage=thumb,
                             thumbnailImage=thumb)
         player().play(url, item)
     except:
         pass
예제 #4
0
파일: __init__.py 프로젝트: bialagary/mw
    def play(self, name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, url):
        try:
            if imdb == "0":
                imdb = "0000000"
            imdb = "tt" + re.sub("[^0-9]", "", str(imdb))

            content = "movie" if tvshowtitle == None else "episode"

            self.sources = self.getSources(
                name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date
            )
            if self.sources == []:
                raise Exception()
            self.sources = self.sourcesFilter()

            if control.window.getProperty("PseudoTVRunning") == "True":
                url = self.sourcesDirect()

            elif url == "dialog://":
                url = self.sourcesDialog()

            elif url == "direct://":
                url = self.sourcesDirect()

            elif (
                not control.infoLabel("Container.FolderPath").startswith("plugin://")
                and control.setting("autoplay_library") == "false"
            ):
                url = self.sourcesDialog()

            elif (
                control.infoLabel("Container.FolderPath").startswith("plugin://")
                and control.setting("autoplay") == "false"
            ):
                url = self.sourcesDialog()

            else:
                url = self.sourcesDirect()

            if url == None:
                raise Exception()
            if url == "close://":
                return

            if control.setting("playback_info") == "true":
                control.infoDialog(self.selectedSource, heading=name)

            from resources.lib.libraries.player import player

            player().run(content, name, url, imdb, tvdb)

            return url
        except:
            control.infoDialog(control.lang(30501).encode("utf-8"))
            pass
예제 #5
0
    def playItem(self, content, name, imdb, tvdb, source):
        try:
            next = []
            prev = []

            for i in range(1,1000000):
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    u = json.loads(dict(urlparse.parse_qsl(u.replace('?','')))['source'])[0]
                    next.append(u)
                except:
                    break
            for i in range(-1000000,0)[::-1]:
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    u = json.loads(dict(urlparse.parse_qsl(u.replace('?','')))['source'])[0]
                    prev.append(u)
                except:
                    break

            items = json.loads(source)

            source, quality = items[0]['source'], items[0]['quality']
            items = [i for i in items+next+prev if i['quality'] == quality and i['source'] == source][:15]
            items += [i for i in next+prev if i['quality'] == quality and not i['source'] == source][:35]

            block = None

            for i in items:
                try:
                    if i['source'] == block: raise Exception()

                    w = workers.Thread(self.sourcesResolve, i['url'], i['provider'])
                    w.start() ; time.sleep(20)

                    if w.is_alive() == True: block = i['source']

                    if self.url == None: raise Exception()

                    if control.setting('playback_info') == 'true':
                        control.infoDialog(i['label'], heading=name)

                    from resources.lib.libraries.player import player
                    player().run(content, name, self.url, imdb, tvdb)

                    return self.url
                except:
                    pass

            raise Exception()

        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #6
0
    def play(self, name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta, url):
        try:
            if not control.infoLabel('Container.FolderPath').startswith('plugin://'):
                control.playlist.clear()
                control.resolve(int(sys.argv[1]), True, control.item(path=None))
                control.execute('Dialog.Close(okdialog)')

            if imdb == '0': imdb = '0000000'
            imdb = 'tt' + re.sub('[^0-9]', '', str(imdb))

            content = 'movie' if tvshowtitle == None else 'episode'

            self.sources = self.getSources(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date)
            if self.sources == []: raise Exception()

            self.sources = self.sourcesFilter()

            if control.window.getProperty('PseudoTVRunning') == 'True':
                url = self.sourcesDirect()

            elif url == 'dialog://':
                url = self.sourcesDialog()

            elif url == 'direct://':
                url = self.sourcesDirect()

            elif not control.infoLabel('Container.FolderPath').startswith('plugin://') and control.setting('autoplay_library') == 'false':
                url = self.sourcesDialog()

            elif control.infoLabel('Container.FolderPath').startswith('plugin://') and control.setting('autoplay') == 'false':
                url = self.sourcesDialog()

            else:
                url = self.sourcesDirect()

            if url == None: raise Exception()
            if url == 'close://': return

            if control.setting('playback_info') == 'true':
                control.infoDialog(self.selectedSource, heading=name)

            try: self.progressDialog.close()
            except: pass

            control.sleep(200)

            from resources.lib.libraries.player import player
            player().run(content, name, url, year, imdb, tvdb, meta)

            return url
        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
예제 #7
0
    def playItem(self, content, name, imdb, tvdb, url, source, provider):
        try:
            url = self.sourcesResolve(url, provider)
            if url == None: raise Exception()

            if control.setting('playback_info') == 'true':
                control.infoDialog(source, heading=name)

            from resources.lib.libraries.player import player
            player().run(content, name, url, imdb, tvdb)

            return url
        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #8
0
    def playItem(self, content, name, imdb, tvdb, url, source, provider):
        try:
            url = self.sourcesResolve(url, provider)
            if url == None: raise Exception()

            if control.setting('playback_info') == 'true':
                control.infoDialog(source, heading=name)

            from resources.lib.libraries.player import player
            player().run(content, name, url, imdb, tvdb)

            return url
        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #9
0
    def play(self, name, title, year, imdb, tmdb, tvdb, tvrage, season,
             episode, tvshowtitle, alter, date, url):
        try:
            imdb = 'tt' + re.sub('[^0-9]', '', str(imdb))

            content = 'movie' if tvshowtitle == None else 'episode'

            self.sources = self.getSources(name, title, year, imdb, tmdb, tvdb,
                                           tvrage, season, episode,
                                           tvshowtitle, alter, date)
            if self.sources == []: raise Exception()
            self.sources = self.sourcesFilter()

            if control.window.getProperty('PseudoTVRunning') == 'True':
                url = self.sourcesDirect()

            elif url == 'dialog://':
                url = self.sourcesDialog()

            elif url == 'direct://':
                url = self.sourcesDirect()

            elif not control.infoLabel('Container.FolderPath').startswith(
                    'plugin://') and control.setting(
                        'autoplay_library') == 'false':
                url = self.sourcesDialog()

            elif control.infoLabel('Container.FolderPath').startswith(
                    'plugin://') and control.setting('autoplay') == 'false':
                url = self.sourcesDialog()

            else:
                url = self.sourcesDirect()

            if url == None: raise Exception()
            if url == 'close://': return

            if control.setting('playback_info') == 'true':
                control.infoDialog(self.selectedSource, heading=name)

            from resources.lib.libraries.player import player
            player().run(content, name, url, imdb, tvdb)

            return url
        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #10
0
    def playItem(self, content, name, imdb, tvdb, source):
        try:
            next = []
            prev = []
            total = []

            for i in range(1, 10000):
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    if u in total: raise Exception()
                    total.append(u)
                    u = json.loads(
                        dict(urlparse.parse_qsl(u.replace('?',
                                                          '')))['source'])[0]
                    next.append(u)
                except:
                    break
            for i in range(-10000, 0)[::-1]:
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    if u in total: raise Exception()
                    total.append(u)
                    u = json.loads(
                        dict(urlparse.parse_qsl(u.replace('?',
                                                          '')))['source'])[0]
                    prev.append(u)
                except:
                    break

            items = json.loads(source)

            source, quality = items[0]['source'], items[0]['quality']
            items = [
                i for i in items + next + prev
                if i['quality'] == quality and i['source'] == source
            ][:10]
            items += [
                i for i in next + prev
                if i['quality'] == quality and not i['source'] == source
            ][:10]

            import xbmc

            dialog = control.progressDialog
            dialog.create(control.addonInfo('name'), '')
            dialog.update(0)

            block = None

            for i in range(len(items)):
                try:
                    dialog.update(int((100 / float(len(items))) * i),
                                  str(items[i]['label']))

                    if items[i]['source'] == block: raise Exception()

                    w = workers.Thread(self.sourcesResolve, items[i]['url'],
                                       items[i]['provider'])
                    w.start()

                    for x in range(0, 15 * 2):
                        if dialog.iscanceled(): return dialog.close()
                        if xbmc.abortRequested == True: return sys.exit()
                        if w.is_alive() == False: break
                        time.sleep(0.5)

                    if w.is_alive() == True: block = items[i]['source']

                    if self.url == None: raise Exception()

                    try:
                        dialog.close()
                    except:
                        pass

                    if control.setting('playback_info') == 'true':
                        control.infoDialog(items[i]['label'], heading=name)

                    from resources.lib.libraries.player import player
                    player().run(content, name, self.url, imdb, tvdb)

                    return self.url
                except:
                    pass

            try:
                dialog.close()
            except:
                pass

            raise Exception()

        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #11
0
    def playItem(self, content, name, year, imdb, tvdb, source):
        try:
            control.resolve(int(sys.argv[1]), True, control.item(path=''))
            control.execute('Dialog.Close(okdialog)')

            next = []
            prev = []
            total = []
            meta = None

            for i in range(1, 10000):
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    if u in total: raise Exception()
                    total.append(u)
                    u = dict(urlparse.parse_qsl(u.replace('?', '')))
                    if 'meta' in u: meta = u['meta']
                    u = json.loads(u['source'])[0]
                    next.append(u)
                except:
                    break
            for i in range(-10000, 0)[::-1]:
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    if u in total: raise Exception()
                    total.append(u)
                    u = dict(urlparse.parse_qsl(u.replace('?', '')))
                    if 'meta' in u: meta = u['meta']
                    u = json.loads(u['source'])[0]
                    prev.append(u)
                except:
                    break

            items = json.loads(source)

            source, quality = items[0]['source'], items[0]['quality']
            items = [
                i for i in items + next + prev
                if i['quality'] == quality and i['source'] == source
            ][:10]
            items += [
                i for i in next + prev
                if i['quality'] == quality and not i['source'] == source
            ][:10]

            self.progressDialog = control.progressDialog
            self.progressDialog.create(control.addonInfo('name'), '')
            self.progressDialog.update(0)

            block = None

            for i in range(len(items)):
                try:
                    self.progressDialog.update(
                        int((100 / float(len(items))) * i),
                        str(items[i]['label']), str(' '))

                    if items[i]['source'] == block: raise Exception()

                    w = workers.Thread(self.sourcesResolve, items[i]['url'],
                                       items[i]['provider'])
                    w.start()

                    m = ''

                    for x in range(3600):
                        if self.progressDialog.iscanceled():
                            return self.progressDialog.close()
                        if xbmc.abortRequested == True: return sys.exit()
                        k = control.condVisibility(
                            'Window.IsActive(virtualkeyboard)')
                        if k:
                            m += '1'
                            m = m[-1]
                        if (w.is_alive() == False or x > 30) and not k: break
                        time.sleep(1)

                    for x in range(30):
                        if m == '': break
                        if self.progressDialog.iscanceled():
                            return self.progressDialog.close()
                        if xbmc.abortRequested == True: return sys.exit()
                        if w.is_alive() == False: break
                        time.sleep(1)

                    if w.is_alive() == True: block = items[i]['source']

                    if self.url == None: raise Exception()

                    try:
                        self.progressDialog.close()
                    except:
                        pass

                    control.sleep(200)

                    if control.setting('playback_info') == 'true':
                        control.infoDialog(items[i]['label'], heading=name)

                    from resources.lib.libraries.player import player
                    player().run(content, name, self.url, year, imdb, tvdb,
                                 meta)

                    return self.url
                except:
                    pass

            try:
                self.progressDialog.close()
            except:
                pass

            raise Exception()

        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #12
0
파일: __init__.py 프로젝트: us1415/specto
    def playItem(self, content, name, year, imdb, tvdb, source):
        try:
            control.resolve(int(sys.argv[1]), True, control.item(path=''))
            control.execute('Dialog.Close(okdialog)')

            next = [] ; prev = [] ; total = []
            meta = None

            for i in range(1,10000):
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    if u in total: raise Exception()
                    total.append(u)
                    u = dict(urlparse.parse_qsl(u.replace('?','')))
                    if 'meta' in u: meta = u['meta']
                    u = json.loads(u['source'])[0]
                    next.append(u)
                except:
                    break
            for i in range(-10000,0)[::-1]:
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    if u in total: raise Exception()
                    total.append(u)
                    u = dict(urlparse.parse_qsl(u.replace('?','')))
                    if 'meta' in u: meta = u['meta']
                    u = json.loads(u['source'])[0]
                    prev.append(u)
                except:
                    break

            items = json.loads(source)

            source, quality = items[0]['source'], items[0]['quality']
            items = [i for i in items+next+prev if i['quality'] == quality and i['source'] == source][:10]
            items += [i for i in next+prev if i['quality'] == quality and not i['source'] == source][:10]

            self.progressDialog = control.progressDialog
            self.progressDialog.create(control.addonInfo('name'), '')
            self.progressDialog.update(0)

            block = None

            for i in range(len(items)):
                try:
                    self.progressDialog.update(int((100 / float(len(items))) * i), str(items[i]['label']), str(' '))

                    if items[i]['source'] == block: raise Exception()

                    w = workers.Thread(self.sourcesResolve, items[i]['url'], items[i]['provider'])
                    w.start()

                    m = ''

                    for x in range(3600):
                        if self.progressDialog.iscanceled(): return self.progressDialog.close()
                        if xbmc.abortRequested == True: return sys.exit()
                        k = control.condVisibility('Window.IsActive(virtualkeyboard)')
                        if k: m += '1'; m = m[-1]
                        if (w.is_alive() == False or x > 30) and not k: break
                        time.sleep(1)

                    for x in range(30):
                        if m == '': break
                        if self.progressDialog.iscanceled(): return self.progressDialog.close()
                        if xbmc.abortRequested == True: return sys.exit()
                        if w.is_alive() == False: break
                        time.sleep(1)


                    if w.is_alive() == True: block = items[i]['source']

                    if self.url == None: raise Exception()

                    try: self.progressDialog.close()
                    except: pass

                    control.sleep(200)

                    if control.setting('playback_info') == 'true':
                        control.infoDialog(items[i]['label'], heading=name)

                    from resources.lib.libraries.player import player
                    player().run(content, name, self.url, year, imdb, tvdb, meta)

                    return self.url
                except:
                    pass

            try: self.progressDialog.close()
            except: pass

            raise Exception()

        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #13
0
    def playItem(self, content, name, imdb, tvdb, source):
        try:
            next = []
            prev = []

            for i in range(1, 1000000):
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    u = json.loads(
                        dict(urlparse.parse_qsl(u.replace('?',
                                                          '')))['source'])[0]
                    next.append(u)
                except:
                    break
            for i in range(-1000000, 0)[::-1]:
                try:
                    u = control.infoLabel('ListItem(%s).FolderPath' % str(i))
                    u = json.loads(
                        dict(urlparse.parse_qsl(u.replace('?',
                                                          '')))['source'])[0]
                    prev.append(u)
                except:
                    break

            items = json.loads(source)

            source, quality = items[0]['source'], items[0]['quality']
            items = [
                i for i in items + next + prev
                if i['quality'] == quality and i['source'] == source
            ][:15]
            items += [
                i for i in next + prev
                if i['quality'] == quality and not i['source'] == source
            ][:35]

            block = None

            for i in items:
                try:
                    if i['source'] == block: raise Exception()

                    w = workers.Thread(self.sourcesResolve, i['url'],
                                       i['provider'])
                    w.start()
                    time.sleep(20)

                    if w.is_alive() == True: block = i['source']

                    if self.url == None: raise Exception()

                    if control.setting('playback_info') == 'true':
                        control.infoDialog(i['label'], heading=name)

                    from resources.lib.libraries.player import player
                    player().run(content, name, self.url, imdb, tvdb)

                    return self.url
                except:
                    pass

            raise Exception()

        except:
            control.infoDialog(control.lang(30501).encode('utf-8'))
            pass
예제 #14
0
파일: __init__.py 프로젝트: bialagary/mw
    def playItem(self, content, name, imdb, tvdb, source):
        try:
            next = []
            prev = []
            total = []

            for i in range(1, 10000):
                try:
                    u = control.infoLabel("ListItem(%s).FolderPath" % str(i))
                    if u in total:
                        raise Exception()
                    total.append(u)
                    u = json.loads(dict(urlparse.parse_qsl(u.replace("?", "")))["source"])[0]
                    next.append(u)
                except:
                    break
            for i in range(-10000, 0)[::-1]:
                try:
                    u = control.infoLabel("ListItem(%s).FolderPath" % str(i))
                    if u in total:
                        raise Exception()
                    total.append(u)
                    u = json.loads(dict(urlparse.parse_qsl(u.replace("?", "")))["source"])[0]
                    prev.append(u)
                except:
                    break

            items = json.loads(source)

            source, quality = items[0]["source"], items[0]["quality"]
            items = [i for i in items + next + prev if i["quality"] == quality and i["source"] == source][:10]
            items += [i for i in next + prev if i["quality"] == quality and not i["source"] == source][:10]

            import xbmc

            dialog = control.progressDialog
            dialog.create(control.addonInfo("name"), "")
            dialog.update(0)

            block = None

            for i in range(len(items)):
                try:
                    dialog.update(int((100 / float(len(items))) * i), str(items[i]["label"]))

                    if items[i]["source"] == block:
                        raise Exception()

                    w = workers.Thread(self.sourcesResolve, items[i]["url"], items[i]["provider"])
                    w.start()

                    for x in range(0, 15 * 2):
                        if dialog.iscanceled():
                            return dialog.close()
                        if xbmc.abortRequested == True:
                            return sys.exit()
                        if w.is_alive() == False:
                            break
                        time.sleep(0.5)

                    if w.is_alive() == True:
                        block = items[i]["source"]

                    if self.url == None:
                        raise Exception()

                    try:
                        dialog.close()
                    except:
                        pass

                    if control.setting("playback_info") == "true":
                        control.infoDialog(items[i]["label"], heading=name)

                    from resources.lib.libraries.player import player

                    player().run(content, name, self.url, imdb, tvdb)

                    return self.url
                except:
                    pass

            try:
                dialog.close()
            except:
                pass

            raise Exception()

        except:
            control.infoDialog(control.lang(30501).encode("utf-8"))
            pass