[cda] Detect geo restricted videos (refs #28106)

This commit is contained in:
Sergey M․ 2021-02-07 19:18:06 +07:00
parent 2405854705
commit 7a9161578e
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 3 additions and 0 deletions

View File

@ -95,6 +95,9 @@ class CDAIE(InfoExtractor):
if 'Ten film jest dostępny dla użytkowników premium' in webpage:
raise ExtractorError('This video is only available for premium users.', expected=True)
if re.search(r'niedostępn[ey] w(?:&nbsp;|\s+)Twoim kraju\s*<', webpage):
self.raise_geo_restricted()
need_confirm_age = False
if self._html_search_regex(r'(<form[^>]+action="[^"]*/a/validatebirth[^"]*")',
webpage, 'birthday validate form', default=None):