forked from 0x2620/pandora
merge parts into one file on download
This commit is contained in:
parent
cd0284a15c
commit
88068794e4
3 changed files with 40 additions and 0 deletions
|
|
@ -1180,6 +1180,18 @@ class Item(models.Model):
|
|||
Q(file__is_audio=True)|Q(file__is_video=True)
|
||||
).order_by('file__part', 'file__sort_path')
|
||||
|
||||
def merge_streams(self, output):
|
||||
first = True
|
||||
cmd = ['mkvmerge', '-o', output]
|
||||
streams = [s.media.path for s in self.streams()]
|
||||
if len(streams) > 1:
|
||||
cmd += [streams[0]] + ['+' + s for s in streams[1:]]
|
||||
print cmd
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
p.wait()
|
||||
return True
|
||||
return streams[0] if streams else None
|
||||
|
||||
def update_timeline(self, force=False, async=True):
|
||||
streams = self.streams()
|
||||
self.make_timeline()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue