Compare commits
2 commits
bcece622e3
...
4794c0f68a
Author | SHA1 | Date | |
---|---|---|---|
4794c0f68a | |||
de818c4204 |
3 changed files with 15 additions and 6 deletions
|
@ -205,6 +205,7 @@ def download(item_id, url, referer=None):
|
|||
f.extract_stream()
|
||||
status = True
|
||||
else:
|
||||
logger.error("failed to import %s file already exists %s", url, oshash)
|
||||
status = 'file exists'
|
||||
if len(parts) == 1:
|
||||
add_subtitles(f.item, media, tmp)
|
||||
|
|
|
@ -733,18 +733,23 @@ def remux_stream(src, dst):
|
|||
cmd = [
|
||||
settings.FFMPEG,
|
||||
'-nostats', '-loglevel', 'error',
|
||||
'-map_metadata', '-1', '-sn',
|
||||
'-i', src,
|
||||
'-map_metadata', '-1', '-sn',
|
||||
] + video + [
|
||||
] + audio + [
|
||||
'-movflags', '+faststart',
|
||||
dst
|
||||
]
|
||||
print(cmd)
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
|
||||
stdout=open('/dev/null', 'w'),
|
||||
stderr=open('/dev/null', 'w'),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
close_fds=True)
|
||||
p.wait()
|
||||
stdout, stderr = p.communicate()
|
||||
if stderr:
|
||||
logger.error("failed to remux %s %s", cmd, stderr)
|
||||
return False, stderr
|
||||
else:
|
||||
return True, None
|
||||
|
||||
|
||||
|
|
|
@ -821,6 +821,9 @@ class Stream(models.Model):
|
|||
done = True
|
||||
elif self.file.can_remux():
|
||||
ok, error = extract.remux_stream(media, target)
|
||||
if ok:
|
||||
self.available = True
|
||||
self.save()
|
||||
done = True
|
||||
if not done:
|
||||
ok, error = extract.stream(media, target, self.name(), info, flags=self.flags)
|
||||
|
|
Loading…
Reference in a new issue