1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +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

@ -860,17 +860,16 @@ def create_parser():
workarounds.add_option(
'--user-agent',
metavar='UA', dest='user_agent',
help='Specify a custom user agent')
help=optparse.SUPPRESS_HELP)
workarounds.add_option(
'--referer',
metavar='URL', dest='referer', default=None,
help='Specify a custom referer, use if the video access is restricted to one domain',
)
help=optparse.SUPPRESS_HELP)
workarounds.add_option(
'--add-header',
metavar='FIELD:VALUE', dest='headers', default={}, type='str',
action='callback', callback=_dict_from_options_callback,
callback_kwargs={'multiple_keys': False, 'process_key': None},
callback_kwargs={'multiple_keys': False},
help='Specify a custom HTTP header and its value, separated by a colon ":". You can use this option multiple times',
)
workarounds.add_option(