예제 #1
0
 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("")
예제 #2
0
 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,
         )
     )
예제 #3
0
    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,
        )
예제 #4
0
    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()
예제 #5
0
    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)
예제 #6
0
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,
    )
예제 #7
0
def show_help_message():
    command_args.parser.add_download_arguments()
    screen.append_content(command_args.parser.format_help())
예제 #8
0
def show_current_version():
    screen.append_content(f"{version}\n")