|
|
@ -140,6 +140,9 @@ def parseOpts(overrideArguments=None):
|
|
|
|
help='display the current browser identification', default=False)
|
|
|
|
help='display the current browser identification', default=False)
|
|
|
|
general.add_option('--user-agent',
|
|
|
|
general.add_option('--user-agent',
|
|
|
|
dest='user_agent', help='specify a custom user agent', metavar='UA')
|
|
|
|
dest='user_agent', help='specify a custom user agent', metavar='UA')
|
|
|
|
|
|
|
|
general.add_option('--referer',
|
|
|
|
|
|
|
|
dest='referer', help='specify a custom referer, use if the video access is restricted to one domain',
|
|
|
|
|
|
|
|
metavar='REF', default=None)
|
|
|
|
general.add_option('--list-extractors',
|
|
|
|
general.add_option('--list-extractors',
|
|
|
|
action='store_true', dest='list_extractors',
|
|
|
|
action='store_true', dest='list_extractors',
|
|
|
|
help='List all supported extractors and the URLs they would handle', default=False)
|
|
|
|
help='List all supported extractors and the URLs they would handle', default=False)
|
|
|
@ -343,6 +346,10 @@ def _real_main(argv=None):
|
|
|
|
if opts.user_agent is not None:
|
|
|
|
if opts.user_agent is not None:
|
|
|
|
std_headers['User-Agent'] = opts.user_agent
|
|
|
|
std_headers['User-Agent'] = opts.user_agent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Set referer
|
|
|
|
|
|
|
|
if opts.referer is not None:
|
|
|
|
|
|
|
|
std_headers['Referer'] = opts.referer
|
|
|
|
|
|
|
|
|
|
|
|
# Dump user agent
|
|
|
|
# Dump user agent
|
|
|
|
if opts.dump_user_agent:
|
|
|
|
if opts.dump_user_agent:
|
|
|
|
print(std_headers['User-Agent'])
|
|
|
|
print(std_headers['User-Agent'])
|
|
|
|