diff options
author | nathansmithsmith <nathansmith7@mailfence.com> | 2023-11-09 15:11:09 +0000 |
---|---|---|
committer | nathansmithsmith <nathansmith7@mailfence.com> | 2023-11-09 15:11:09 +0000 |
commit | 9f241ede922974ced92d79da5d3996d921becd3c (patch) | |
tree | 553bcca72cd3181a9f528ef1d3effa9cd5fb8c53 | |
parent | 9ce37c420eab96910379fddb280a4d5b25cd0e67 (diff) | |
download | youload-9f241ede922974ced92d79da5d3996d921becd3c.tar.gz youload-9f241ede922974ced92d79da5d3996d921becd3c.tar.bz2 youload-9f241ede922974ced92d79da5d3996d921becd3c.zip |
Better download status
-rw-r--r-- | src/youload_app.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/youload_app.py b/src/youload_app.py index 53e4bce..e284116 100644 --- a/src/youload_app.py +++ b/src/youload_app.py @@ -7,6 +7,7 @@ from kivy.uix.floatlayout import FloatLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from kivy.uix.label import Label +from kivy.uix.filechooser import FileChooser import threading @@ -18,8 +19,6 @@ class YouloadApp(App): def build(self): layout = BoxLayout(orientation='vertical') - pytube.helpers.setup_logger(0, None) - # Data members self.url = "https://youtube.com/playlist?list=PLuZUmvZz4WI78uqT5S71yBHNBMJ97HzhY&si=SI2qN9MgxmmK2rbf" self.is_downloading = False @@ -60,6 +59,11 @@ class YouloadApp(App): # Download the videos in a different thread so the ui still works. def download_playlist_thread(self): + self.download_status.text = "Fetching playlist" + self.submit.text = "Stop" + self.is_downloading = True + + # Get playlist. try: playlist = YouLoadPlayList(self.url) except KeyError: @@ -67,20 +71,17 @@ class YouloadApp(App): return playlist.prepare_for_download() - self.downloads_display.text = f"Downloading {self.url}\n" - self.is_downloading = True - self.submit.text = "Stop" # Download each video for i in range(playlist.video_count): - self.download_status.text = f"Downloading {i+1}/{playlist.video_count}" - self.downloads_display.text += playlist.download_video(i) + "\n" - # Stop this mother fucker if self.should_stop_download: break + self.download_status.text = f"Downloading {i+1}/{playlist.video_count}" + self.downloads_display.text += playlist.download_video(i) + "\n" + self.submit.text = "Download" self.download_status.text = "Download complete" self.is_downloading = False |