Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
v1.0.0 finally made it :)
  • Loading branch information
Thisal-D authored May 9, 2024
2 parents 5e9e143 + 1fcc404 commit 2185230
Show file tree
Hide file tree
Showing 23 changed files with 300 additions and 309 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PyTube Downloader is a user-friendly application that allows users to download Y
- **Automatic Download with Predefined Settings** Users can set predefined download settings such as preferred video quality, audio format, download location, and more. Once a YouTube URL is added, the video will load and then start to download automatically according to these predefined settings.
- **System Tray Icon Mode:** Users can easily minimize the application to the system tray for unobtrusive operation.
- **Theme Customization:** Personalize your experience with the ability to switch between dark and light themes. Additionally, customize the accent color to suit your preferences, creating a visually pleasing interface tailored to your style.
- **Scaling Preferences:** Users can scale the application interface from 100% to 200%, adjusting the size of widgets and elements for better readability and usability.
- **Scaling Preferences:** Users can scale the application interface from 100% to 200% (step 1%), adjusting the size of widgets and elements for better readability and usability.

---

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.0.6'
VERSION = '1.0.0'
39 changes: 23 additions & 16 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def __init__(self):
self.root_height = self.winfo_height()

# widgets size resetting check
self.widget_size_reset_needed = True
self.is_geometry_changes_tracker_running = False

# download method
Expand Down Expand Up @@ -69,12 +68,12 @@ def __init__(self):
self.downloading_frame_info_label_placed = False
self.downloaded_frame_info_label_placed = False

self.videos_status_count_label = None

self.context_menu = None
self.settings_panel = None
self.settings_btn = None

self.videos_status_count_label = None

self.logo_frame = None
self.logo_label = None

Expand Down Expand Up @@ -142,6 +141,11 @@ def create_widgets(self):
text="Downloaded videos & playlists will be display here.",
)

self.videos_status_count_label = ctk.CTkLabel(
text="Loading : 0 | Downloading : 0",
master=self
)

self.settings_panel = SettingPanel(
master=self,
theme_settings_change_callback=self.update_theme_settings,
Expand All @@ -163,11 +167,6 @@ def create_widgets(self):
options_commands=[self.select_all_url, self.cut_url, self.copy_url, self.paste_url]
)

self.videos_status_count_label = ctk.CTkLabel(
text="Loading : 0 | Downloading : 0",
master=self
)

self.logo_frame = ctk.CTkFrame(master=self)
self.logo_label = ctk.CTkLabel(master=self.logo_frame, text="⚡")

Expand Down Expand Up @@ -313,13 +312,14 @@ def configure_widgets_size(self):
root_height = self.winfo_height()
self.url_entry.configure(width=root_width - 250 * scale)

nav_button_width = (root_width - 26) / 3
button_margin = int(3 * scale)
nav_button_width = int((root_width - 20 - button_margin * 3) / 3)
self.navigate_added_frame_btn.configure(width=nav_button_width)
self.navigate_downloading_frame_btn.configure(width=nav_button_width)
self.navigate_downloaded_frame_btn.configure(width=nav_button_width)

self.navigate_downloading_frame_btn.place(x=nav_button_width + 10 + 3)
self.navigate_downloaded_frame_btn.place(x=nav_button_width * 2 + 10 + 6)
self.navigate_downloading_frame_btn.place(x=nav_button_width + 10 + button_margin)
self.navigate_downloaded_frame_btn.place(x=nav_button_width * 2 + 10 + button_margin * 2)

self.video_radio_btn.place(x=root_width - 190 * scale)
self.playlist_radio_btn.place(x=root_width - 190 * scale)
Expand Down Expand Up @@ -664,6 +664,7 @@ def geometry_changes_tracker(self):
# after user stop changing windows size check if window size changed or not
self.configure_widgets_size()
self.update()
self.update_idletasks()
self.hide_app_logo()
self.is_geometry_changes_tracker_running = False

Expand Down Expand Up @@ -702,8 +703,9 @@ def add_video_playlist(self):

