def _prerender_download_ui_components(self): for video_index in range(len(self.store.videos)): self.store.video_headings[video_index] = screen.append_content("") self.store.ready_to_download_labels[video_index] = screen.append_content("") self.store.download_confirmation_prompts[ video_index ] = screen.append_content("") self.store.download_progress_uis[video_index] = screen.append_content("")
def _show_success_message(self): screen.append_content( colored("\nSuccess! ", fore=Colors.fore.GREEN) + "Files saved at " + colored( f"{self.store.output_path}/\n\n", fore=Colors.fore.CYAN, ) )
def _show_batch_file_info(self, valid_video_urls_in_batch_file): batch_filename = path.basename(global_config.batch_file) screen.append_content( self.formatter.format_batch_file_info_header(batch_filename), ContentCategories.INFO, ) screen.append_content( self.formatter.format_batch_file_info_body(valid_video_urls_in_batch_file), ContentCategories.INFO, )
def _show_loading_label(self, loading_label: str = "Loading video"): self.store.loading_label = screen.append_content( f"\n{loading_label}.\n\n", ContentCategories.INFO) def run_loading_animation(): current_total_dots_displayed = 0 while self.store.is_loading: current_total_dots_displayed = (current_total_dots_displayed + 1) % 4 screen.update_content( self.store.loading_label, f"\n{loading_label}" + "." * current_total_dots_displayed + "\n\n", ) sleep(0.4) Thread(target=run_loading_animation).start()
def _show_header(self, video_urls_to_download): screen.append_content(self.formatter.format_header()) if global_config.batch_file: self._show_batch_file_info(video_urls_to_download)
def show_arguments_not_recognized_error(): screen.append_content( "\nCould not recognize the provided arguments. " + "Please check your entries and try again.\n\n", ContentCategories.ERROR, )
def show_help_message(): command_args.parser.add_download_arguments() screen.append_content(command_args.parser.format_help())
def show_current_version(): screen.append_content(f"{version}\n")