Merge remote-tracking branch 'dcoppa/master'
authorPhilipp Hagemeister <phihag@phihag.de>
Fri, 1 Feb 2013 17:05:42 +0000 (18:05 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Fri, 1 Feb 2013 17:05:42 +0000 (18:05 +0100)
devscripts/release.sh
test/test_download.py
test/tests.json
youtube_dl/InfoExtractors.py
youtube_dl/utils.py
youtube_dl/version.py

index 561499ccb4884def99fe2cdd5415a99eba135ff2..d6c8e4d5e88a01994bb27107845ec4e53faa686e 100755 (executable)
@@ -83,4 +83,7 @@ ROOT=$(pwd)
 )
 rm -rf build
 
+echo "Uploading to PyPi ..."
+pip sdist upload
+
 echo "\n### DONE!"
index 14ac511d27c9729c55028a81c8e3c9a60015811f..f1bccf58c5a2eaab0fbb8d60bb1185007eae0ee8 100644 (file)
@@ -98,7 +98,7 @@ def generator(test_case):
 
             for tc in test_cases:
                 if not test_case.get('params', {}).get('skip_download', False):
-                    self.assertTrue(os.path.exists(tc['file']))
+                    self.assertTrue(os.path.exists(tc['file']), msg='Missing file ' + tc['file'])
                     self.assertTrue(tc['file'] in finished_hook_called)
                 self.assertTrue(os.path.exists(tc['file'] + '.info.json'))
                 if 'md5' in tc:
index a06266689d845e777f441ac314f48a4526c51da9..8fda1f1a9f535ec2727372038305cae555651c84 100644 (file)
   },
   {
     "name": "ComedyCentral",
-    "url": "http://www.thedailyshow.com/full-episodes/thu-december-13-2012-kristen-stewart",
-    "playlist": [
-      {
-        "file": "422204.mp4",
-        "md5": "7a7abe068b31ff03e7b8a37596e72380",
-        "info_dict": {
-            "title": "thedailyshow-thu-december-13-2012-kristen-stewart part 1"
-        }
-      },
-      {
-        "file": "422205.mp4",
-        "md5": "30552b7274c94dbb933f64600eadddd2",
-        "info_dict": {
-            "title": "thedailyshow-thu-december-13-2012-kristen-stewart part 2"
-        }
-      },
-      {
-        "file": "422206.mp4",
-        "md5": "1f4c0664b352cb8e8fe85d5da4fbee91",
-        "info_dict": {
-            "title": "thedailyshow-thu-december-13-2012-kristen-stewart part 3"
-        }
-      },
-      {
-        "file": "422207.mp4",
-        "md5": "f61ee8a4e6bd1308438e03badad78554",
-        "info_dict": {
-            "title": "thedailyshow-thu-december-13-2012-kristen-stewart part 4"
-        }
-      }
-    ]
+    "url": "http://www.thedailyshow.com/watch/thu-december-13-2012/kristen-stewart",
+    "file": "422212.mp4",
+    "md5": "4e2f5cb088a83cd8cdb7756132f9739d",
+    "info_dict": {
+        "title": "thedailyshow-kristen-stewart part 1"
+    }
   },
   {
     "name": "RBMARadio",
index 0860937eefaf023877dbfb2978e52a641b0ad4ed..8d8c591f7e9fe852c811f23baa43a8b6a6dffff7 100755 (executable)
@@ -2050,8 +2050,10 @@ class FacebookIE(InfoExtractor):
         if not m:
             raise ExtractorError(u'Cannot parse data')
         data = dict(json.loads(m.group(1)))
-        video_url = compat_urllib_parse.unquote(data['hd_src'])
-        video_duration = int(data['video_duration'])
+        params_raw = compat_urllib_parse.unquote(data['params'])
+        params = json.loads(params_raw)
+        video_url = params['hd_src']
+        video_duration = int(params['video_duration'])
 
         m = re.search('<h2 class="uiHeaderTitle">([^<]+)</h2>', webpage)
         if not m:
@@ -2064,7 +2066,7 @@ class FacebookIE(InfoExtractor):
             'url': video_url,
             'ext': 'mp4',
             'duration': video_duration,
-            'thumbnail': data['thumbnail_src'],
+            'thumbnail': params['thumbnail_src'],
         }
         return [info]
 
index 532e8c7825066ef822506a7589f9d3f48163f1f8..e6ce028d620e0c68952ffe18813cfb1a885beef7 100644 (file)
@@ -280,6 +280,12 @@ class AttrParser(compat_html_parser.HTMLParser):
             lines[-1] = lines[-1][:self.result[2][1]-self.result[1][1]]
         lines[-1] = lines[-1][:self.result[2][1]]
         return '\n'.join(lines).strip()
+# Hack for https://github.com/rg3/youtube-dl/issues/662
+if sys.version_info < (2, 7, 3):
+    AttrParser.parse_endtag = (lambda self, i:
+        i + len("</scr'+'ipt>")
+        if self.rawdata[i:].startswith("</scr'+'ipt>")
+        else compat_html_parser.HTMLParser.parse_endtag(self, i))
 
 def get_element_by_id(id, html):
     """Return the content of the tag with the specified ID in the passed HTML document"""
index 50fe6f8d7ec5bb823a136f69de8845ba67bd13fe..eed8f325c7a8d9e2ca958497b552b9bda72bc7e7 100644 (file)
@@ -1,2 +1,2 @@
 
-__version__ = '2013.01.28'
+__version__ = '2013.02.01'