def all(): options, parser = banners.optparser() text = options.text if text == None: banners.case3() fonts = pyfiglet.FigletFont.getFonts() times = 1 for i in fonts: print(get_colors.white() + f"[{times}] " + get_colors.randomize1() + " Font Name: " + get_colors.randomize2() + f"{i}") times += 1 print(get_colors.white() + "[" + get_colors.yellow() + "T" + get_colors.white() + "]" + get_colors.randomize() + " Your Text: " + get_colors.randomize1() + f"{text}\n" + get_colors.pink() + "[" + get_colors.sharp_megento() + "+" + get_colors.pink() + "]" + get_colors.randomize2() + " Output: \n" + get_colors.randomize3()) pyfiglet.print_figlet(text, i) print(get_colors.randomize() + "#" * 70 + get_colors.white())
def case1(): options, parser = banners.optparser() text = options.text font = options.font fonts = pyfiglet.FigletFont.getFonts() if font in fonts: print(get_colors.white() + "[" + get_colors.yellow() + "+" + get_colors.white() + "]" + get_colors.randomize1() + " Font Name: " + get_colors.randomize2() + f"{font}") print(get_colors.white() + "[" + get_colors.yellow() + "T" + get_colors.white() + "]" + get_colors.randomize() + " Your Text: " + get_colors.randomize1() + f"{text}\n" + get_colors.pink() + "[" + get_colors.sharp_megento() + "+" + get_colors.pink() + "]" + get_colors.randomize2() + " Output: \n" + get_colors.randomize3()) pyfiglet.print_figlet(text, font) else: print(get_colors.red() + "[" + get_colors.magento() + "!" + get_colors.red() + "]" + get_colors.randomize() + " Error: Unknown " + get_colors.randomize1() + f"[{font}]" + get_colors.randomize() + " Font Name" + get_colors.white()) exit(1)
def show(): text = "Sample" fonts = pyfiglet.FigletFont.getFonts() times = 1 for i in fonts: print(get_colors.white() + f"[{times}] " + get_colors.randomize1() + "Font Name: " + get_colors.randomize2() + f"{i}") times += 1 print(get_colors.cyan() + "[" + get_colors.green() + "+" + get_colors.cyan() + "]" + get_colors.pink() + " Example: \n" + get_colors.randomize3()) pyfiglet.print_figlet(text, i) print(get_colors.magento() + "#" * 70 + get_colors.white())
def case3(): print(get_colors.randomize() + "[" + get_colors.red() + "!" + get_colors.randomize() + "]" + get_colors.randomize1() + " Error: Missing Text" + get_colors.white()) exit(1)
def case2(): print(get_colors.randomize() + "[" + get_colors.red() + "!" + get_colors.randomize() + "]" + get_colors.randomize1() + " Error: Missing Font Name" + get_colors.white()) exit(1)
def run(): download.clear() download.banner() while True: try: if download.check_url('https://pornhub.com'): link = input(get_colors.randomize2() + "[" + get_colors.randomize3() + "*" + get_colors.randomize1() + "]" + get_colors.randomize2() + " Enter the link: " + get_colors.randomize() + get_colors.white()) if not valid.url(link): print("\n" + get_colors.randomize() + "[" + get_colors.randomize2() + "!" + get_colors.randomize1() + "]" + get_colors.randomize3() + " Unvalid Url!!!" + get_colors.randomize2()) print(get_colors.randomize() + "[" + get_colors.randomize1() + "!" + get_colors.randomize2() + "]" + get_colors.randomize2() + " Please Try Again" + get_colors.randomize3()) sys.exit(1) if download.check_connection(link): title, duration = download.get_info(link) if duration is not None: duration = m, s = divmod(duration, 60) duration = h, m = divmod(duration[0], 60) duration = (f'{h:d}:{m:02d}:{s:02d}') else: duration = None download.clear() download.banner() print(get_colors.randomize() + "Title Video: " + get_colors.randomize1() + f"{title} " + get_colors.randomize() + "Duration: " + get_colors.green() + f"{duration}") print(get_colors.randomize2() + "[*] 1.Download an Audio playlist") print(get_colors.randomize3() + "[*] 2.Download a Video playlist") print(get_colors.randomize() + "[*] 3.Download a Single Audio") print(get_colors.randomize1() + "[*] 4.Download a single video file") check_inp = int( input(get_colors.randomize2() + "[" + get_colors.randomize2() + "------------Enter your choice------------" + get_colors.randomize2() + "]: ")) config = download.get_config() if check_inp in [1, 2, 3, 4]: if check_inp == 1: config['Audio']['noplaylist'] = False download.download(link, config['Audio']) elif check_inp == 2: config = download.get_config() config['Video']['noplaylist'] = False download.download(link, config['Video']) elif check_inp == 4: download.download(link, config['Video']) elif check_inp == 3: download.download(link, config['Audio']) else: print(get_colors.randomize() + "Unknown Choice :(") elif check_inp not in [1, 2, 3, 4]: print(get_colors.randomize() + "Unknown Choice :(") else: print(get_colors.randomize() + "Unknown Choice :(") check_str = str( input(get_colors.randomize1() + "[*] Do You Want To Continue? (Y/n): ")) if check_str in ['Y', 'y']: # banner() download.clear() download.banner() continue elif check_str in ['N', 'n']: print("[+] Cya Next Time") exit(1) else: print("Unknown Option") continue except dl.utils.DownloadError: download.clear() print(get_colors.randomize2() + "DownloadError Occurred !!!") print( get_colors.randomize1() + "Re Run The Script With The Same URL And The Same Options To Continue Downloading!" ) exit(1)