aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2021-02-07 19:18:06 +0700
committerSergey M․ <dstftw@gmail.com>2021-02-07 19:18:40 +0700
commit7a9161578e42abe681c9d3352ecc9a18a9b8df6a (patch)
tree79a7f8cb9b0f5cc488d219eaa8f20848aba2a4f1 /youtube_dl
parent240585470539d31d9c3785a67861491fa3696451 (diff)
[cda] Detect geo restricted videos (refs #28106)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/cda.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube_dl/extractor/cda.py b/youtube_dl/extractor/cda.py
index 6429454fb..1b4362144 100644
--- a/youtube_dl/extractor/cda.py
+++ b/youtube_dl/extractor/cda.py
@@ -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):