aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/openload.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/openload.py')
-rw-r--r--hypervideo_dl/extractor/openload.py14
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))