aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/generic.py
diff options
context:
space:
mode:
authorPierre Rudloff <pierre@rudloff.pro>2013-08-22 12:52:05 +0200
committerPierre Rudloff <pierre@rudloff.pro>2013-08-22 12:52:05 +0200
commit8d212e604a86da3c924ab15fe8045ab748a8183d (patch)
tree5bc5588e5bbe7f8dad3fb1d0bbba354f2fb9e90c /youtube_dl/extractor/generic.py
parent943f7f7a399c6fb3006eb2bd68070f28a272171f (diff)
parent063fcc9676718fc4395b92d6e9665e7f3e9c8156 (diff)
Merge remote-tracking branch 'upstream/master'
Conflicts: youtube_dl/extractor/jeuxvideo.py
Diffstat (limited to 'youtube_dl/extractor/generic.py')
-rw-r--r--youtube_dl/extractor/generic.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py
index b633e896c..da016f7ee 100644
--- a/youtube_dl/extractor/generic.py
+++ b/youtube_dl/extractor/generic.py
@@ -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:
@@ -145,6 +150,9 @@ class GenericIE(InfoExtractor):
if m_video_type is not None:
mobj = re.search(r'<meta.*?property="og:video".*?content="(.*?)"', webpage)
if mobj is None:
+ # HTML5 video
+ mobj = re.search(r'<video[^<]*>.*?<source .*?src="([^"]+)"', webpage, flags=re.DOTALL)
+ if mobj is None:
raise ExtractorError(u'Invalid URL: %s' % url)
# It's possible that one of the regexes