Skip to content

Commit d77d11a

Browse files
committed
Remove "paths_json"
1 parent cff315d commit d77d11a

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

StreamingCommunity/Util/installer/bento4_install.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ def check_mp4decrypt() -> Optional[str]:
4141
return mp4decrypt_local
4242

4343
# STEP 3: Download from GitHub repository
44-
console.print("mp4decrypt not found. Downloading from GitHub repository...", style="cyan")
44+
console.print("[red]mp4decrypt not found. Downloading ...")
4545
mp4decrypt_downloaded = binary_paths.download_binary("bento4", mp4decrypt_name)
4646

4747
if mp4decrypt_downloaded:
48-
console.print(f"Downloaded mp4decrypt to: {mp4decrypt_downloaded}", style="green")
4948
return mp4decrypt_downloaded
5049

5150
console.print("Failed to download mp4decrypt", style="red")

StreamingCommunity/Util/installer/binary_paths.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,17 @@ def get_binary_path(self, tool: str, binary_name: str) -> Optional[str]:
7878
Returns:
7979
Full local path to the binary or None if not found
8080
"""
81-
paths_json = self._load_paths_json()
82-
key = f"{self.system}_{self.arch}_{tool}"
83-
84-
if key not in paths_json:
85-
return None
86-
8781
binary_dir = self.get_binary_directory()
82+
local_path = os.path.join(binary_dir, binary_name)
8883

89-
for rel_path in paths_json[key]:
90-
if rel_path.endswith(binary_name):
91-
return os.path.join(binary_dir, rel_path)
84+
if os.path.isfile(local_path):
85+
return local_path
9286

9387
return None
9488

9589
def download_binary(self, tool: str, binary_name: str) -> Optional[str]:
9690
"""
97-
Download a specific binary from GitHub repository.
91+
Download a specific binary from GitHub repository directly to binary directory.
9892
9993
Args:
10094
tool: Tool name (ffmpeg, bento4, megatools)
@@ -112,10 +106,7 @@ def download_binary(self, tool: str, binary_name: str) -> Optional[str]:
112106
for rel_path in paths_json[key]:
113107
if rel_path.endswith(binary_name):
114108
url = f"{self.github_repo}/binaries/{rel_path}"
115-
local_path = os.path.join(self.get_binary_directory(), rel_path)
116-
117-
# Create directory if needed
118-
os.makedirs(os.path.dirname(local_path), exist_ok=True)
109+
local_path = os.path.join(self.get_binary_directory(), binary_name)
119110

120111
try:
121112
response = requests.get(url, stream=True, timeout=60)

StreamingCommunity/Util/installer/ffmpeg_install.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ def check_ffmpeg() -> Tuple[Optional[str], Optional[str]]:
4444
return ffmpeg_local, ffprobe_local
4545

4646
# STEP 3: Download from GitHub repository
47-
console.print("FFmpeg not found. Downloading from GitHub repository...", style="cyan")
47+
console.print("[red]FFmpeg not found. Downloading ...")
4848
ffmpeg_downloaded = binary_paths.download_binary("ffmpeg", ffmpeg_name)
4949
ffprobe_downloaded = binary_paths.download_binary("ffmpeg", ffprobe_name)
5050

5151
if ffmpeg_downloaded and ffprobe_downloaded:
52-
console.print(f"Downloaded FFmpeg to: {ffmpeg_downloaded}", style="green")
5352
return ffmpeg_downloaded, ffprobe_downloaded
5453

5554
console.print("Failed to download FFmpeg", style="red")

StreamingCommunity/Util/installer/megatool_installer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ def check_megatools() -> Optional[str]:
4141
return megatools_local
4242

4343
# STEP 3: Download from GitHub repository
44-
console.print("megatools not found. Downloading from GitHub repository...", style="cyan")
44+
console.print("[red]megatools not found. Downloading ...")
4545
megatools_downloaded = binary_paths.download_binary("megatools", megatools_name)
4646

4747
if megatools_downloaded:
48-
console.print(f"Downloaded megatools to: {megatools_downloaded}", style="green")
4948
return megatools_downloaded
5049

5150
console.print("Failed to download megatools", style="red")

0 commit comments

Comments
 (0)