aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/__init__.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-04-26 19:25:17 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-04-26 19:34:32 +0200
commit3820df0106d6065f50cc1eb90823906410dc9543 (patch)
tree71e3da6ac02dfc3e48aa206aa09ce886ed8c6a47 /youtube_dl/__init__.py
parentfa70605db287fd74f7d32b966ecca56260c651a0 (diff)
parent59cc5d9380ee6ffc9032c9a3873b006a824ae934 (diff)
Merge pull request #801 from expleo/add_referer_support
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r--youtube_dl/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 74375175d..d491402c6 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -140,6 +140,9 @@ def parseOpts(overrideArguments=None):
help='display the current browser identification', default=False)
general.add_option('--user-agent',
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',
action='store_true', dest='list_extractors',
help='List all supported extractors and the URLs they would handle', default=False)
@@ -342,6 +345,10 @@ def _real_main(argv=None):
# Set user agent
if opts.user_agent is not None:
std_headers['User-Agent'] = opts.user_agent
+
+ # Set referer
+ if opts.referer is not None:
+ std_headers['Referer'] = opts.referer
# Dump user agent
if opts.dump_user_agent: