• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sources.sources函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中resources.lib.sources.sources函数的典型用法代码示例。如果您正苦于以下问题:Python sources函数的具体用法?Python sources怎么用?Python sources使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sources函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: add

    def add(self, tvshowtitle, year, imdb, tmdb, tvdb, tvrage, range=False):
        if not control.condVisibility('Window.IsVisible(infodialog)') and not control.condVisibility('Player.HasVideo'):
            control.infoDialog(control.lang(30421).encode('utf-8'), time=10000000)
            self.infoDialog = True

        from resources.lib.indexers import episodes
        items = episodes.episodes().get(tvshowtitle, year, imdb, tmdb, tvdb, tvrage, idx=False)

        try: items = [{'name': i['name'], 'title': i['title'], 'year': i['year'], 'imdb': i['imdb'], 'tmdb': i['tmdb'], 'tvdb': i['tvdb'], 'tvrage': i['tvrage'], 'season': i['season'], 'episode': i['episode'], 'tvshowtitle': i['tvshowtitle'], 'alter': i['alter'], 'date': i['premiered']} for i in items]
        except: items = []

        try:
            if not self.dupe_setting == 'true': raise Exception()
            if items == []: raise Exception()

            id = [items[0]['imdb'], items[0]['tvdb']]
            if not items[0]['tmdb'] == '0': id += [items[0]['tmdb']]

            lib = control.jsonrpc('{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties" : ["imdbnumber", "title", "year"]}, "id": 1}')
            lib = unicode(lib, 'utf-8', errors='ignore')
            lib = json.loads(lib)['result']['tvshows']
            lib = [i['title'].encode('utf-8') for i in lib if str(i['imdbnumber']) in id or (i['title'].encode('utf-8') == items[0]['tvshowtitle'] and str(i['year']) == items[0]['year'])][0]

            lib = control.jsonrpc('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": {"filter":{"and": [{"field": "tvshow", "operator": "is", "value": "%s"}]}, "properties": ["season", "episode"]}, "id": 1}' % lib)
            lib = unicode(lib, 'utf-8', errors='ignore')
            lib = json.loads(lib)['result']['episodes']
            lib = ['S%02dE%02d' % (int(i['season']), int(i['episode'])) for i in lib]

            items = [i for i in items if not 'S%02dE%02d' % (int(i['season']), int(i['episode'])) in lib]
        except:
            pass

        for i in items:
            try:
                if xbmc.abortRequested == True: return sys.exit()

                if self.check_setting == 'true':
                    if i['episode'] == '1':
                        self.block = True
                        from resources.lib.sources import sources
                        src = sources().getSources(i['name'], i['title'], i['year'], i['imdb'], i['tmdb'], i['tvdb'], i['tvrage'], i['season'], i['episode'], i['tvshowtitle'], i['alter'], i['date'])
                        if len(src) > 0: self.block = False
                    if self.block == True: raise Exception()

                if int(self.date) <= int(re.sub('[^0-9]', '', str(i['date']))):
                    from resources.lib.sources import sources
                    src = sources().getSources(i['name'], i['title'], i['year'], i['imdb'], i['tmdb'], i['tvdb'], i['tvrage'], i['season'], i['episode'], i['tvshowtitle'], i['alter'], i['date'])
                    if not len(src) > 0: raise Exception()

                self.strmFile(i)
            except:
                pass

        if range == True: return

        if self.infoDialog == True:
            control.infoDialog(control.lang(30423).encode('utf-8'), time=1)

        if self.library_setting == 'true' and not control.condVisibility('Library.IsScanningVideo'):
            control.execute('UpdateLibrary(video)')
开发者ID:8821kitkat,项目名称:officialrepo,代码行数:60,代码来源:libtools.py


