Merge remote-tracking branch 'FiloSottille/vbr'
[youtube-dl] / youtube_dl / __init__.py
index 8817228f31ea9bd9073189a5980d2f56bbf30d44..3b3a9a4f494d099c1a00d00900f83549d379e65c 100644 (file)
@@ -19,7 +19,7 @@ __authors__  = (
        )
 
 __license__ = 'Public Domain'
-__version__ = '2012.02.27'
+__version__ = '2012.09.27'
 
 UPDATE_URL = 'https://raw.github.com/rg3/youtube-dl/master/youtube-dl'
 UPDATE_URL_VERSION = 'https://raw.github.com/rg3/youtube-dl/master/LATEST_VERSION'
@@ -190,6 +190,8 @@ def parseOpts():
        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)
@@ -338,6 +340,7 @@ def gen_extractors():
                YahooSearchIE(),
                DepositFilesIE(),
                FacebookIE(),
+               BlipTVUserIE(),
                BlipTVIE(),
                VimeoIE(),
                MyVideoIE(),
@@ -350,6 +353,8 @@ def gen_extractors():
                MixcloudIE(),
                StanfordOpenClassroomIE(),
                MTVIE(),
+               YoukuIE(),
+               XNXXIE(),
 
                GenericIE()
        ]
@@ -367,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']