How to use the honcho.Honcho function in honcho

To help you get started, we’ve selected a few honcho examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Xonshiz / comic-dl / comic_dl / comic_dl.py View on Github external
else:
            if not args.sorting:
                args.sorting = ["ascending"]
            if not args.download_directory:
                args.download_directory = [os.getcwd()]
            if type(args.range) == list:
                args.range = args.range[0]
            if not args.convert:
                args.convert = ["None"]
            if not args.keep:
                args.keep = ["True"]
            if not args.quality:
                args.quality = ["Best"]

            start_time = time.time()
            honcho.Honcho().checker(comic_url=str(args.input[0]).strip(), current_directory=os.getcwd(),
                                    sorting_order=args.sorting[0], logger=logger,
                                    download_directory=args.download_directory[0],
                                    chapter_range=args.range, conversion=args.convert[0],
                                    delete_files=args.keep[0], image_quality=args.quality[0],
                                    username=args.username[0], password=args.password[0],
                                    comic_language=args.manga_language[0])
            end_time = time.time()
            total_time = end_time - start_time
            print("Total Time Taken To Complete : %s" % total_time)
            sys.exit()
github Xonshiz / comic-dl / comic_dl / comic_dl.py View on Github external
download_directory = data["download_directory"]
            conversion = data["conversion"]
            keep_files = data["keep"]
            image_quality = data["image_quality"]
            pbar_comic = tqdm(data["comics"], dynamic_ncols=True, desc="[Comic-dl] Auto processing", leave=True,
                              unit='comic')
            for elKey in pbar_comic:
                try:
                    pbar_comic.set_postfix(comic_name=elKey)
                    el = data["comics"][elKey]
                    # next chapter to download, if it's greater than available don't download anything
                    download_range = str(el["next"]) + "-__EnD__"
                    if "last" in el and not el["last"] == "None":
                        download_range = str(el["next"]) + "-" + str(el["last"]) + "-RANGE"

                    honcho.Honcho().checker(comic_url=el["url"].strip(), current_directory=os.getcwd(),
                                            sorting_order=sorting_order, logger=logger,
                                            download_directory=download_directory,
                                            chapter_range=download_range, conversion=conversion,
                                            keep_files=keep_files, image_quality=image_quality,
                                            username=el["username"], password=el["password"],
                                            comic_language=el["comic_language"])
                except Exception as ex:
                    pbar_comic.write('[Comic-dl] Auto processing with error for %s : %s ' % (elKey, ex))
            pbar_comic.set_postfix()
            pbar_comic.close()
            sys.exit()

        # config generator
        if args.config:
            # @dsanchezseco
            configGenerator.configGenerator()
github Xonshiz / comic-dl / comic_dl / comic_dl.py View on Github external
# user_input = unicode(args.input[0], encoding='latin-1')
            user_input = args.input[0]

            if args.comic:
                rco = RCO.ReadComicOnline()
                user_input = rco.comicLink(user_input)

                if not user_input:
                    print("No comic found with that name or id.")
                    print("If you are inputting an ID, use -comic-search  to determine the id.")
                    print("If you are inputting a name, you must input the exact name of the comic for ")
                    sys.exit()

            start_time = time.time()
            honcho.Honcho().checker(comic_url=user_input, current_directory=os.getcwd(),
                                    sorting_order=args.sorting[0], logger=logger,
                                    download_directory=args.download_directory[0],
                                    chapter_range=args.range, conversion=args.convert[0],
                                    keep_files=args.keep[0], image_quality=args.quality[0],
                                    username=args.username[0], password=args.password[0],
                                    comic_language=args.manga_language[0], print_index=print_index)
            end_time = time.time()
            total_time = end_time - start_time
            print("Total Time Taken To Complete : %s" % total_time)
            sys.exit()