Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffy-melli committed Dec 25, 2024
1 parent cf11d25 commit 4eddd9b
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 156 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ requests == 2.32.3
pytubefix == 7.1rc2
pyvidplayer2 == 0.9.24
opencv-python == 4.5.5.64
pyinstaller == 6.6.0
pypresence == 4.3.0
numpy == 1.26.4
2 changes: 1 addition & 1 deletion sclat.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exe = EXE(
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
Expand Down
12 changes: 6 additions & 6 deletions sclat/download/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pytubefix import YouTube,Search
from pytubefix.cli import on_progress
####################################
from setting import setting as user_setting
from setting import setting
import gui.screen

def convert_size(bytes):
Expand Down Expand Up @@ -72,22 +72,22 @@ def video_info(url:str):
return YouTube(url).streaming_data

def install(url:str):
os.makedirs(user_setting.file_save_dir, exist_ok=True)
os.makedirs(setting.file_save_dir, exist_ok=True)
yt = YouTube(url, on_progress_callback = progress_function, on_complete_callback=after)
fns = f"{user_setting.file_save_dir}/{yt.length}/"
fns = f"{setting.file_save_dir}/{yt.length}/"
os.makedirs(fns, exist_ok=True)
if not os.path.exists(fns):
os.makedirs(fns)
fn = f"{fns}/{yt.title}.mp4"
yt = yt.streams.filter(progressive=True, file_extension='mp4').get_highest_resolution()
yt.download(filename=fn)
sr = install_srt(url, fns, yt.title, user_setting.SubTitle)
sr = install_srt(url, fns, yt.title, setting.SubTitle)
return fns, fn, sr

def install_nogui(url:str):
os.makedirs(user_setting.file_save_dir, exist_ok=True)
os.makedirs(setting.file_save_dir, exist_ok=True)
yt = YouTube(url, on_progress_callback=on_progress)
fn = f"{user_setting.file_save_dir}/{yt.title}"
fn = f"{setting.file_save_dir}/{yt.title}"
audio = yt.streams.filter(only_audio=True).first()
audio.download(filename=fn+".mp3")
return fn
Expand Down
284 changes: 145 additions & 139 deletions sclat/gui/gui.py

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions sclat/gui/nogui.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from moviepy.editor import AudioFileClip
import pygame,time,os,re
############################################
from download import download
from setting import setting as user_setting
import gui.cache
from download import download
import discord_rpc.client
import gui.cache
import pygame,time,os,re

def is_url(url: str) -> bool:
match = re.search(gui.cache.SEARCH_PATTERN, url)
Expand Down
4 changes: 2 additions & 2 deletions sclat/sclat.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys,time
from gui import gui, nogui, with_play, screen, cache
from pypresence.exceptions import DiscordNotFound
from setting import setting as user_setting
import discord_rpc.client
import locale
from setting import setting as user_setting
from pypresence.exceptions import DiscordNotFound

args = sys.argv[1:]

Expand Down
2 changes: 1 addition & 1 deletion sclat/sockets/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import socket, json, time
from gui import with_play
import socket, json, time

client = None
play = False
Expand Down
4 changes: 1 addition & 3 deletions sclat/sockets/server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from sockets import setting, user
import socket
import threading
import json
import threading, socket, json

playurl = ''
seek = 0
Expand Down
16 changes: 16 additions & 0 deletions scripts/-build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
cd ../
where python3 >nul 2>nul
IF %ERRORLEVEL% EQU 0 (
set NODE=python3
) ELSE (
set NODE=python
)
echo "init venv..."
%NODE% -m venv sclat-venv
call sclat-venv\Scripts\activate
echo "install modules..."
pip install -r requirements.txt
echo "pyinstaller start..."
pyinstaller ./sclat.spec
deactivate

0 comments on commit 4eddd9b

Please sign in to comment.