Skip to content

Commit

Permalink
add color, remove animation
Browse files Browse the repository at this point in the history
  • Loading branch information
SeakMengs committed Dec 10, 2022
1 parent 244893e commit 3707632
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions YTDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def __init__(self):
self.download_button = ctk.CTkButton(self.inside_home_mid_frame, text="Download", text_color=("gray10", "gray90"),
command=self.video_download_thread)
self.download_button.grid(row=4, column=2,padx=(0,20), pady=10, sticky="nsew")
self.progress_bar = ctk.CTkProgressBar(self.inside_home_mid_frame, orientation="horizontal", mode="indeterminate")
self.progress_bar.grid(row=5, column=0, columnspan=3, padx=20, pady= (10,20) , sticky="nsew")
self.progress_bar.start()
# self.progress_bar = ctk.CTkProgressBar(self.inside_home_mid_frame, orientation="horizontal", mode="indeterminate")
# self.progress_bar.grid(row=5, column=0, columnspan=3, padx=20, pady= (10,20) , sticky="nsew")
# self.progress_bar.start()

#* For now these frames are not part of the plan, they're part of the future plan :)
# create right-side frame inside home
Expand Down Expand Up @@ -375,6 +375,8 @@ def video_download_event(self):
self.status_label.configure(text="Status: downloading {}".format(self.yt_video.title))
self.download_button.configure(state="disabled")
self.quality_optionemenu.configure(state="disabled")
self.paste_url_entry.configure(border_color=("blue", "blue"))


# check if the download is a video or audio, if video download video and download highest audio and then combine it together to a mp4, if audio download audio
if self.list_of_download_options[self.selected_quality][1].split("/")[0] == "video":
Expand Down Expand Up @@ -405,9 +407,11 @@ def video_download_event(self):

self.yt_video.streams.filter(file_extension="mp4").order_by("filesize").desc()[self.selected_quality].download(self.save_to_path, self.video_file_name.replace(".mp4", file_extension_type))

self.status_label.configure(text="Status: {} has been downloaded".format(self.yt_video.title))
self.download_button.configure(state="normal")
self.quality_optionemenu.configure(state="normal")
self.status_label.configure(text="Status: {} has been downloaded".format(self.yt_video.title))
self.download_button.configure(state="normal")
self.quality_optionemenu.configure(state="normal")
self.paste_url_entry.configure(border_color=("#979DA2", "#565B5E"))


except Exception as err:
self.is_being_checked = False
Expand Down Expand Up @@ -499,7 +503,8 @@ def playlist_download(self):
self.playlist_folder_name = self.yt_playlist.title
self.download_button.configure(state="disabled")
self.quality_optionemenu.configure(state="disabled")

self.paste_url_entry.configure(border_color=("blue", "blue"))


# check save path + folder name is exit or not, if not create a new folder, if exist, create a new folder with number
if not os.path.exists(self.save_to_path + "\\" + self.playlist_folder_name):
Expand Down Expand Up @@ -564,6 +569,8 @@ def playlist_download(self):
self.quality_optionemenu.configure(state="normal")
self.download_button.configure(state="normal")
self.is_playlist_downloading = False
self.paste_url_entry.configure(border_color=("#979DA2", "#565B5E"))


except Exception as err:
self.is_being_checked = False
Expand Down

0 comments on commit 3707632

Please sign in to comment.