示例2: getConstants

    def getConstants(self):
        self.itemProperty = 'plugin.video.flixnet.container.items'

        self.metaProperty = 'plugin.video.flixnet.container.meta'

        from resources.lib.sources import sources as sources
        from resources.lib.sources_de import sources as sources_de
        from resources.lib.sources_fr import sources as sources_fr
        from resources.lib.sources_pt import sources as sources_pt
        from resources.lib.sources_pl import sources as sources_pl
        from resources.lib.sources_ko import sources as sources_ko

        self.sourceDict = sources() + sources_de() + sources_fr() + sources_pt() + sources_pl() + sources_ko()

        try:
            self.hostDict = urlresolver.relevant_resolvers(order_matters=True)
            self.hostDict = [i.domains for i in self.hostDict if not '*' in i.domains]
            self.hostDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostDict)]
            self.hostDict = [x for y,x in enumerate(self.hostDict) if x not in self.hostDict[:y]]
        except:
            self.hostDict = []

        self.hostprDict = ['1fichier.com', 'oboom.com', 'rapidgator.net', 'rg.to', 'uploaded.net', 'uploaded.to', 'ul.to', 'filefactory.com', 'nitroflare.com', 'turbobit.net', 'uploadrocket.net']

        self.hostcapDict = ['hugefiles.net', 'kingfiles.net', 'openload.io', 'openload.co', 'oload.tv', 'thevideo.me', 'vidup.me', 'streamin.to', 'torba.se']

        self.hosthqDict = ['openload.io', 'openload.co', 'oload.tv', 'thevideo.me', 'rapidvideo.com', 'raptu.com', 'filez.tv']

        self.hostblockDict = []

        self.debridDict = debrid.debridDict()
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:31,代码来源:sources.py


示例3: _resolve

	def _resolve(self, source, clean = True, info = False, internal = True):
		# Resolves the link using the providers and urlresolver.
		from resources.lib.sources import sources # Must be imported here due to circular imports.
		self.mLink = sources().sourcesResolve(source, info = info, internal = internal)
		if clean and self.mLink:
			self.mLink, self.mHeadersPost = self._linkClean(self.mLink)
		return self.mLink
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:7,代码来源:network.py


示例4: add

    def add(self, name, title, year, imdb, tmdb, range=False):
        if not control.condVisibility("Window.IsVisible(infodialog)") and not control.condVisibility("Player.HasVideo"):
            control.infoDialog(control.lang(30421).encode("utf-8"), time=10000000)
            self.infoDialog = True

        try:
            if not self.dupe_setting == "true":
                raise Exception()

            id = [imdb, tmdb] if not tmdb == "0" else [imdb]
            lib = control.jsonrpc(
                '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"filter":{"or": [{"field": "year", "operator": "is", "value": "%s"}, {"field": "year", "operator": "is", "value": "%s"}, {"field": "year", "operator": "is", "value": "%s"}]}, "properties" : ["imdbnumber", "originaltitle", "year"]}, "id": 1}'
                % (year, str(int(year) + 1), str(int(year) - 1))
            )
            lib = unicode(lib, "utf-8", errors="ignore")
            lib = json.loads(lib)["result"]["movies"]
            lib = [
                i
                for i in lib
                if str(i["imdbnumber"]) in id
                or (i["originaltitle"].encode("utf-8") == title and str(i["year"]) == year)
            ][0]
        except:
            lib = []

        try:
            if not lib == []:
                raise Exception()

            if self.check_setting == "true":
                from resources.lib.sources import sources

                src = sources().checkSources(name, title, year, imdb, tmdb, "0", "0", None, None, None, "0", None)
                if src == False:
                    raise Exception()

            self.strmFile({"name": name, "title": title, "year": year, "imdb": imdb, "tmdb": tmdb})
        except:
            pass

        if range == True:
            return

        if self.infoDialog == True:
            control.infoDialog(control.lang(30423).encode("utf-8"), time=1)

        if self.library_setting == "true" and not control.condVisibility("Library.IsScanningVideo"):
            control.execute("UpdateLibrary(video)")
开发者ID:cuongnvth,项目名称:hieuhien.vn,代码行数:48,代码来源:libtools.py


示例5: getConstants

    def getConstants(self):
        from resources.lib.sources import sources as sources
        self.sourceDict = sources()

        try:
            self.hostDict = urlresolver.relevant_resolvers(order_matters=True)
            self.hostDict = [i.domains for i in self.hostDict if not '*' in i.domains]
            self.hostDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostDict)]
            self.hostDict = [x for y,x in enumerate(self.hostDict) if x not in self.hostDict[:y]]
        except:
            self.hostDict = []

        self.hostprDict = ['1fichier.com', 'oboom.com', 'rapidgator.net', 'rg.to', 'uploaded.net', 'uploaded.to', 'ul.to', 'filefactory.com', 'nitroflare.com', 'turbobit.net', 'uploadrocket.net']

        self.hostcapDict = ['hugefiles.net', 'kingfiles.net', 'openload.io', 'openload.co', 'thevideo.me', 'vidup.me', 'streamin.to', 'torba.se']

        self.hostblockDict = []
