mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 03:03:01 +00:00
[bilibili] Show georestriction error
This commit is contained in:
parent
1ecb5d1d83
commit
c6b68648f4
1 changed files with 9 additions and 2 deletions
|
@ -41,8 +41,15 @@ def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
if self._search_regex(r'(此视频不存在或被删除)', webpage, 'error message', default=None):
|
if '(此视频不存在或被删除)' in webpage:
|
||||||
raise ExtractorError('The video does not exist or was deleted', expected=True)
|
raise ExtractorError(
|
||||||
|
'The video does not exist or was deleted', expected=True)
|
||||||
|
|
||||||
|
if '>你没有权限浏览! 由于版权相关问题 我们不对您所在的地区提供服务<' in webpage:
|
||||||
|
raise ExtractorError(
|
||||||
|
'The video is not available in your region due to copyright reasons',
|
||||||
|
expected=True)
|
||||||
|
|
||||||
video_code = self._search_regex(
|
video_code = self._search_regex(
|
||||||
r'(?s)<div itemprop="video".*?>(.*?)</div>', webpage, 'video code')
|
r'(?s)<div itemprop="video".*?>(.*?)</div>', webpage, 'video code')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue