aboutsummaryrefslogtreecommitdiffstats
path: root/src/youload_app.py
diff options
context:
space:
mode:
authornathansmithsmith <nathansmith7@mailfence.com>2023-11-09 14:50:05 +0000
committernathansmithsmith <nathansmith7@mailfence.com>2023-11-09 14:50:05 +0000
commit9ce37c420eab96910379fddb280a4d5b25cd0e67 (patch)
tree7281a4b03a220abfe86e6cea7019d6ba3e6af230 /src/youload_app.py
parentd204b513c10e2c0dba13fc050cde8c7e4da03990 (diff)
downloadyouload-9ce37c420eab96910379fddb280a4d5b25cd0e67.tar.gz
youload-9ce37c420eab96910379fddb280a4d5b25cd0e67.tar.bz2
youload-9ce37c420eab96910379fddb280a4d5b25cd0e67.zip
Added cli interface
Diffstat (limited to 'src/youload_app.py')
-rw-r--r--src/youload_app.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/youload_app.py b/src/youload_app.py
index 037ac30..53e4bce 100644
--- a/src/youload_app.py
+++ b/src/youload_app.py
@@ -10,16 +10,20 @@ from kivy.uix.label import Label
import threading
+import pytube
+
from youload_playlist import YouLoadPlayList
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
- self.stop_download = False
+ self.should_stop_download = False
# Url input.
url_input = TextInput(text=self.url, multiline=False, size_hint=(0.75, 1.0))
@@ -74,7 +78,7 @@ class YouloadApp(App):
self.downloads_display.text += playlist.download_video(i) + "\n"
# Stop this mother fucker
- if self.stop_download:
+ if self.should_stop_download:
break
self.submit.text = "Download"
@@ -82,7 +86,7 @@ class YouloadApp(App):
self.is_downloading = False
def stop_download(self):
- self.stop_download = True
+ self.should_stop_download = True
def submit_cb(self, instance):
# Is already downloading something.
@@ -93,7 +97,7 @@ class YouloadApp(App):
# Start download thread.
download_thread = threading.Thread(target=self.download_playlist_thread)
- self.stop_download = False
+ self.should_stop_download = False
download_thread.start()
def on_stop(self):