From 3ef8be152b94a1e39a5e05e00720465658268910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 15 Jan 2017 21:29:09 +0100 Subject: [PATCH] now temporary files are cleaned up --- coub-dl.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/coub-dl.py b/coub-dl.py index e19fc17..1b71320 100644 --- a/coub-dl.py +++ b/coub-dl.py @@ -1,5 +1,5 @@ from subprocess import call, Popen, PIPE -from os import listdir +from os import listdir, remove from re import match from sys import argv from enum import Enum @@ -62,8 +62,14 @@ with open('list.txt', 'w') as f: for i in range(timesLoop): print("file '{}'".format(shorterFile), file=f) + call(('/usr/bin/env', 'ffmpeg', '-f', 'concat', '-i', 'list.txt', '-c', 'copy', 'loopedvideo.mp4')) call(('/usr/bin/env', 'ffmpeg', '-i', 'loopedvideo.mp4', '-i', FILES[Stream.AUDIO], '-map', '0', '-map', '1', '-c', 'copy', 'output.mp4')) + +remove(FILES[Stream.AUDIO]) +remove(FILES[Stream.VIDEO]) +remove('list.txt') +remove('loopedvideo.mp4')