Exemplo n.º 1
0
def downloadTMDbSerie(file_name, title, overwrite=OverwriteSettings()):
    try:
        results = tmdb.searchSerie(title)
        if len(results) > 0:
            movie = results[0]
            writeEITex(file_name, movie, overwrite)
    except:
        printStackTrace()
Exemplo n.º 2
0
def downloadTMDbEpisode(file_name,
                        title,
                        episode_name,
                        overwrite=OverwriteSettings()):
    try:
        result = tmdb.searchEpisode(title, episode_name)
        if result is not None:
            writeEITex(file_name, result, overwrite)
    except:
        printStackTrace()
Exemplo n.º 3
0
def writeEITex(file_name, movie=MovieDBI(), overwrite=OverwriteSettings()):
    try:
        # DVD directory
        if not os.path.isdir(file_name):
            f_name = os.path.splitext(file_name)[0]
        else:
            f_name = file_name
        eit_file = f_name + ".eit"
        jpg_file = f_name + ".jpg"
        backdrop_file = f_name + ".backdrop.jpg"

        # check and cancel if all exists
        if (not overwrite.eit and os.path.exists(eit_file)) and \
        (not overwrite.cover and os.path.exists(jpg_file)) and \
        (not overwrite.backdrop and os.path.exists(backdrop_file)):
            print "Cancel all data exists:", str(file_name)
            return

        movie.update()
        name = movie.Title
        overview = movie.Overview
        runtime = movie.Runtime
        genre = " ".join(movie.Genres)
        directors = movie.Directors
        writers = movie.Writers
        producers = movie.Producers
        actors = movie.Cast
        released = movie.ReleaseDate
        countries = movie.CountriesShort

        # update certificate and meta genre
        appendShortDescriptionToMeta(file_name, genre)
        setTmdbCertificationtion(movie, file_name)

        downloadCover(movie.poster_url, jpg_file, overwrite.cover)
        downloadCover(movie.backdrop_url, backdrop_file, overwrite.backdrop)

        if os.path.exists(eit_file) and overwrite.eit == False:
            print "File '%s' already exists, eit creation skipped!" % (
                eit_file)
            return True

        # Checking valid movie name
        if not name or len(name) == 0:
            print "tmdb search results no valid movie name"
            return False
        # Checking valid movie overview
        if not overview or len(overview) == 0:
            print "tmdb search results no valid movie overview"
            return False

        ex_info = []
        print countries
        country = ", ".join(countries)
        print country
        country = country.replace("US", "USA").replace("DE", "GER")
        if released:
            country += " " + str(released.year)
            country = country.lstrip()
        print country
        ex_info.append(country)
        print ex_info

        if runtime:
            ex_info.append(str.format("{0} Min", runtime))

        if len(directors) > 0:
            ex_info.append("Von " + ", ".join(directors))
        elif len(writers) > 0:
            ex_info.append("Von " + ", ".join(writers))
        elif len(producers) > 0:
            ex_info.append("Von " + ", ".join(producers))

        if len(actors) > 0:
            ex_info.append("Mit " + ", ".join(actors))
        extended_info = ". ".join(ex_info)
        print "Overview:"
        print " " * 4, overview
        print "Extended info:"
        print " " * 4, extended_info

        language_code = "DEU"
        if movie.language == "ru":
            language_code = "rus"

        return writeEIT(file_name, eit_file, name, overview, genre,
                        extended_info, str(released), runtime, language_code)
    except:
        printStackTrace()
        return False
Exemplo n.º 4
0
            except Exception, e:
                print e

        if directors:
            ex_info.append("Von " + ", ".join(directors))
        if actors:
            ex_info.append("Mit " + ", ".join(actors))
        extended_info = ". ".join(ex_info)
        print "Extended info:"
        print " " * 4, extended_info

        language_code = getLanguageCode(tvdb)
        return writeEIT(file_name, eit_file, name, overview, genre,
                        extended_info, released, runtime, language_code)
    except:
        printStackTrace()
        return False


def writeEIT2TextInfoFile(eit, text_file):
    writeTextInfoFile(text_file, eit.getEventName(), eit.getDuration(),
                      eit.getExtendedDescription())


def writeEITFile2TextInfoFile(eit_file, text_file):
    eit = EventInformationTable(eit_file)
    writeEIT2TextInfoFile(eit, text_file)


# Debug only
def detectDVDStructure(loadPath):