removed unnecessary /usr/bin/envs -> script works on win32 based systems
This commit is contained in:
parent
c2c7d52075
commit
dc03475d49
30
coub-dl.py
30
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!')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user