else:
AddedPlayList(
root=self,
master=self.added_content_scroll_frame,
height=int(85 * AppearanceSettings.settings["scale_r"]),
height=int(86 * AppearanceSettings.settings["scale_r"]),
width=self.added_content_scroll_frame.winfo_width(),

playlist_download_button_click_callback=self.download_playlist,
Expand Down Expand Up @@ -737,8 +739,9 @@ def download_playlist(self, playlist: AddedPlayList):
self.is_content_downloading = True
self.downloading_frame_info_label.place_forget()
DownloadingPlayList(
root=self,
master=self.downloading_content_scroll_frame,
height=int(85 * AppearanceSettings.settings["scale_r"]),
height=int(86 * AppearanceSettings.settings["scale_r"]),
width=self.downloading_content_scroll_frame.winfo_width(),
# video info
channel_url=playlist.channel_url,
Expand Down Expand Up @@ -779,8 +782,9 @@ def downloaded_playlist(self, playlist: DownloadingPlayList):
self.is_content_downloaded = True
self.downloaded_frame_info_label.place_forget()
DownloadedPlayList(
root=self,
master=self.downloaded_content_scroll_frame,
height=85 * AppearanceSettings.settings["scale_r"],
height=86 * AppearanceSettings.settings["scale_r"],
width=self.downloaded_content_scroll_frame.winfo_width(),
# playlist url
channel_url=playlist.channel_url,
Expand Down Expand Up @@ -830,21 +834,24 @@ def close_settings(self):
self.settings_panel.place_forget()
self.settings_btn.configure(command=self.open_settings)

def on_app_closing(self):
def on_app_closing(self, restart: bool = False):
GeneralSettings.settings['window_geometry'] = self.geometry()
GeneralSettings.save_settings()
self.clear_temporally_saved_files()
self.destroy()
if not restart:
os._exit(0)

def cancel_app_closing(self):
self.bind_widgets_events()

def restart(self):
self.on_app_closing()
self.on_app_closing(restart=True)
if os.path.exists("main.py"):
os.startfile("main.py")
if os.path.exists("PyTube Downloader.exe"):
os.startfile("PyTube Downloader.exe")
os._exit(0)

def show_close_confirmation_dialog(self):
scale = AppearanceSettings.settings["scale_r"]
Expand Down
Binary file modified assets/ui images/default thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions data/appearance.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
]
}
},
"opacity": 97.75,
"opacity_r": 0.9775,
"opacity": 100.0,
"opacity_r": 1.0,
"radio_btn": {
"text_color": {
"hover": [
Expand Down
2 changes: 1 addition & 1 deletion data/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"status": "disable"
},
"download_directory": false,
"load_thumbnail": true,
"load_thumbnail": false,
"max_simultaneous_downloads": 1,
"max_simultaneous_loads": 1,
"update_delay": 0.5,
Expand Down
4 changes: 2 additions & 2 deletions data/info.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"contributors": {

},
"disclaimer": "This application is intended for personal use only. Please respect YouTube's terms of service and \n the rights of content creators when downloading videos.",
"name": "PyTube Downloader",
"site": "https://github.com/Thisal-D/PyTube-Downloader",
"version": "0.0.6"
"version": "1.0.0"
}
7 changes: 3 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
from widgets import AlertWindow
from settings import (
AppearanceSettings,
GeneralSettings,
WidgetPositionSettings
GeneralSettings
)
from services import (
DownloadManager,
LoadManager,
ThemeManager,
LoadingIndicateManager,
LoadingIndicateManager
)
from utils import FileUtility


# configure settings
GeneralSettings.initialize("data\\general.json")
AppearanceSettings.initialize("data\\appearance.json")
WidgetPositionSettings.initialize("data\\widget_positions.json")

# Initialize app.
app = App()
Expand Down Expand Up @@ -73,5 +71,6 @@
app.set_widgets_fonts()
# app event bind
app.bind_widgets_events()

# just rut the app
app.run()
1 change: 0 additions & 1 deletion settings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from .appearance_settings import AppearanceSettings
from .general_settings import GeneralSettings
from .widget_position_settings import WidgetPositionSettings
4 changes: 2 additions & 2 deletions widgets/components/appearance_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from services import ThemeManager
from utils import SettingsValidateUtility
from settings import (
AppearanceSettings,
AppearanceSettings
)


Expand Down Expand Up @@ -130,7 +130,7 @@ def __init__(
self.scale_change_slider = ctk.CTkSlider(
master=self,
command=self.change_scale,
number_of_steps=5,
number_of_steps=100,
from_=100,
to=200,
)
Expand Down
3 changes: 1 addition & 2 deletions widgets/components/contributor_profile_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import webbrowser
from services import ThemeManager
from settings import (
AppearanceSettings,
GeneralSettings
AppearanceSettings
)


Expand Down
3 changes: 1 addition & 2 deletions widgets/components/downloads_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
)
from settings import (
AppearanceSettings,
GeneralSettings,
WidgetPositionSettings
GeneralSettings
)
from utils import SettingsValidateUtility
from utils import FileUtility
Expand Down
6 changes: 2 additions & 4 deletions widgets/components/navigation_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
from typing import Any, List, Callable
from services import ThemeManager
from settings import (
AppearanceSettings,
WidgetPositionSettings,
GeneralSettings
AppearanceSettings
)


Expand Down Expand Up @@ -75,7 +73,7 @@ def set_widgets_fonts(self):
def set_widgets_sizes(self):
scale = AppearanceSettings.settings["scale_r"]
for navigation_button in self.navigation_buttons:
navigation_button.configure(height=int(34 * scale), width=self.width)
navigation_button.configure(height=int(36 * scale), width=self.width)

def update_widgets_accent_color(self) -> None:
self.set_widgets_accent_color()
Expand Down
2 changes: 1 addition & 1 deletion widgets/components/network_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
)
from settings import (
GeneralSettings,
AppearanceSettings,
AppearanceSettings
)
from utils import SettingsValidateUtility

Expand Down
1 change: 0 additions & 1 deletion widgets/core_widgets/alert_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def __init__(
self.height = height
self.callback = callback
self.geometry(f"{self.width}x{self.height}")
print(f"{self.width}x{self.height}")
self.configure(width=self.width),
self.configure(height=self.height)
self.resizable(False, False)
Expand Down
Loading

0 comments on commit 2185230

Please sign in to comment.