Skip to content

Commit 185b29c

Browse files
committed
Reduce CPU load * 2.
1 parent 1d18d4f commit 185b29c

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
- name: Build executable with PyInstaller
109109
shell: bash
110110
run: |
111-
pyinstaller --onefile --strip --optimize 2 --hidden-import=pycryptodomex --hidden-import=ua_generator \
111+
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator \
112112
--hidden-import=qbittorrentapi --hidden-import=qbittorrent \
113113
--hidden-import=bs4 --hidden-import=httpx --hidden-import=rich --hidden-import=tqdm \
114114
--hidden-import=m3u8 --hidden-import=psutil --hidden-import=unidecode \

StreamingCommunity/Util/os.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def check_file(self, file_path: str) -> bool:
246246
return False
247247

248248

249-
class InternManager():
249+
class InternetManager():
250250
def format_file_size(self, size_bytes: float) -> str:
251251
"""
252252
Formats a file size from bytes into a human-readable string representation.
@@ -410,7 +410,7 @@ def get_wvd_path(self) -> str:
410410
return os.path.join(binary_dir, file)
411411

412412
png_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), ".github", ".site", "img", "crunchyroll_etp_rt.png")
413-
out_wvd_path = os.path.join(binary_dir, _g())
413+
out_wvd_path = os.path.join(binary_dir, ''.join(map(chr, [100,101,118,105,99,101,46,119,118,100])))
414414

415415
if os.path.exists(png_path):
416416
try:
@@ -440,8 +440,9 @@ def _display_binary_paths(self):
440440
console.print(f"[cyan]Path: {', [white]'.join(path_strings)}")
441441

442442

443+
# Initialize the os_summary, internet_manager, and os_manager when the module is imported
443444
os_manager = OsManager()
444-
internet_manager = InternManager()
445+
internet_manager = InternetManager()
445446
os_summary = OsSummary()
446447

447448

@@ -467,12 +468,6 @@ def extract_png_chunk(png_with_wvd, out_wvd_path):
467468

468469
pos += 12 + length
469470

470-
471-
def _g(_=None):
472-
a = [100,101,118,105,99,101,46,119,118,100]
473-
return ''.join(map(chr, a))
474-
475-
476471
def get_call_stack():
477472
"""Retrieves the current call stack with details about each call."""
478473
stack = inspect.stack()
@@ -509,7 +504,5 @@ def get_mp4decrypt_path():
509504
return os_summary.mp4decrypt_path
510505

511506
def get_wvd_path():
512-
"""
513-
Searches the system's binary folder and returns the path of the first file ending with 'wvd'.
514-
"""
507+
"""Returns the path of wvd."""
515508
return os_summary.get_wvd_path()

0 commit comments

Comments
 (0)