1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +00:00

Implement --add-header without modifying std_headers

Closes #2526, #1614
This commit is contained in:
pukkandan
2022-01-29 03:25:35 +05:30
parent e48b3875ec
commit 8b7539d27c
10 changed files with 28 additions and 29 deletions

View File

@ -16,7 +16,6 @@ from ..utils import (
ExtractorError,
get_exe_version,
is_outdated_version,
std_headers,
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.get_param('http_headers')['User-Agent']
replaces['ua'] = user_agent.replace('"', '\\"')
replaces['jscode'] = jscode