开发者ID:CYBERxNUKE,项目名称:xbmc-addon,代码行数:17,代码来源:sources.py


示例6: get_sources

    def get_sources(self, url, hosthdDict, hostDict, locDict):
        try:
            self.sources = []

            if url == None: return self.sources

            url = url.replace('\'', '')
            url = re.sub(r'[^a-zA-Z0-9\s]+', ' ', url).lower().strip()
            url = re.sub('\s\s+' , ' ', url)
            url = url.replace(' ' , '-')

            query = urlparse.urljoin(self.base_link, url)

            result = client.source(query)
            if result == None: raise Exception()

            fmt = re.compile('url *: *[\'|\"](.+?)[\'|\"]').findall(result)
            fmt = fmt[0] if len(fmt) > 0 else ''
            fmt = re.sub('(.+)(\d{4}|s\d*e\d*)-', '', fmt.lower())
            fmt = re.split('-', fmt.replace('/' , ''))

            if any(x in ['dvdscr', 'r5', 'r6', 'camrip', 'tsrip', 'hdcam', 'hdts', 'dvdcam', 'dvdts', 'cam', 'ts'] for x in fmt): raise Exception()
            elif '1080p' in fmt: quality = '1080p'
            elif '720p' in fmt: quality = 'HD'
            else: raise Exception()

            hostdirhdDict = sources.sources().hostdirhdDict

            links = client.parseDOM(result, 'a', attrs = {'rel': 'nofollow'})
            links = [i for i in links if i.startswith('http')]
            links = [(i, quality, hostdirhdDict) for i in links]


            threads = []
            for i in links: threads.append(workers.Thread(self.check, i))
            [i.start() for i in threads]
            for i in range(0, 10 * 2):
                is_alive = [x.is_alive() for x in threads]
                if all(x == False for x in is_alive): break
                time.sleep(0.5)


            return self.sources
        except:
            return self.sources
开发者ID:DanielOrc,项目名称:lambda-addons,代码行数:45,代码来源:oneclickwatch_mv_tv.py


示例7: get

 def get(self):
     try :
         name=None
         title=None
         year=None
         imdb=None
         tmdb=None
         tvdb=None
         tvrage=None
         season=None
         episode=None
         tvshowtitle=None
         alter=None
         date=None
         meta=None
         sourceList = cache.get(sources().getSources, 2, name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta)
         self.list.extend(sourceList)
         self.list = sorted(self.list, key=lambda k: k['name'])
         self.channelDirectory(self.list)
     except :
         pass
开发者ID:kevintone,项目名称:tdbaddon,代码行数:21,代码来源:livetv.py


示例8: sources

    from resources.lib.indexers import tvshows
    from resources.lib.indexers import livetv

    #import json
    #from resources.lib.sources import sources
    #from resources.lib.libraries import downloader
    #url = 'http://openload.co/stream/P-irqGW8ylM~1462390526~159.63.0.0~tNX8w6cV?mime=true|User-Agent=Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
    #try: downloader.download(name, image, url)
    #except: pass

    #livetv.channels().get()
    #tvshows.tvshows().get(url, provider=provider, network=name)
    #movies.movies().get(url, provider=provider, lang=lang)
    #episodes.episodes().get(tvshowtitle, year, imdb, tmdb, tvdb, tvrage, season, episode, provider=provider, url=url)

    sources().addItem(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta)
    #sources().play(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta, url)
    #sources().playItem(content, name, year, imdb, tvdb, source)
    #print re.compile()

    #from resources.lib.sources.ditto_live import source
    #source().getLiveSource()

    '''import json, urllib
    source = {"provider":provider, "url":url, "quality":'HD', "label":provider, "source":provider}
    tmp=json.dumps([source])
    print tmp
    tmp= urllib.quote_plus(tmp)
    print tmp
    tmp = urllib.unquote_plus(tmp)
    print json.loads(tmp)'''
开发者ID:kevintone,项目名称:tdbaddon,代码行数:31,代码来源:aftershock-testharness.py


示例9: sources

elif action == 'tvshowToLibrary':
    from resources.lib.libraries import libtools
    libtools.libtvshows().add(tvshowtitle, year, imdb, tmdb, tvdb, service)

elif action == 'tvshowsToLibrary':
    from resources.lib.libraries import libtools
    libtools.libtvshows().range(url)

