mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-30 11:38:30 -07:00
Change proc.wait to proc.poll. Fixes #455
This commit is contained in:
parent
4ee8cf17a0
commit
15948b2510
1 changed files with 5 additions and 2 deletions
|
@ -45,11 +45,14 @@ def getVideoDetails(videofile):
|
||||||
return video_details, result
|
return video_details, result
|
||||||
command = [nzbtomedia.FFPROBE, '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', '-show_error', videofile]
|
command = [nzbtomedia.FFPROBE, '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', '-show_error', videofile]
|
||||||
try:
|
try:
|
||||||
|
result = None
|
||||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||||
result = proc.wait()
|
while proc.poll() is None:
|
||||||
|
time.sleep(0.5)
|
||||||
|
result = proc.returncode
|
||||||
video_details = json.loads(proc.stdout.read())
|
video_details = json.loads(proc.stdout.read())
|
||||||
except:
|
except:
|
||||||
logger.error("Checking [%s] has failed" % (fileNameExt), 'TRANSCODER')
|
logger.error("Checking [%s] has failed" % (videofile), 'TRANSCODER')
|
||||||
return video_details, result
|
return video_details, result
|
||||||
|
|
||||||
def buildCommands(file, newDir):
|
def buildCommands(file, newDir):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue