当前位置: 首页>>代码示例>>Python>>正文


Python Tmdb.get_id方法代码示例

本文整理汇总了Python中core.tmdb.Tmdb.get_id方法的典型用法代码示例。如果您正苦于以下问题:Python Tmdb.get_id方法的具体用法?Python Tmdb.get_id怎么用?Python Tmdb.get_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core.tmdb.Tmdb的用法示例。


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

示例1: info

# 需要导入模块: from core.tmdb import Tmdb [as 别名]
# 或者: from core.tmdb.Tmdb import get_id [as 别名]
def info(title, thumbnail):
    logger.info("streamondemand.eurostreaminginfo info")
    infoLabels={}
    plot={}
    try:
        from core.tmdb import Tmdb
        oTmdb= Tmdb(texto_buscado=title, tipo= "movie")
        count = 0
        if oTmdb.total_results > 0:
            #Mientras el thumbnail no coincida con el del resultado de la búsqueda, pasa al siguiente resultado
            while oTmdb.get_poster(size="w185") != thumbnail:
                count += 1
                oTmdb.load_resultado(index_resultado=count)
                if count == oTmdb.total_results : break
            infoLabels['code'] = oTmdb.get_id()
            infoLabels['plot'] = oTmdb.get_sinopsis()
            infoLabels['title'] = oTmdb.result["title"]
            infoLabels['year']= oTmdb.result["release_date"][:4]
            infoLabels['genre'] = ", ".join(oTmdb.result["genres"])
            infoLabels['rating'] = float(oTmdb.result["vote_average"])
            fanart=oTmdb.get_backdrop()
            poster=oTmdb.get_poster()
            plot['infoLabels']=infoLabels
            return plot, fanart, poster
    except:
        pass	
开发者ID:dentaku65,项目名称:plugin.video.streamondemand,代码行数:28,代码来源:eurostreaminginfo.py

示例2: tmdb

# 需要导入模块: from core.tmdb import Tmdb [as 别名]
# 或者: from core.tmdb.Tmdb import get_id [as 别名]
def tmdb(item):
    from core.tmdb import Tmdb
    #oTmdb= Tmdb(id_Tmdb='1399',tipo='tv')
    #print oTmdb.get_poster(rnd= True, size="w185")
    #oTmdb= Tmdb(texto_buscado='juego de tronos',tipo='tv')
    oTmdb= Tmdb(external_id='121361',tipo='tv',external_source="tvdb_id")
    print "id: " + oTmdb.get_id()
    #print oTmdb.get_episodio(2,5)
    #print oTmdb.get_episodio(2,1)
    print oTmdb.get_sinopsis()
开发者ID:superberny70,项目名称:plugin.video.pelisalacarta-3-9X,代码行数:12,代码来源:peliserie.py

示例3: completar_codigos

# 需要导入模块: from core.tmdb import Tmdb [as 别名]
# 或者: from core.tmdb.Tmdb import get_id [as 别名]
def completar_codigos(item):
    """
    Si es necesario comprueba si existe el identificador de tmdb y sino existe trata de buscarlo
    @param item: tipo item
    @type item: Item
    """
    if not item.infoLabels['tmdb_id']:
        listsources = [(item.infoLabels['tvdb_id'], "tvdb_id")]
        if item.infoLabels['imdb_id']:
            listsources.append((item.infoLabels['imdb_id'], "imdb_id"))

        from core.tmdb import Tmdb
        ob = Tmdb()

        for external_id, external_source in listsources:
            ob.search_by_id(id=external_id, source=external_source, tipo='tv')

            item.infoLabels['tmdb_id'] = ob.get_id()
            if item.infoLabels['tmdb_id']:
                url_scraper = "https://www.themoviedb.org/tv/%s" % item.infoLabels['tmdb_id']
                item.infoLabels['url_scraper'].append(url_scraper)
                break
开发者ID:CYBERxNUKE,项目名称:xbmc-addon,代码行数:24,代码来源:tvdb.py

示例4: InfoWindow

# 需要导入模块: from core.tmdb import Tmdb [as 别名]
# 或者: from core.tmdb.Tmdb import get_id [as 别名]

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

    def get_item_info(self, item):
        # Recogemos los parametros del Item que nos interesan:
        if "title" in item and item.title != "":
            self.item_title = item.title
        if "fulltitle" in item and item.fulltitle != "":
            self.item_title = item.fulltitle
        if "contentTitle" in item and item.contentTitle != "":
            self.item_title = item.contentTitle

        if "show" in item and item.show != "":
            self.item_serie = item.show
        if "contentSerieName" in item and item.contentSerieName != "":
            self.item_serie = item.contentSerieName

        if "contentSeason" in item and item.contentSeason != "":
            self.item_temporada = item.contentSeason
        if "contentepisodeNumber" in item and item.contentepisodeNumber != "":
            self.item_episodio = item.contentepisodeNumber

        # i no existen contentepisodeNumber o contentSeason intenta sacarlo del titulo
        if not self.item_episodio or not self.item_temporada:
            self.get_episode_from_title(item)

    def get_dict_info(self, dct):
        self.result = dct

    def get_tmdb_movie_data(self, text):
        # Buscamos la pelicula si no lo esta ya
        if not self.otmdb:
            self.otmdb = Tmdb(texto_buscado=text, idioma_busqueda="es", tipo="movie")

        # Si no hay resultados salimos
        if not self.otmdb.get_id():
            return False

        # Informacion de la pelicula
        self.result["type"] = "movie"
        self.result["id_Tmdb"] = self.otmdb.get_id()
        self.result["title"] = self.otmdb.result["title"]
        self.result["original_title"] = self.otmdb.result["original_title"]
        self.result["date"] = self.get_date(self.otmdb.result["release_date"])
        self.result["language"] = self.get_language(self.otmdb.result["original_language"])
        self.result["rating"] = self.otmdb.result["vote_average"] + "/10 (" + self.otmdb.result["vote_count"] + ")"
        self.result["genres"] = ", ".join(self.otmdb.result["genres"])
        self.result["thumbnail"] = self.otmdb.get_poster()
        self.result["fanart"] = self.otmdb.get_backdrop()
        self.result["overview"] = self.otmdb.result["overview"]

        return True

    def get_tmdb_tv_data(self, text, season=0, episode=0):
        # Pasamos la temporada y episodeo a int()
        season = int(season)
        episode = int(episode)

        # Buscamos la serie si no esta cargada
        if not self.otmdb:
            self.otmdb = Tmdb(texto_buscado=text, idioma_busqueda="es", tipo="tv")

        _id = self.otmdb.get_id()

        # Si no hay resultados salimos
        if not _id:
            return False
开发者ID:kampanita,项目名称:pelisalacarta,代码行数:69,代码来源:xbmc_info_window.py

示例5: InfoWindow

# 需要导入模块: from core.tmdb import Tmdb [as 别名]
# 或者: from core.tmdb.Tmdb import get_id [as 别名]

#.........这里部分代码省略.........
        matches = pattern.findall(item.contentTitle)
        if len(matches):
            self.item_temporada = matches[0][0]
            self.item_episodio = matches[0][1]

    def get_item_info(self, item):
        # Recogemos los parametros del Item que nos interesan:
        self.item_title = item.title
        if item.fulltitle:
            self.item_title = item.fulltitle
        if item.contentTitle:
            self.item_title = item.contentTitle

        if item.show:
            self.item_serie = item.show
        if item.contentSerieName:
            self.item_serie = item.contentSerieName

        if item.contentSeason:
            self.item_temporada = item.contentSeason
        if item.contentEpisodeNumber:
            self.item_episodio = item.contentEpisodeNumber

        # i no existen contentepisodeNumber o contentSeason intenta sacarlo del titulo
        if not self.item_episodio or not self.item_temporada:
            self.get_episode_from_title(item)

    def get_tmdb_movie_data(self, text):
        # Buscamos la pelicula si no lo esta ya
        if not self.otmdb:
            self.otmdb = Tmdb(texto_buscado=text, idioma_busqueda="es", tipo="movie")

        # Si no hay resultados salimos
        if not self.otmdb.get_id():
            return False

        # Informacion de la pelicula
        infoLabels = self.otmdb.get_infoLabels()
        infoLabels["mediatype"] = "movie"
        infoLabels["language"] = self.get_language(infoLabels["original_language"])
        infoLabels["puntuacion"] = str(infoLabels["rating"]) + "/10 (" + str(infoLabels["votes"]) + ")"

        self.result = infoLabels

        return True

    def get_tmdb_tv_data(self, text):
        # Buscamos la serie si no esta cargada
        if not self.otmdb:
            self.otmdb = Tmdb(texto_buscado=text, idioma_busqueda="es", tipo="tv")

        # Si no hay resultados salimos
        if not self.otmdb.get_id():
            return False

        # informacion generica de la serie
        infoLabels = self.otmdb.get_infoLabels()
        infoLabels["mediatype"] = "tvshow"
        infoLabels["language"] = self.get_language(infoLabels["original_language"])
        infoLabels["puntuacion"] = str(infoLabels["rating"]) + "/10 (" + str(infoLabels["votes"]) + ")"

        self.result = infoLabels

        # Si tenemos informacion de temporada
        if self.item_temporada:
            if not self.result["seasons"]:
开发者ID:ChopChopKodi,项目名称:pelisalacarta,代码行数:70,代码来源:xbmc_info_window.py


注:本文中的core.tmdb.Tmdb.get_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。