[generic] Ignore stupid HTTP servers (#1284)
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 21 Aug 2013 02:31:57 +0000 (04:31 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 21 Aug 2013 02:32:07 +0000 (04:32 +0200)
youtube_dl/extractor/generic.py

index b633e896c6eb3d5b2158585d01ffba9615fe8f31..1c468f8f6bff0e36b425f0c5dda85d360ff8fc79 100644 (file)
@@ -107,8 +107,13 @@ class GenericIE(InfoExtractor):
         return new_url
 
     def _real_extract(self, url):
-        new_url = self._test_redirect(url)
-        if new_url: return [self.url_result(new_url)]
+        try:
+            new_url = self._test_redirect(url)
+            if new_url:
+                return [self.url_result(new_url)]
+        except compat_urllib_error.HTTPError:
+            # This may be a stupid server that doesn't like HEAD, our UA, or so
+            pass
 
         video_id = url.split('/')[-1]
         try: