aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl')
-rwxr-xr-xyoutube_dl/InfoExtractors.py8
-rw-r--r--youtube_dl/utils.py6
-rw-r--r--youtube_dl/version.py2
3 files changed, 12 insertions, 4 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index 0860937ee..8d8c591f7 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -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]
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 532e8c782..e6ce028d6 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -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"""
diff --git a/youtube_dl/version.py b/youtube_dl/version.py
index 50fe6f8d7..eed8f325c 100644
--- a/youtube_dl/version.py
+++ b/youtube_dl/version.py
@@ -1,2 +1,2 @@
-__version__ = '2013.01.28'
+__version__ = '2013.02.01'