diff --git a/exe-release/asset/NanumBarunpenB.ttf b/exe-release/asset/NanumBarunpenB.ttf new file mode 100644 index 0000000..2498aed Binary files /dev/null and b/exe-release/asset/NanumBarunpenB.ttf differ diff --git a/exe-release/asset/sclatIcon.ico b/exe-release/asset/sclatIcon.ico new file mode 100644 index 0000000..dd18b0b Binary files /dev/null and b/exe-release/asset/sclatIcon.ico differ diff --git a/exe-release/asset/sclatIcon.png b/exe-release/asset/sclatIcon.png new file mode 100644 index 0000000..712e1c2 Binary files /dev/null and b/exe-release/asset/sclatIcon.png differ diff --git a/exe-release/asset/sclatLogo.png b/exe-release/asset/sclatLogo.png new file mode 100644 index 0000000..7c598c3 Binary files /dev/null and b/exe-release/asset/sclatLogo.png differ diff --git a/exe-release/sclat.exe b/exe-release/sclat.exe new file mode 100644 index 0000000..36dbbc3 Binary files /dev/null and b/exe-release/sclat.exe differ diff --git a/exe-release/setting/server.json b/exe-release/setting/server.json new file mode 100644 index 0000000..519eeb7 --- /dev/null +++ b/exe-release/setting/server.json @@ -0,0 +1,4 @@ +{ + "max-client": 5, + "last-server": "" +} \ No newline at end of file diff --git a/exe-release/setting/setting.json b/exe-release/setting/setting.json new file mode 100644 index 0000000..6e209bd --- /dev/null +++ b/exe-release/setting/setting.json @@ -0,0 +1,6 @@ +{ + "discord_RPC": true, + "volume": 40, + "file-save-dir": "./asset/storage", + "Subtitle-Lang": "ko" +} \ No newline at end of file diff --git a/exe-release/update.exe b/exe-release/update.exe new file mode 100644 index 0000000..5137ab4 Binary files /dev/null and b/exe-release/update.exe differ diff --git a/sclat.spec b/sclat.spec index b539dea..1827c56 100644 --- a/sclat.spec +++ b/sclat.spec @@ -4,10 +4,6 @@ a = Analysis( ['sclat\\sclat.py'], pathex=[], binaries=[], - datas=[ - ('asset/*', 'asset'), - ('setting/*', 'setting') - ], hiddenimports=[], hookspath=[], hooksconfig={}, @@ -32,7 +28,7 @@ exe = EXE( upx=True, upx_exclude=[], runtime_tmpdir=None, - console=False, + console=True, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, diff --git a/sclat/gui/gui.py b/sclat/gui/gui.py index e825ab8..7dff550 100644 --- a/sclat/gui/gui.py +++ b/sclat/gui/gui.py @@ -1,6 +1,6 @@ import chardet, cv2, time, sys, re, os -sys.stdout = open(os.devnull, 'w') +#sys.stdout = open(os.devnull, 'w') os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1' from pyvidplayer2 import Video from dataclasses import dataclass diff --git a/scripts/-build.bat b/scripts/-build.bat index b9601f9..f38aa6b 100644 --- a/scripts/-build.bat +++ b/scripts/-build.bat @@ -13,4 +13,5 @@ echo "install modules..." pip install -r requirements.txt echo "pyinstaller start..." pyinstaller ./sclat.spec +pyinstaller ./update.spec deactivate \ No newline at end of file diff --git a/update.spec b/update.spec new file mode 100644 index 0000000..8b12188 --- /dev/null +++ b/update.spec @@ -0,0 +1,39 @@ +# -*- mode: python ; coding: utf-8 -*- + +a = Analysis( + ['update\\update.py'], + pathex=[], + binaries=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) + +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='update', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon='./asset/sclatIcon.ico', + onefile=True +) diff --git a/update/download/github.py b/update/download/github.py new file mode 100644 index 0000000..c9673ca --- /dev/null +++ b/update/download/github.py @@ -0,0 +1,43 @@ +import os +import zipfile +import requests + +def download(): + try: + response = requests.get('https://github.com/fluffy-melli/sclat/archive/refs/heads/main.zip') + response.raise_for_status() + except requests.exceptions.RequestException as e: + print(f"HTTP GET Fail: {e}") + return + try: + with open('-install.zip', 'wb') as out_file: + out_file.write(response.content) + except IOError as e: + print(f"File Creation Fail: {e}") + return + if not unzip('-install.zip'): + return + +def unzip(filename): + dest_dir = os.path.join(".install") + try: + with zipfile.ZipFile(filename, 'r') as zip_ref: + zip_ref.extractall(dest_dir) + except zipfile.BadZipFile as e: + print(f"Can't open zip file: {e}") + return False + except Exception as e: + print(f"Error extracting zip file: {e}") + return False + return True + +def extract_file(zip_ref, file_info, dest_path): + try: + with zip_ref.open(file_info) as source_file: + with open(dest_path, 'wb') as dest_file: + dest_file.write(source_file.read()) + os.chmod(dest_path, file_info.external_attr >> 16) + except Exception as e: + print(f"Can't extract file: {e}") + return False + return True \ No newline at end of file diff --git a/update/update.py b/update/update.py new file mode 100644 index 0000000..3b51dd1 --- /dev/null +++ b/update/update.py @@ -0,0 +1,3 @@ +from download import github + +github.download() \ No newline at end of file