elif action == 'updateLibrary':
    from resources.lib.libraries import libtools
    libtools.libepisodes().update(query)

elif action == 'resolve':
    from resources.lib.sources import sources
    from resources.lib.libraries import control
    url = sources().sourcesResolve(url, provider)
    control.addItem(handle=int(sys.argv[1]), url=url, listitem=control.item(name))
    control.directory(int(sys.argv[1]))

elif action == 'download':
    from resources.lib.sources import sources
    from resources.lib.libraries import simpledownloader
    url = sources().sourcesResolve(url, provider)
    simpledownloader.download(name, image, url)

elif action == 'play':
    from resources.lib.sources import sources
    sources().play(name, title, service, meta, url)

elif action == 'sources':
    from resources.lib.sources import sources
开发者ID:anopid,项目名称:filmkodi,代码行数:31,代码来源:default.py


示例10: sources

elif action == 'tvshowsToLibrary':
    from resources.lib.libraries import libtools
    libtools.libtvshows().range(url, query)

elif action == 'updateLibrary':
    from resources.lib.libraries import libtools
    libtools.libepisodes().update(query)

elif action == 'service':
    from resources.lib.libraries import libtools
    libtools.libepisodes().service()

elif action == 'play':
    from resources.lib.sources import sources
    sources().play(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, url)

elif action == 'sources':
    from resources.lib.sources import sources
    sources().addItem(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta)

elif action == 'playItem':
    from resources.lib.sources import sources
    sources().playItem(content, name, imdb, tvdb, url, source, provider)

elif action == 'alterSources':
    from resources.lib.sources import sources
    sources().alterSources(url, meta)

elif action == 'clearSources':
    from resources.lib.sources import sources
开发者ID:fopina,项目名称:lambda-addons,代码行数:30,代码来源:default.py


示例11: addDownload

def addDownload(name, url, image, provider=None):
    try:
        def download(): return []
        result = cache.get(download, 600000000, table='rel_dl')
        result = [i['name'] for i in result]
    except:
        pass

    if name in result:
        return control.infoDialog('Item Already In Your Queue', name)

    try:
        if not provider == None:
            from resources.lib.sources import sources
            url = sources().sourcesResolve(url, provider)
            if url == None: raise Exception()


        #legacy issue, will be removed later
        if 'afdah.org' in url and not '</source>' in url: url += '<source>afdah</source>'

        if '</source>' in url:
            source = re.compile('<source>(.+?)</source>').findall(url)[0]
            url = re.compile('(.+?)<source>').findall(url)[0]

            for i in ['_mv', '_tv', '_mv_tv']:
                try: call = __import__('resources.lib.sources.%s%s' % (source, i), globals(), locals(), ['object'], -1).source()
                except: pass

            from resources.lib import sources ; d = sources.sources()

            url = call.get_sources(url, d.hosthdfullDict, d.hostsdfullDict, d.hostlocDict)

            if type(url) == list:
                url = sorted(url, key=lambda k: k['quality'])
                url = url[0]['url']

            url = call.resolve(url)


        from resources.lib import resolvers
        url = resolvers.request(url)

        if type(url) == list:
            url = sorted(url, key=lambda k: k['quality'])
            url = url[0]['url']

        if url == None: raise Exception()
    except:
        return control.infoDialog('Unplayable stream')
        pass

    try:
        u = url.split('|')[0]
        try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1]))
        except: headers = dict('')

        ext = os.path.splitext(urlparse.urlparse(u).path)[1][1:].lower()
        if ext == 'm3u8': raise Exception()
        #if not ext in ['mp4', 'mkv', 'flv', 'avi', 'mpg']: ext = 'mp4'
        dest = name + '.' + ext

        req = urllib2.Request(u, headers=headers)
        resp = urllib2.urlopen(req, timeout=30)
        size = int(resp.headers['Content-Length'])
        size = ' %.2f GB' % (float(size) / 1073741824)

        no = control.yesnoDialog(dest, 'Complete file is' + size, 'Continue with download?', name + ' - ' + 'Confirm Download', 'Confirm', 'Cancel')

        if no: return
    except:
        return control.infoDialog('Unable to download')
        pass

    def download(): return [{'name': name, 'url': url, 'image': image}]
    result = cache.get(download, 600000000, table='rel_dl')
    result = [i for i in result if not i['url'] == url]
    def download(): return result + [{'name': name, 'url': url, 'image': image}]
    result = cache.get(download, 0, table='rel_dl')

    control.infoDialog('Item Added to Queue', name)
