Ejemplo n.º 1
0
def download_subtitles(releases, engines=[DEFAULTS['subtitle_engine']], lang=DEFAULTS['subtitle_language']):
    if releases:
        for release in releases:
            for engine in engines:
                subtitle_release = SubtitleSite.get_file_properties(release)['release_name']
                print "[{engine: ^15}] Trying To Download Subtitles For: '{release}'".format(engine=engine,
                                                                                             release=subtitle_release)
                sub_obj = SubtitleSite.class_factory(engine)
                subtitle_path = sub_obj.download_subtitle(release, lang)
                if subtitle_path:
                    print "{0:17} Download Success: ({file_path}).\n".format("", file_path=subtitle_path)
                else:
                    print "{0:17} Subtitles Not Found.\n".format("")
Ejemplo n.º 2
0
def is_subtitles_exist(releases, engines=[DEFAULTS['subtitle_engine']], lang=DEFAULTS['subtitle_language']):
    if releases:
        for release in releases:
            for engine in engines:
                subtitle_release = SubtitleSite.get_file_properties(release)['release_name']

                sub_obj = SubtitleSite.class_factory(engine)
                exist_flag = sub_obj.is_subtitle_exist(release, lang)
                res = "Exist"
                if not exist_flag:
                    res = "Does Not " + res
                print "[{engine: ^15}] '{release}' - {res}.".format(engine=engine,
                                                                    release=subtitle_release,
                                                                    res=res)
Ejemplo n.º 3
0
def test_engines(engines):
    if not engines:
        engines = SUBTITLE_SITE_LIST.keys()

    for engine_key in engines:
        t = SubtitleSite.class_factory(engine_key)
        t.test_engine()
Ejemplo n.º 4
0
def test_engines(engines):
    if not engines:
        engines = SUBTITLE_SITE_LIST.keys()

    for engine_key in engines:
        t = SubtitleSite.class_factory(engine_key)
        t.test_engine()
Ejemplo n.º 5
0
def is_subtitles_exist(releases,
                       engines=[DEFAULTS['subtitle_engine']],
                       lang=DEFAULTS['subtitle_language']):
    if releases:
        for release in releases:
            for engine in engines:
                subtitle_release = SubtitleSite.get_file_properties(
                    release)['release_name']

                sub_obj = SubtitleSite.class_factory(engine)
                exist_flag = sub_obj.is_subtitle_exist(release, lang)
                res = "Exist"
                if not exist_flag:
                    res = "Does Not " + res
                print "[{engine: ^15}] '{release}' - {res}.".format(
                    engine=engine, release=subtitle_release, res=res)
Ejemplo n.º 6
0
def download_subtitles(releases,
                       engines=[DEFAULTS['subtitle_engine']],
                       lang=DEFAULTS['subtitle_language']):
    if releases:
        for release in releases:
            for engine in engines:
                subtitle_release = SubtitleSite.get_file_properties(
                    release)['release_name']
                print "[{engine: ^15}] Trying To Download Subtitles For: '{release}'".format(
                    engine=engine, release=subtitle_release)
                sub_obj = SubtitleSite.class_factory(engine)
                subtitle_path = sub_obj.download_subtitle(release, lang)
                if subtitle_path:
                    print "{0:17} Download Success: ({file_path}).\n".format(
                        "", file_path=subtitle_path)
                else:
                    print "{0:17} Subtitles Not Found.\n".format("")