mirror of
https://github.com/Dasemu/Transcriptarr.git
synced 2026-11-27 23:46:08 +00:00
More audio codec checks
This commit is contained in:
1 parent
9120d09437
commit
6245b0b912
1 file changed
+3
-3
@@ -818,11 +818,11 @@ def has_audio(file_path):
|
|||||||
# Check for an audio stream and ensure it has a valid codec
|
# Check for an audio stream and ensure it has a valid codec
|
||||||
for stream in container.streams:
|
for stream in container.streams:
|
||||||
if stream.type == 'audio':
|
if stream.type == 'audio':
|
||||||
# Check if the codec is supported (not 'none')
|
# Check if the stream has a codec and if it is valid
|
||||||
if stream.codec.name != 'none':
|
if stream.codec and stream.codec.name != 'none':
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
logging.debug(f"Unsupported codec for audio stream in {file_path}")
|
logging.debug(f"Unsupported or missing codec for audio stream in {file_path}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
except (av.AVError, UnicodeDecodeError):
|
except (av.AVError, UnicodeDecodeError):
|
||||||
|
|||||||
Reference in new issue
Block a user