added hotfix to youtube-dl's coub video bug: https://github.com/rg3/youtube-dl/issues/13754

This commit is contained in:
Kjistóf 2017-08-22 00:50:18 +02:00
parent 0bf31633db
commit 1e7a5a2cf2
1 changed files with 15 additions and 0 deletions

View File

@ -91,6 +91,21 @@ def download_audio_stream(url, file_dict):
@call_verbose(before_message='Downloading video stream... ')
def download_video_stream(url, file_dict):
url = check_output(('youtube-dl',
'--get-url', url)).decode('utf-8').strip()
curl = Popen(('curl', '--silent',
'--write-out',
'--location',
url),
stdout=PIPE)
grep = Popen(('grep', '--only-matching', '"http.*"'),
stdin=curl.stdout, stdout=PIPE)
url = check_output(('sed', 's/muted_//g'),
stdin=grep.stdout).decode('utf-8').strip().strip('"')
call(('youtube-dl', '--ignore-config',
'--output', '{}.%(ext)s'.format(file_dict[Stream.VIDEO]),
url),