开发者ID:8821kitkat,项目名称:officialrepo,代码行数:81,代码来源:downloader.py


示例12: resolveUrl

def resolveUrl(name, url, audio, image, fanart, playable, content):
    try:
        if '.f4m'in url:
            label = cleantitle(name)
            ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower()
            if not ext == 'f4m': raise Exception()
            from resources.lib.libraries.f4mproxy.F4mProxy import f4mProxyHelper
            return f4mProxyHelper().playF4mLink(url, label, None, None,'',image)


        #legacy issue, will be removed later
        if 'afdah.org' in url and not '</source>' in url: url += '<source>afdah</source>'

        if '</source>' in url:
            source = re.compile('<source>(.+?)</source>').findall(url)[0]
            url = re.compile('(.+?)<source>').findall(url)[0]

            for i in ['_mv', '_tv', '_mv_tv']:
                try: call = __import__('resources.lib.sources.%s%s' % (source, i), globals(), locals(), ['object'], -1).source()
                except: pass

            from resources.lib import sources ; d = sources.sources()

            url = call.get_sources(url, d.hosthdfullDict, d.hostsdfullDict, d.hostlocDict)

            if type(url) == list and len(url) == 1:
                url = url[0]['url']

            elif type(url) == list:
                url = sorted(url, key=lambda k: k['quality'])
                for i in url: i.update((k, '720p') for k, v in i.iteritems() if v == 'HD')
                for i in url: i.update((k, '480p') for k, v in i.iteritems() if v == 'SD')
                q = [i['quality'].upper() for i in url]
                u = [i['url'] for i in url]
                select = control.selectDialog(q)
                if select == -1: return
                url = u[select]

            url = call.resolve(url)


        from resources.lib import resolvers
        url = resolvers.request(url)

        if type(url) == list and len(url) == 1:
            url = url[0]['url']

        elif type(url) == list:
            url = sorted(url, key=lambda k: k['quality'])
            for i in url: i.update((k, '720p') for k, v in i.iteritems() if v == 'HD')
            for i in url: i.update((k, '480p') for k, v in i.iteritems() if v == 'SD')
            q = [i['quality'].upper() for i in url]
            u = [i['url'] for i in url]
            select = control.selectDialog(q)
            if select == -1: return
            url = u[select]

        if url == None: raise Exception()
    except:
        return control.infoDialog('Unplayable stream')
        pass


    if playable == 'true':
        item = control.item(path=url)
        return control.resolve(int(sys.argv[1]), True, item)
    else:
        label = cleantitle(name)
        item = control.item(path=url, iconImage=image, thumbnailImage=image)
        item.setInfo( type='Video', infoLabels = {'title': label} )
        control.playlist.clear()
        control.player.play(url, item)
开发者ID:smoky-jr,项目名称:lambda-addons,代码行数:72,代码来源:phstreams.py


示例13: getOneStrm

