18 Commits

Author SHA1 Message Date
Andy
1c48b282de Merge branch 'dev' of https://github.com/unshackle-dl/unshackle into dev 2025-10-22 01:37:34 +00:00
Andy
93debf149a Merge commit 'refs/pull/19/head' of https://github.com/unshackle-dl/unshackle into dev 2025-10-22 01:36:51 +00:00
Andy
57fc07ea41 Merge commit 'refs/pull/19/head' of https://github.com/unshackle-dl/unshackle into dev 2025-10-22 01:34:46 +00:00
TPD94
df09998a47 Update .gitignore 2025-10-21 21:19:55 -04:00
TPD94
e04399fbce Update binaries.py
Refactor code to search for binaries either in root of binary folder or in a subfolder named after the binary.
2025-10-21 21:18:36 -04:00
TPD94
087df59fb6 Update hls.py 2025-10-21 21:07:24 -04:00
TPD94
8f2ead2107 Merge branch 'unshackle-dl:main' into main 2025-10-18 21:06:23 -04:00
TPD94
b48eecacb5 Merge branch 'unshackle-dl:main' into main 2025-10-05 22:03:31 -04:00
TPD94
3a8dfb26fe Merge branch 'unshackle-dl:main' into main 2025-09-30 02:18:58 -04:00
TPD94
c9bb0e4224 Merge branch 'unshackle-dl:main' into main 2025-09-30 00:15:09 -04:00
TPD94
e1e2e35ff4 Update binaries.py to check subdirs in binaries folders named after the binary 2025-09-30 00:14:44 -04:00
TPD94
03f08159b4 Update dash.py 2025-09-29 21:01:55 -04:00
TPD94
724703d14b Update .gitignore 2025-09-29 20:56:25 -04:00
TPD94
da00258ae0 Merge branch 'unshackle-dl:main' into main 2025-09-29 20:55:05 -04:00
TPD94
4f3d0f1f7a Update .gitignore 2025-09-29 20:54:42 -04:00
TPD94
bade3f8c09 Update .gitignore 2025-09-29 20:53:38 -04:00
TPD94
55f116f1e8 Delete .idea directory 2025-09-29 20:53:16 -04:00
TPD94
2e2f8f5099 Fix remoteCDM, add curl_cffi to instance check 2025-09-29 20:48:59 -04:00
2 changed files with 17 additions and 14 deletions

View File

@@ -3,27 +3,30 @@ import sys
from pathlib import Path
from typing import Optional
from mypy.types import names
__shaka_platform = {"win32": "win", "darwin": "osx"}.get(sys.platform, sys.platform)
def find(*names: str) -> Optional[Path]:
"""Find the path of the first found binary name."""
# Get the directory containing this file to find the local binaries folder
current_dir = Path(__file__).parent.parent
current_dir = Path(__file__).resolve().parent.parent
local_binaries_dir = current_dir / "binaries"
for name in names:
# First check local binaries folder
if local_binaries_dir.exists():
local_path = local_binaries_dir / name
if local_path.is_file() and local_path.stat().st_mode & 0o111: # Check if executable
return local_path
ext = ".exe" if sys.platform == "win32" else ""
# Also check with .exe extension on Windows
if sys.platform == "win32":
local_path_exe = local_binaries_dir / f"{name}.exe"
if local_path_exe.is_file():
return local_path_exe
for name in names:
if local_binaries_dir.exists():
candidate_paths = [
local_binaries_dir / f"{name}{ext}",
local_binaries_dir / name / f"{name}{ext}"
]
for path in candidate_paths:
if path.is_file():
# On Unix-like systems, check if file is executable
if sys.platform == "win32" or (path.stat().st_mode & 0o111):
return path
# Fall back to system PATH
path = shutil.which(name)

View File

@@ -439,7 +439,7 @@ class HLS:
elif len(files) != range_len:
raise ValueError(f"Missing {range_len - len(files)} segment files for {segment_range}...")
if isinstance(drm, Widevine):
if isinstance(drm, (Widevine, PlayReady)):
# with widevine we can merge all segments and decrypt once
merge(to=merged_path, via=files, delete=True, include_map_data=True)
drm.decrypt(merged_path)