コード例 #1
0
 def _create_download_progress(
     self, video_index: int, media_resource: MediaResource
 ):
     self.store.downloading_media_resources[video_index] = media_resource
     screen.update_content(
         self.store.download_progress_uis[video_index],
         self.formatter.format_current_download_progress(video_index),
     )
コード例 #2
0
        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)
コード例 #3
0
    def _show_download_summary(self, video_index: int):
        screen.update_content(
            self.store.video_headings[video_index],
            self.formatter.format_download_summary(video_index),
        )

        if self._were_all_formats_skipped(video_index):
            raise exceptions.NoAvailableSpecifiedFormats(
                self.store.available_formats[video_index]
            )

        if len(self.store.videos) == 1:
            screen.update_content(
                self.store.ready_to_download_labels[video_index],
                self.formatter.format_ready_to_download_label(video_index),
            )
コード例 #4
0
    def _clear_detailed_download_info_from_screen(self, video_index: int):
        video_heading = self.store.video_headings[video_index]
        ready_to_download_label = self.store.ready_to_download_labels[video_index]
        confirmation_prompt = self.store.download_confirmation_prompts[video_index]

        screen.update_content(video_heading, "")
        screen.update_content(ready_to_download_label, "")

        if not confirmation_prompt.is_empty():
            screen.erase_prompt_entry(confirmation_prompt)
            screen.update_content(confirmation_prompt, "")
コード例 #5
0
 def _update_download_progress_ui(self, video_index: int):
     screen.update_content(
         self.store.download_progress_uis[video_index],
         self.formatter.format_current_download_progress(video_index),
     )