mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 03:33:02 +00:00
[facebook] Report a more meaningful message if the video cannot be accessed (closes #1658)
This commit is contained in:
parent
67874aeffa
commit
6f71ef580c
1 changed files with 6 additions and 1 deletions
|
@ -100,7 +100,12 @@ def _real_extract(self, url):
|
||||||
AFTER = '.forEach(function(variable) {swf.addVariable(variable[0], variable[1]);});'
|
AFTER = '.forEach(function(variable) {swf.addVariable(variable[0], variable[1]);});'
|
||||||
m = re.search(re.escape(BEFORE) + '(.*?)' + re.escape(AFTER), webpage)
|
m = re.search(re.escape(BEFORE) + '(.*?)' + re.escape(AFTER), webpage)
|
||||||
if not m:
|
if not m:
|
||||||
raise ExtractorError(u'Cannot parse data')
|
m_msg = re.search(r'class="[^"]*uiInterstitialContent[^"]*"><div>(.*?)</div>', webpage)
|
||||||
|
if m_msg is not None:
|
||||||
|
err_msg = u'The video is not available, Facebook said: "%s"' % m_msg.group(1)
|
||||||
|
else:
|
||||||
|
err_msg = u'Cannot parse data'
|
||||||
|
raise ExtractorError(err_msg)
|
||||||
data = dict(json.loads(m.group(1)))
|
data = dict(json.loads(m.group(1)))
|
||||||
params_raw = compat_urllib_parse.unquote(data['params'])
|
params_raw = compat_urllib_parse.unquote(data['params'])
|
||||||
params = json.loads(params_raw)
|
params = json.loads(params_raw)
|
||||||
|
|
Loading…
Reference in a new issue