From: Philipp Hagemeister Date: Mon, 23 Dec 2013 04:03:32 +0000 (+0100) Subject: Merge remote-tracking branch 'jaimeMF/split-downloaders' X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=youtube-dl;a=commitdiff_plain;h=9fc3bef87a1009eb48f2012f3eab65761a53ba5e Merge remote-tracking branch 'jaimeMF/split-downloaders' --- 9fc3bef87a1009eb48f2012f3eab65761a53ba5e diff --cc youtube_dl/YoutubeDL.py index e705c410b,414aa5a80..04771c637 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@@ -248,16 -228,19 +246,20 @@@ class YoutubeDL(object) self._pps.append(pp) pp.set_downloader(self) + def add_downloader_progress_hook(self, ph): + """Add the progress hook to the file downloader""" + self._fd_progress_hooks.append(ph) + def _bidi_workaround(self, message): - if not hasattr(self, '_fribidi_channel'): + if not hasattr(self, '_output_channel'): return message + assert hasattr(self, '_output_process') assert type(message) == type(u'') line_count = message.count(u'\n') + 1 - self._fribidi.stdin.write((message + u'\n').encode('utf-8')) - self._fribidi.stdin.flush() - res = u''.join(self._fribidi_channel.readline().decode('utf-8') + self._output_process.stdin.write((message + u'\n').encode('utf-8')) + self._output_process.stdin.flush() + res = u''.join(self._output_channel.readline().decode('utf-8') for _ in range(line_count)) return res[:-len(u'\n')]