Optimization data export

This commit is contained in:
hyugogirubato 2024-07-22 20:31:01 +02:00
parent 74b37e1cf6
commit 5c5fae4c73
1 changed files with 7 additions and 6 deletions

View File

@ -113,6 +113,10 @@ def main() -> None:
logger.info('Watcher delay: %ss' % args.delay) logger.info('Watcher delay: %ss' % args.delay)
current = None current = None
while core.running: while core.running:
# Check if for current process data has been exported
if current and cdm.export(args.output, args.wvd):
raise KeyboardInterrupt
# https://github.com/hyugogirubato/KeyDive/issues/14#issuecomment-2146788792 # https://github.com/hyugogirubato/KeyDive/issues/14#issuecomment-2146788792
processes = { processes = {
key: (name, pid) key: (name, pid)
@ -124,12 +128,9 @@ def main() -> None:
raise EnvironmentError('Unable to detect Widevine, refer to https://github.com/hyugogirubato/KeyDive/blob/main/docs/PACKAGE.md#drm-info') raise EnvironmentError('Unable to detect Widevine, refer to https://github.com/hyugogirubato/KeyDive/blob/main/docs/PACKAGE.md#drm-info')
# Check if the current process has changed # Check if the current process has changed
if current: if current and current not in [v[1] for v in processes.values()]:
if current not in [v[1] for v in processes.values()]: logger.warning('Widevine process has changed')
logger.warning('Widevine process has changed') current = None
current = None
elif cdm.export(args.output, args.wvd):
raise KeyboardInterrupt
# If current process not found, attempt to hook into the detected processes # If current process not found, attempt to hook into the detected processes
if not current: if not current: