use avprobe. Fixes #503 and don't link single files for NZB. Fixes #519

This commit is contained in:
clinton-hall 2014-08-04 11:10:39 +09:30
parent 924b7e12f2
commit 8006d20df4
3 changed files with 8 additions and 4 deletions

View file

@ -266,7 +266,7 @@ def main(args):
for section, subsections in nzbtomedia.SECTIONS.items(): for section, subsections in nzbtomedia.SECTIONS.items():
for subsection in subsections: for subsection in subsections:
for dirName in nzbtomedia.getDirs(section,subsection): for dirName in nzbtomedia.getDirs(section, subsection, link='hard'):
logger.info("Starting manual run for %s:%s - Folder:%s" % (section, subsection, dirName)) logger.info("Starting manual run for %s:%s - Folder:%s" % (section, subsection, dirName))
logger.info("Checking database for download info for %s ..." % (os.path.basename(dirName))) logger.info("Checking database for download info for %s ..." % (os.path.basename(dirName)))

View file

@ -706,7 +706,7 @@ def main(args, section=None):
for section, subsections in nzbtomedia.SECTIONS.items(): for section, subsections in nzbtomedia.SECTIONS.items():
for subsection in subsections: for subsection in subsections:
for dirName in getDirs(section, subsection): for dirName in getDirs(section, subsection, link = 'move'):
logger.info("Starting manual run for %s:%s - Folder:%s" % (section, subsection, dirName)) logger.info("Starting manual run for %s:%s - Folder:%s" % (section, subsection, dirName))
logger.info("Checking database for download info for %s ..." % (os.path.basename(dirName))) logger.info("Checking database for download info for %s ..." % (os.path.basename(dirName)))

View file

@ -44,8 +44,12 @@ def getVideoDetails(videofile):
result = 1 result = 1
if not nzbtomedia.FFPROBE: if not nzbtomedia.FFPROBE:
return video_details, result return video_details, result
if 'avprobe' in nzbtomedia.FFPROBE:
print_format = '-of'
else:
print_format = '-print_format'
try: try:
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]
proc = subprocess.Popen(command, stdout=subprocess.PIPE) proc = subprocess.Popen(command, stdout=subprocess.PIPE)
out, err = proc.communicate() out, err = proc.communicate()
result = proc.returncode result = proc.returncode
@ -53,7 +57,7 @@ def getVideoDetails(videofile):
except: pass except: pass
if not video_details: if not video_details:
try: try:
command = [nzbtomedia.FFPROBE, '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', videofile] command = [nzbtomedia.FFPROBE, '-v', 'quiet', print_format, 'json', '-show_format', '-show_streams', videofile]
proc = subprocess.Popen(command, stdout=subprocess.PIPE) proc = subprocess.Popen(command, stdout=subprocess.PIPE)
out, err = proc.communicate() out, err = proc.communicate()
result = proc.returncode result = proc.returncode