From dc03475d49f9d8d9dc4ace370c848c71e7b111ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Fri, 3 Feb 2017 22:54:09 +0100 Subject: [PATCH] removed unnecessary /usr/bin/envs -> script works on win32 based systems --- coub-dl.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/coub-dl.py b/coub-dl.py index 35d8f47..d000f74 100644 --- a/coub-dl.py +++ b/coub-dl.py @@ -48,16 +48,16 @@ def getDuration(ffprobe_output): def downloadStreams(): print_opt('Downloading audio stream... ', end='', flush=True) - call(('/usr/bin/env', 'youtube-dl', '--ignore-config', - '--extract-audio', - '--output', '{}.%(ext)s'.format(FILES[Stream.AUDIO]), - URL), + call(('youtube-dl', '--ignore-config', + '--extract-audio', + '--output', '{}.%(ext)s'.format(FILES[Stream.AUDIO]), + URL), stdout=DEVNULL, stderr=DEVNULL) print_opt('Done!') print_opt('Downloading video stream... ', end='', flush=True) - call(('/usr/bin/env', 'youtube-dl', '--ignore-config', - '--output', '{}.%(ext)s'.format(FILES[Stream.VIDEO]), - URL), + call(('youtube-dl', '--ignore-config', + '--output', '{}.%(ext)s'.format(FILES[Stream.VIDEO]), + URL), stdout=DEVNULL, stderr=DEVNULL) print_opt('Done!') @@ -97,7 +97,7 @@ URL = args.url # fetch video title -FILES[File.OUTPUT] = check_output(('/usr/bin/env', 'youtube-dl', '--get-title', args.url)).decode('utf-8').strip() + args.extension +FILES[File.OUTPUT] = check_output(('youtube-dl', '--get-title', args.url)).decode('utf-8').strip() + args.extension # ask what to do if output exists if exists(FILES[File.OUTPUT]): @@ -113,8 +113,8 @@ downloadStreams() readExtensions() # get stream lengths via ffprobe -audioData= getDuration(getCmdStdErr(('/usr/bin/env', 'ffprobe', FILES[Stream.AUDIO]))).split(':') -videoData = getDuration(getCmdStdErr(('/usr/bin/env', 'ffprobe', FILES[Stream.VIDEO]))).split(':') +audioData= getDuration(getCmdStdErr(('ffprobe', FILES[Stream.AUDIO]))).split(':') +videoData = getDuration(getCmdStdErr(('ffprobe', FILES[Stream.VIDEO]))).split(':') audioLen = timedelta(hours=float(audioData[0]), minutes=float(audioData[1]), seconds=float(audioData[2])) videoLen = timedelta(hours=float(videoData[0]), minutes=float(videoData[1]), seconds=float(videoData[2])) @@ -134,16 +134,16 @@ with open(FILES[File.LIST], 'w') as f: # loop shorter stream print_opt('Looping shorter stream... ', end='', flush=True) -call(('/usr/bin/env', 'ffmpeg', '-f', 'concat', '-i', FILES[File.LIST], '-c', 'copy', FILES[File.LOOP]), +call(('ffmpeg', '-f', 'concat', '-i', FILES[File.LIST], '-c', 'copy', FILES[File.LOOP]), stdout=DEVNULL, stderr=DEVNULL) print_opt('Done!') # mux with audio print_opt('Muxing streams... ', end='', flush=True) -call(('/usr/bin/env', 'ffmpeg', '-i', FILES[File.LOOP], - '-i', FILES[Stream.AUDIO], - '-map', '0:v:0', '-map', '1:a:0', - '-c', 'copy', FILES[File.OUTPUT]), +call(('ffmpeg', '-i', FILES[File.LOOP], + '-i', FILES[Stream.AUDIO], + '-map', '0:v:0', '-map', '1:a:0', + '-c', 'copy', FILES[File.OUTPUT]), stdout=DEVNULL, stderr=DEVNULL) print_opt('Done!')