forked from kenzuya/unshackle
feat(remote): cap server CDM licensing by height per API key and service
A session above the cap licenses with the client's own device, and a track above it in an uncapped -q run is handed back to the client. Also names the fallback in the ccextractor crash warning.
This commit is contained in:
@@ -541,7 +541,7 @@ class Video(Track):
|
||||
|
||||
out_path = Path(out_path)
|
||||
|
||||
def run_ccextractor() -> bool:
|
||||
def run_ccextractor(fallback: str) -> bool:
|
||||
cc_start = time.monotonic()
|
||||
try:
|
||||
subprocess.run(
|
||||
@@ -560,7 +560,7 @@ class Video(Track):
|
||||
)
|
||||
if e.returncode < 0:
|
||||
logging.getLogger("Video").warning(
|
||||
f"ccextractor crashed (signal {-e.returncode}) on {self.path.name}; skipping CC extraction"
|
||||
f"ccextractor crashed (signal {-e.returncode}) on {self.path.name}; {fallback}"
|
||||
)
|
||||
return out_path.exists()
|
||||
if e.returncode != 10: # 10 = No captions found
|
||||
@@ -576,9 +576,9 @@ class Video(Track):
|
||||
|
||||
# Try on the original file first (preserves container-level CC data like c608 boxes),
|
||||
# then fall back to repacked file (ccextractor can fail on some container formats).
|
||||
if not run_ccextractor():
|
||||
if not run_ccextractor("retrying on a repackaged copy"):
|
||||
self.repackage()
|
||||
run_ccextractor()
|
||||
run_ccextractor("skipping CC extraction")
|
||||
|
||||
if out_path.exists():
|
||||
cc_track = Subtitle(
|
||||
|
||||
Reference in New Issue
Block a user