def getOneStrm(all_strms):
    if not all_strms:
        return False
    first_strm_name = sorted(all_strms.keys())[0]
    ep = all_strms[first_strm_name]
    title = ep["title"]
    year = ep["year"]
    imdb = ep["imdb"]
    tvdb = ep["tvdb"]
    tmdb = ep["tmdb"]
    tvrage = ep["tvrage"]
    date = ep["date"]
    season = ep["season"]
    episode = ep["episode"]
    show = ep["tvshowtitle"]
    name = ep["name"]
    downloaded_filename_base = (
        getGenesisSetting("tv_downloads") + first_strm_name[len(getGenesisSetting("tv_library")) :]
    )
    try:
        xbmcvfs.mkdirs(os.path.dirname(downloaded_filename_base))
    except:
        pass

    all_strms.pop(first_strm_name, None)

    try:
        state().setProperty(curr_download_prop, os.path.basename(str(first_strm_name)))
    except:
        state().setProperty(next_download_prop, "None")

    try:
        state().setProperty(next_download_prop, os.path.basename(str(sorted(all_strms.keys())[0])))
    except:
        state().setProperty(next_download_prop, "None")

    try:
        state().setProperty(queue_length, str(len(all_strms.keys())))
    except:
        state().setProperty(queue_length, "0")

    src = sources.sources()

    has_sources = src.checkSources(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, show, "0", date)
    if not has_sources:
        xbmc.log(msg="Genesis Prefetch: No sources for " + name, level=xbmc.LOGNOTICE)
        return False

    source_names = src.sourcesFilter()

    extra_filtered_sources = []
    # Drop LQ/MQ links. We want decent quality for the prefetch.
    for s in source_names:
        if s["label"].find("LQ") >= 0 or s["label"].find("MQ") >= 0:
            continue
        else:
            extra_filtered_sources.append(s)

    sources_dict = {}
    # This part needs to be put into threads per URL.
    # Gets so slow that we can't use opened connections and need to open again.
    for single_source in extra_filtered_sources:
        src.sources = [single_source]
        url = src.sourcesDirect()
        if not url:
            continue
        try:
            (main_url, headers) = parseGenesisUrl(url)
            u = download.getResponse(main_url, headers, 0, "")
            if not u:
                continue
            meta = u.info()
            try:
                content_type = meta.getheaders("Content-Type")[0]
            except:
                content_type = None

            if content_type == "text/html" or content_type == "text/plain":
                continue
            h = meta.getheaders("Content-Length")

            try:
                file_size = int(h[0])
            except:
                continue

            extension = ".mp4"
            for ext in [".mp4", ".flv", ".avi", ".mkv"]:
                if url.lower().find(ext) > 0:
                    extension = ext
            sources_dict[main_url] = (file_size, u, extension, main_url, headers)
        except Exception as e:
            xbmc.log(msg="Genesis Prefetch: FETCH HEADERS EXCEPTION: " + str(e), level=xbmc.LOGNOTICE)
            continue

    # Pick largest file, because quality.
    sorted_by_size = sorted(sources_dict.values(), key=lambda tup: tup[0], reverse=True)

    for (file_size, u, extension, url, headers) in sorted_by_size:
        file_name = downloaded_filename_base + extension
#.........这里部分代码省略.........
开发者ID:mitnits,项目名称:lambda-addons,代码行数:101,代码来源:service.py


示例14: sources

elif action == 'tvshows':
    from resources.lib.indexers import tvshows
    tvshows.tvshows().get(url, provider=provider, network=name)

elif action == 'seasons':
    from resources.lib.indexers import episodes
    episodes.seasons().get(tvshowtitle, year, imdb, tmdb, tvdb, tvrage)

elif action == 'episodes':
    from resources.lib.indexers import episodes
    episodes.episodes().get(tvshowtitle, year, imdb, tmdb, tvdb, tvrage, season, episode, provider=provider, url=url)

elif action == 'sources':
    from resources.lib.sources import sources
    sources().addItem(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta)

elif action == 'download':
    import json
    from resources.lib.sources import sources
    from resources.lib.libraries import downloader
    try: downloader.download(name, image, sources().sourcesResolve(json.loads(source)[0]))
    except: pass

elif action == 'play':
    from resources.lib.sources import sources
    sources().play(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta, url)

elif action == 'playItem':
    from resources.lib.sources import sources
    sources().playItem(content, name, year, imdb, tvdb, source)
开发者ID:kevintone,项目名称:tdbaddon,代码行数:30,代码来源:default.py


示例15: sources

elif action == 'tvshows':
    from resources.lib.indexers import tvshows
    tvshows.tvshows().get(url, provider=provider, network=name)

elif action == 'seasons':
    from resources.lib.indexers import episodes
    episodes.seasons().get(tvshowtitle, year, imdb, tmdb, tvdb, tvrage)

elif action == 'episodes':
    from resources.lib.indexers import episodes
    episodes.episodes().get(tvshowtitle, year, imdb, tmdb, tvdb, tvrage, season, episode, provider=provider, url=url)

elif action == 'sources':
    from resources.lib.sources import sources
    sources().addItem(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta)

elif action == 'play':
    from resources.lib.sources import sources
    sources().play(name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, meta, url)

elif action == 'playItem':
    from resources.lib.sources import sources
    sources().playItem(content, name, year, imdb, tvdb, source)

elif action == 'trailer':
    from resources.lib.libraries import trailer
    trailer.trailer().play(name, url)

elif action == 'addView':
    from resources.lib.libraries import views
开发者ID:macblizzard,项目名称:aftershock-repo,代码行数:30,代码来源:default.py


示例16: sources

elif action == 'episodePlaycount':
	from resources.lib.modules import playcount
	playcount.episodes(imdb, tvdb, season, episode, query)

elif action == 'tvPlaycount':
	from resources.lib.modules import playcount
	playcount.tvshows(name, imdb, tvdb, season, query)

