mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
add test file to verify FFprobe works. #531
This commit is contained in:
parent
bf727877d1
commit
a84e9c3475
5 changed files with 30 additions and 7 deletions
|
@ -22,6 +22,7 @@ CONFIG_FILE = os.path.join(PROGRAM_DIR, 'autoProcessMedia.cfg')
|
|||
CONFIG_SPEC_FILE = os.path.join(PROGRAM_DIR, 'autoProcessMedia.cfg.spec')
|
||||
CONFIG_MOVIE_FILE = os.path.join(PROGRAM_DIR, 'autoProcessMovie.cfg')
|
||||
CONFIG_TV_FILE = os.path.join(PROGRAM_DIR, 'autoProcessTv.cfg')
|
||||
TEST_FILE = os.path.join(os.path.join(PROGRAM_DIR, 'tests'), 'test.mp4')
|
||||
MYAPP = None
|
||||
|
||||
from nzbtomedia.autoProcess.autoProcessComics import autoProcessComics
|
||||
|
@ -188,7 +189,7 @@ def initialize(section=None):
|
|||
SABNZB_NO_OF_ARGUMENTS, SABNZB_0717_NO_OF_ARGUMENTS, CATEGORIES, TORRENT_CLIENTAGENT, USELINK, OUTPUTDIRECTORY, \
|
||||
NOFLATTEN, UTORRENTPWD, UTORRENTUSR, UTORRENTWEBUI, DELUGEHOST, DELUGEPORT, DELUGEUSR, DELUGEPWD, \
|
||||
TRANSMISSIONHOST, TRANSMISSIONPORT, TRANSMISSIONPWD, TRANSMISSIONUSR, COMPRESSEDCONTAINER, MEDIACONTAINER, \
|
||||
METACONTAINER, SECTIONS, ALL_FORKS, \
|
||||
METACONTAINER, SECTIONS, ALL_FORKS, TEST_FILE, \
|
||||
__INITIALIZED__, AUTO_UPDATE, APP_FILENAME, USER_DELAY, APP_NAME, TRANSCODE, DEFAULTS, GIT_PATH, GIT_USER, \
|
||||
GIT_BRANCH, GIT_REPO, SYS_ENCODING, NZB_CLIENTAGENT, SABNZBDHOST, SABNZBDPORT, SABNZBDAPIKEY, \
|
||||
DUPLICATE, IGNOREEXTENSIONS, VEXTENSION, OUTPUTVIDEOPATH, PROCESSOUTPUT, VCODEC, VCODEC_ALLOW, VPRESET, \
|
||||
|
|
|
@ -75,7 +75,8 @@ def autoFork(section, inputCategory):
|
|||
r = requests.get(url, verify=False)
|
||||
except requests.ConnectionError:
|
||||
logger.info("Could not connect to %s:%s to perform auto-fork detection!" % (section, inputCategory))
|
||||
if r.ok:
|
||||
r = []
|
||||
if r and r.ok:
|
||||
for param in params:
|
||||
if not 'name="%s"' %(param) in r.text:
|
||||
rem_params.append(param)
|
||||
|
|
|
@ -14,7 +14,21 @@ from nzbtomedia.nzbToMediaUtil import makeDir
|
|||
def isVideoGood(videofile, status):
|
||||
fileNameExt = os.path.basename(videofile)
|
||||
fileName, fileExt = os.path.splitext(fileNameExt)
|
||||
disable = False
|
||||
if fileExt not in nzbtomedia.MEDIACONTAINER or not nzbtomedia.FFPROBE or not nzbtomedia.CHECK_MEDIA:
|
||||
disable = True
|
||||
else:
|
||||
test_details, res = getVideoDetails(nzbtomedia.TEST_FILE)
|
||||
if res !=0 or test_details.get("error"):
|
||||
disable = True
|
||||
logger.info("DISABLED: ffprobe failed to analyse test file. Stopping corruption check.", 'TRANSCODER')
|
||||
if test_details.get("streams"):
|
||||
vidStreams = [item for item in test_details["streams"] if item["codec_type"] == "video"]
|
||||
audStreams = [item for item in test_details["streams"] if item["codec_type"] == "audio"]
|
||||
if not (len(vidStreams) > 0 and len(audStreams) > 0):
|
||||
disable = True
|
||||
logger.info("DISABLED: ffprobe failed to analyse streams from test file. Stopping corruption check.", 'TRANSCODER')
|
||||
if disable:
|
||||
if status: # if the download was "failed", assume bad. If it was successful, assume good.
|
||||
return False
|
||||
else:
|
||||
|
|
|
@ -5,11 +5,17 @@ import re
|
|||
import nzbtomedia
|
||||
from nzbtomedia.nzbToMediaAutoFork import autoFork
|
||||
from nzbtomedia import nzbToMediaDB
|
||||
from nzbtomedia.transcoder import transcoder
|
||||
from nzbtomedia.nzbToMediaUtil import get_downloadInfo, server_responding
|
||||
|
||||
# Initialize the config
|
||||
nzbtomedia.initialize()
|
||||
|
||||
if transcoder.isVideoGood(nzbtomedia.TEST_FILE, 0):
|
||||
print "FFPROBE Works"
|
||||
else:
|
||||
print "FFPROBE FAILED"
|
||||
|
||||
test = nzbtomedia.CFG['SickBeard','NzbDrone']['tv'].isenabled()
|
||||
section = nzbtomedia.CFG.findsection('tv').isenabled()
|
||||
print section
|
||||
|
@ -32,3 +38,4 @@ print Language('eng')
|
|||
import subliminal
|
||||
|
||||
subliminal.cache_region.configure('dogpile.cache.memory')
|
||||
del nzbtomedia.MYAPP
|
BIN
tests/test.mp4
Normal file
BIN
tests/test.mp4
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue