mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
add require_lan #1853
This commit is contained in:
parent
4b0bec773f
commit
232b65914c
1 changed files with 6 additions and 2 deletions
|
@ -27,7 +27,7 @@ from core.utils import make_dir
|
||||||
__author__ = 'Justin'
|
__author__ = 'Justin'
|
||||||
|
|
||||||
|
|
||||||
def is_video_good(videofile, status):
|
def is_video_good(videofile, status, require_lan=None):
|
||||||
file_name_ext = os.path.basename(videofile)
|
file_name_ext = os.path.basename(videofile)
|
||||||
file_name, file_ext = os.path.splitext(file_name_ext)
|
file_name, file_ext = os.path.splitext(file_name_ext)
|
||||||
disable = False
|
disable = False
|
||||||
|
@ -63,7 +63,11 @@ def is_video_good(videofile, status):
|
||||||
if video_details.get('streams'):
|
if video_details.get('streams'):
|
||||||
video_streams = [item for item in video_details['streams'] if item['codec_type'] == 'video']
|
video_streams = [item for item in video_details['streams'] if item['codec_type'] == 'video']
|
||||||
audio_streams = [item for item in video_details['streams'] if item['codec_type'] == 'audio']
|
audio_streams = [item for item in video_details['streams'] if item['codec_type'] == 'audio']
|
||||||
if len(video_streams) > 0 and len(audio_streams) > 0:
|
if require_lan:
|
||||||
|
valid_audio = [item for item in audio_streams if audio_streams['tags']['language'] == require_lan ]
|
||||||
|
else:
|
||||||
|
valid_audio = audio_streams
|
||||||
|
if len(video_streams) > 0 and len(valid_audio) > 0:
|
||||||
logger.info('SUCCESS: [{0}] has no corruption.'.format(file_name_ext), 'TRANSCODER')
|
logger.info('SUCCESS: [{0}] has no corruption.'.format(file_name_ext), 'TRANSCODER')
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue