mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-15 01:32:53 -07:00
change to proc.communicate. Fixes #455
This commit is contained in:
parent
206f7e4c10
commit
16e8be1a35
1 changed files with 2 additions and 4 deletions
|
@ -6,7 +6,6 @@ import urllib2
|
||||||
import traceback
|
import traceback
|
||||||
import nzbtomedia
|
import nzbtomedia
|
||||||
import json
|
import json
|
||||||
import time
|
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from nzbtomedia import logger
|
from nzbtomedia import logger
|
||||||
from nzbtomedia.nzbToMediaUtil import makeDir
|
from nzbtomedia.nzbToMediaUtil import makeDir
|
||||||
|
@ -47,10 +46,9 @@ def getVideoDetails(videofile):
|
||||||
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:
|
||||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||||
while proc.poll() is None:
|
out, err = proc.communicate()
|
||||||
time.sleep(0.5)
|
|
||||||
result = proc.returncode
|
result = proc.returncode
|
||||||
video_details = json.loads(proc.stdout.read())
|
video_details = json.loads(out)
|
||||||
except:
|
except:
|
||||||
logger.error("Checking [%s] has failed" % (videofile), 'TRANSCODER')
|
logger.error("Checking [%s] has failed" % (videofile), 'TRANSCODER')
|
||||||
return video_details, result
|
return video_details, result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue