Merge branch 'robin007bond-gamekings'
[youtube-dl] / youtube_dl / extractor / appletrailers.py
index 87580147dcb4176b163417053ac5a2489cf556c3..287f71e076e91a44ea331c995410fbe8b40d178d 100644 (file)
@@ -4,8 +4,8 @@ import re
 import json
 
 from .common import InfoExtractor
+from ..compat import compat_urlparse
 from ..utils import (
-    compat_urlparse,
     int_or_none,
 )
 
@@ -80,7 +80,7 @@ class AppleTrailersIE(InfoExtractor):
             def _clean_json(m):
                 return 'iTunes.playURL(%s);' % m.group(1).replace('\'', ''')
             s = re.sub(self._JSON_RE, _clean_json, s)
-            s = '<html>' + s + u'</html>'
+            s = '<html>%s</html>' % s
             return s
         doc = self._download_xml(playlist_url, movie, transform_source=fix_html)
 
@@ -122,14 +122,15 @@ class AppleTrailersIE(InfoExtractor):
             playlist.append({
                 '_type': 'video',
                 'id': video_id,
-                'title': title,
                 'formats': formats,
                 'title': title,
                 'duration': duration,
                 'thumbnail': thumbnail,
                 'upload_date': upload_date,
                 'uploader_id': uploader_id,
-                'user_agent': 'QuickTime compatible (youtube-dl)',
+                'http_headers': {
+                    'User-Agent': 'QuickTime compatible (youtube-dl)',
+                },
             })
 
         return {