forked from LBRYCommunity/lbry-sdk
hide ValueError
This commit is contained in:
parent
a3294d4a0d
commit
e060df5367
2 changed files with 10 additions and 8 deletions
|
@ -3142,11 +3142,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
f"Use --allow-duplicate-name flag to override."
|
f"Use --allow-duplicate-name flag to override."
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
file_path = await self._video_file_analyzer.verify_or_repair(validate_file, optimize_file,
|
||||||
file_path = await self._video_file_analyzer.verify_or_repair(validate_file, optimize_file, file_path)
|
file_path, ignore_non_video=True)
|
||||||
except ValueError:
|
|
||||||
pass # it's not a video file
|
|
||||||
|
|
||||||
claim = Claim()
|
claim = Claim()
|
||||||
claim.stream.update(file_path=file_path, sd_hash='0' * 96, **kwargs)
|
claim.stream.update(file_path=file_path, sd_hash='0' * 96, **kwargs)
|
||||||
tx = await Transaction.claim_create(
|
tx = await Transaction.claim_create(
|
||||||
|
|
|
@ -47,7 +47,7 @@ class VideoFileAnalyzer:
|
||||||
return
|
return
|
||||||
await self._verify_executable("ffprobe")
|
await self._verify_executable("ffprobe")
|
||||||
version = await self._verify_executable("ffmpeg")
|
version = await self._verify_executable("ffmpeg")
|
||||||
self._which = shutil.which("ffmpeg")
|
self._which = shutil.which(os.path.join(self._conf.ffmpeg_folder, "ffmpeg"))
|
||||||
self._ffmpeg_installed = True
|
self._ffmpeg_installed = True
|
||||||
log.debug("Using %s at %s", version.splitlines()[0].split(" Copyright")[0], self._which)
|
log.debug("Using %s at %s", version.splitlines()[0].split(" Copyright")[0], self._which)
|
||||||
|
|
||||||
|
@ -286,12 +286,17 @@ class VideoFileAnalyzer:
|
||||||
|
|
||||||
return scan_data
|
return scan_data
|
||||||
|
|
||||||
async def verify_or_repair(self, validate, repair, file_path):
|
async def verify_or_repair(self, validate, repair, file_path, ignore_non_video=False):
|
||||||
if not validate and not repair:
|
if not validate and not repair:
|
||||||
return file_path
|
return file_path
|
||||||
|
|
||||||
await self._verify_ffmpeg_installed()
|
await self._verify_ffmpeg_installed()
|
||||||
scan_data = await self._get_scan_data(validate, file_path)
|
try:
|
||||||
|
scan_data = await self._get_scan_data(validate, file_path)
|
||||||
|
except ValueError:
|
||||||
|
if ignore_non_video:
|
||||||
|
return file_path
|
||||||
|
raise
|
||||||
|
|
||||||
fast_start_msg = await self._verify_fast_start(scan_data, file_path)
|
fast_start_msg = await self._verify_fast_start(scan_data, file_path)
|
||||||
log.debug("Analyzing %s:", file_path)
|
log.debug("Analyzing %s:", file_path)
|
||||||
|
|
Loading…
Add table
Reference in a new issue