From d7a0be71fbfdafed2f14f4d0eca46a1efa94eab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 15 Jan 2017 20:59:53 +0100 Subject: [PATCH] implemented writing of list file --- coub-dl.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coub-dl.py b/coub-dl.py index ca762fa..85e01af 100644 --- a/coub-dl.py +++ b/coub-dl.py @@ -54,10 +54,11 @@ print(videoLen) longer = audioLen if audioLen > videoLen else videoLen shorter = audioLen if audioLen < videoLen else videoLen +shorterFile = FILES[Stream.AUDIO] if audioLen < videoLen else FILES[Stream.VIDEO] timesLoop = ceil(longer.seconds / shorter.seconds) -print('Longer: {}'.format(longer)) -print('Shorter: {}'.format(shorter)) +with open('list.txt', 'w') as f: + for i in range(timesLoop): + print(shorterFile, file=f) -print('Loop {} times.'.format(timesLoop))