refactor YouTube subtitles code, it was ugly (my bad)
[youtube-dl] / youtube_dl / __init__.py
index ce4e678482b3173b0b25130534694bf2744a4d71..efa8b813f8ea0b96b65b971c83e2a8b376e78607 100644 (file)
@@ -20,6 +20,7 @@ __authors__  = (
     'shizeeg',
     'Filippo Valsorda',
     'Christian Albrecht',
+    'Dave Vasilevsky',
     )
 
 __license__ = 'Public Domain'
@@ -374,7 +375,6 @@ def gen_extractors():
         YoutubeIE(),
         MetacafeIE(),
         DailymotionIE(),
-        GoogleIE(),
         GoogleSearchIE(),
         PhotobucketIE(),
         YahooIE(),
@@ -399,6 +399,7 @@ def gen_extractors():
         GooglePlusIE(),
         ArteTvIE(),
         NBAIE(),
+        JustinTVIE(),
         GenericIE()
     ]
 
@@ -506,7 +507,8 @@ def _real_main():
 
     if sys.version_info < (3,):
         # In Python 2, sys.argv is a bytestring (also note http://bugs.python.org/issue2128 for Windows systems)
-        opts.outtmpl = opts.outtmpl.decode(preferredencoding())
+        if opts.outtmpl is not None:
+            opts.outtmpl = opts.outtmpl.decode(preferredencoding())
     outtmpl =((opts.outtmpl is not None and opts.outtmpl)
             or (opts.format == '-1' and opts.usetitle and u'%(title)s-%(id)s-%(format)s.%(ext)s')
             or (opts.format == '-1' and u'%(id)s-%(format)s.%(ext)s')