Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rg3/youtube-dl
Browse files Browse the repository at this point in the history
  • Loading branch information
phihag committed Sep 27, 2012
2 parents 74e716b + df09e5f commit 34ae0f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion youtube_dl/__init__.py
Expand Up @@ -190,6 +190,8 @@ def _find_term_columns():
general.add_option('--dump-user-agent',
action='store_true', dest='dump_user_agent',
help='display the current browser identification', default=False)
general.add_option('--user-agent',
action='store', dest='useragent', help='specify a custom user agent')
general.add_option('--list-extractors',
action='store_true', dest='list_extractors',
help='List all supported extractors and the URLs they would handle', default=False)
Expand Down Expand Up @@ -370,7 +372,10 @@ def _real_main():
jar.load()
except (IOError, OSError), err:
sys.exit(u'ERROR: unable to open cookie file')

# Set user agent
if opts.useragent is not None:
std_headers['User-Agent'] = opts.useragent

# Dump user agent
if opts.dump_user_agent:
print std_headers['User-Agent']
Expand Down

0 comments on commit 34ae0f9

Please sign in to comment.