diff options
author | Jesús <heckyel@hyperbola.info> | 2022-04-06 03:37:17 +0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-04-06 03:37:17 +0800 |
commit | 1e5a50b71d8f0eae6007bedc329eecb24bb5aba3 (patch) | |
tree | a8611cda6596391cb6fb645e1469dcd356b63924 /hypervideo_dl/extractor/openload.py | |
parent | f52fb3bceeb9d22b5106c1796fecec474a0cc138 (diff) | |
download | hypervideo-1e5a50b71d8f0eae6007bedc329eecb24bb5aba3.tar.lz hypervideo-1e5a50b71d8f0eae6007bedc329eecb24bb5aba3.tar.xz hypervideo-1e5a50b71d8f0eae6007bedc329eecb24bb5aba3.zip |
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/openload.py')
-rw-r--r-- | hypervideo_dl/extractor/openload.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/hypervideo_dl/extractor/openload.py b/hypervideo_dl/extractor/openload.py index dfdd0e5..fe4740a 100644 --- a/hypervideo_dl/extractor/openload.py +++ b/hypervideo_dl/extractor/openload.py @@ -16,8 +16,7 @@ from ..utils import ( ExtractorError, get_exe_version, is_outdated_version, - std_headers, - process_communicate_or_kill, + Popen, ) @@ -208,7 +207,7 @@ class PhantomJSwrapper(object): replaces = self.options replaces['url'] = url - user_agent = headers.get('User-Agent') or std_headers['User-Agent'] + user_agent = headers.get('User-Agent') or self.extractor.get_param('http_headers')['User-Agent'] replaces['ua'] = user_agent.replace('"', '\\"') replaces['jscode'] = jscode @@ -223,11 +222,10 @@ class PhantomJSwrapper(object): else: self.extractor.to_screen('%s: %s' % (video_id, note2)) - p = subprocess.Popen([ - self.exe, '--ssl-protocol=any', - self._TMP_FILES['script'].name - ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = process_communicate_or_kill(p) + p = Popen( + [self.exe, '--ssl-protocol=any', self._TMP_FILES['script'].name], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate_or_kill() if p.returncode != 0: raise ExtractorError( 'Executing JS failed\n:' + encodeArgument(err)) |