elif action == 'trailer':
	from resources.lib.modules import trailer
	trailer.trailer().play(name, url)

elif action == 'play':
	from resources.lib.sources import sources
	sources(type = type, kids = kids).play(title, year, imdb, tvdb, season, episode, tvshowtitle, premiered, meta, select)

elif action == 'addItem':
	from resources.lib.sources import sources
	sources(type = type, kids = kids).addItem()

elif action == 'playItem':
	from resources.lib.extensions import interface
	from resources.lib.sources import sources
	interface.Loader.show() # Immediately show the loader, since slow system will take long to show it in playItem().
	downloadType = params.get('downloadType')
	downloadId = params.get('downloadId')
	handleMode = params.get('handleMode')
	sources(type = type, kids = kids).playItem(source = source, metadata = metadata, downloadType = downloadType, downloadId = downloadId, handleMode = handleMode)

elif action == 'playLocal':
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:30,代码来源:bubbles.py


示例17: verifyProviders

	def verifyProviders(self):
		type = 'providers'
		try:
			from resources.lib.sources import sources

			progressDialog = interface.Dialog.progress(33019, title = 33019)
			progressDialog.update(0, self.__info(type, False))

			try: timeout = tools.Settings.getInteger('providers.timeout')
			except: timeout = 30

			# Add imdb for providers like YIFY who dependt on that.
			itemsMovies = [
				{'title' : 'Titanic', 'year' : '1997', 'imdb' : 'tt0120338'},
				{'title' : 'Avatar', 'year' : '2009', 'imdb' : 'tt0499549'},
				{'title' : 'Star Wars', 'year' : '1977', 'imdb' : 'tt0076759'},
				{'title' : 'Harry Potter', 'year' : '2001', 'imdb' : 'tt0241527'},
			]
			itemsShows = [
				{'tvshowtitle' : 'The Big Bang Theory', 'season' : '10', 'episode' : '1', 'imdb' : 'tt0898266'},
				{'tvshowtitle' : 'Game of Thrones', 'season' : '6', 'episode' : '10', 'imdb' : 'tt0944947'},
				{'tvshowtitle' : 'Rick and Morty', 'season' : '2', 'episode' : '10', 'imdb' : 'tt2861424'},
				{'tvshowtitle' : 'The Sopranos', 'season' : '6', 'episode' : '1', 'imdb' : 'tt0141842'}
			]

			sourcesObject = sources()
			sourcesObject.getConstants()
			hostDict = sourcesObject.hostDict
			hostprDict = sourcesObject.hostprDict

			providers = providerx.Provider.providers(enabled = False, local = False)
			threads = []

			for provider in providers:
				items = []
				if provider['group'] == providerx.Provider.GroupMovies:
					items = itemsMovies
				elif provider['group'] == providerx.Provider.GroupTvshows:
					items = itemsShows
				else:
					items = itemsMovies[:int(len(itemsMovies)/2)] + itemsShows[:int(len(itemsShows)/2)]
				threads.append(workers.Thread(self.__verifyProvider, provider, items, hostDict, hostprDict))

			canceled = False
			[i.start() for i in threads]
			for i in range(0, timeout * max(len(itemsMovies), len(itemsShows)) * 2):
				try:
					if xbmc.abortRequested == True: return sys.exit()
					if progressDialog.iscanceled():
						canceled = True
						break
					progressDialog.update(int((len([i for i in threads if i.is_alive() == False]) / float(len(threads))) * 100), self.__info(type, False))
					if all(i == False for i in [j.is_alive() for j in threads]): break
					time.sleep(0.5)
				except:
					pass

			# Providers still running.
			for i in range(len(threads)):
				if threads[i].is_alive():
					self.__append(providers[i]['name'], self.StatusFailure)

			try: progressDialog.close()
			except: pass

			if not canceled:
				self.__showResults(type)
		except:
			tools.Logger.error()
			self.__showError(type)
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:70,代码来源:verification.py


示例18: update


#.........这里部分代码省略.........
                    pass

            items = [i for x, i in enumerate(items) if i not in items[x + 1 :]]
            if len(items) == 0:
                raise Exception()
        except:
            return

        try:
            lib = control.jsonrpc(
                '{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties" : ["imdbnumber", "title", "year"]}, "id": 1}'
            )
            lib = unicode(lib, "utf-8", errors="ignore")
            lib = json.loads(lib)["result"]["tvshows"]
        except:
            return

        if (
            info == "true"
            and not control.condVisibility("Window.IsVisible(infodialog)")
            and not control.condVisibility("Player.HasVideo")
        ):
            control.infoDialog(control.lang(30422).encode("utf-8"), time=10000000)
            self.infoDialog = True

        try:
            control.makeFile(control.dataPath)
            dbcon = database.connect(control.libcacheFile)
            dbcur = dbcon.cursor()
            dbcur.execute("CREATE TABLE IF NOT EXISTS tvshows (" "id TEXT, " "items TEXT, " "UNIQUE(id)" ");")
        except:
            return
        try:
            from resources.lib.indexers import episodes
        except:
            return

        for item in items:
            it = None

            if xbmc.abortRequested == True:
                return sys.exit()

            try:
                dbcur.execute("SELECT * FROM tvshows WHERE id = '%s'" % item["tvdb"])
                fetch = dbcur.fetchone()
                it = eval(fetch[1].encode("utf-8"))
            except:
                pass

            try:
                if not it == None:
                    raise Exception()

                it = episodes.episodes().get(
                    item["tvshowtitle"],
                    item["year"],
                    item["imdb"],
                    item["tmdb"],
                    item["tvdb"],
                    item["tvrage"],
                    idx=False,
                )

                status = it[0]["status"].lower()
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:66,代码来源:libtools.py


示例19: add

    def add(self, tvshowtitle, year, imdb, tmdb, tvdb, tvrage, range=False):
        if not control.condVisibility("Window.IsVisible(infodialog)") and not control.condVisibility("Player.HasVideo"):
            control.infoDialog(control.lang(30421).encode("utf-8"), time=10000000)
            self.infoDialog = True

        from resources.lib.indexers import episodes

        items = episodes.episodes().get(tvshowtitle, year, imdb, tmdb, tvdb, tvrage, idx=False)

        try:
            items = [
                {
                    "name": i["name"],
                    "title": i["title"],
                    "year": i["year"],
                    "imdb": i["imdb"],
                    "tmdb": i["tmdb"],
                    "tvdb": i["tvdb"],
                    "tvrage": i["tvrage"],
                    "season": i["season"],
                    "episode": i["episode"],
                    "tvshowtitle": i["tvshowtitle"],
                    "alter": i["alter"],
                    "date": i["premiered"],
                }
                for i in items
            ]
        except:
            items = []

        try:
            if not self.dupe_setting == "true":
                raise Exception()
            if items == []:
                raise Exception()

            id = [items[0]["imdb"], items[0]["tvdb"]]
            if not items[0]["tmdb"] == "0":
                id += [items[0]["tmdb"]]

            lib = control.jsonrpc(
                '{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties" : ["imdbnumber", "title", "year"]}, "id": 1}'
            )
            lib = unicode(lib, "utf-8", errors="ignore")
            lib = json.loads(lib)["result"]["tvshows"]
            lib = [
                i["title"].encode("utf-8")
                for i in lib
                if str(i["imdbnumber"]) in id
                or (i["title"].encode("utf-8") == items[0]["tvshowtitle"] and str(i["year"]) == items[0]["year"])
            ][0]

            lib = control.jsonrpc(
                '{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": {"filter":{"and": [{"field": "tvshow", "operator": "is", "value": "%s"}]}, "properties": ["season", "episode"]}, "id": 1}'
                % lib
            )
            lib = unicode(lib, "utf-8", errors="ignore")
            lib = json.loads(lib)["result"]["episodes"]
            lib = ["S%02dE%02d" % (int(i["season"]), int(i["episode"])) for i in lib]

            items = [i for i in items if not "S%02dE%02d" % (int(i["season"]), int(i["episode"])) in lib]
        except:
            pass

        for i in items:
            try:
                if xbmc.abortRequested == True:
                    return sys.exit()

                if self.check_setting == "true":
                    if i["episode"] == "1":
                        self.block = True
                        from resources.lib.sources import sources

                        src = sources().checkSources(
                            i["name"],
                            i["title"],
                            i["year"],
                            i["imdb"],
                            i["tmdb"],
                            i["tvdb"],
                            i["tvrage"],
                            i["season"],
                            i["episode"],
                            i["tvshowtitle"],
                            i["alter"],
                            i["date"],
                        )
                        if src 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.cUtil函数代码示例发布时间:2022-05-26
下一篇:
Python settings.Settings类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap