Skip to content

Commit

Permalink
[cda] Detect geo restricted videos (refs #28106)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Feb 7, 2021
1 parent 2405854 commit 7a91615
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions youtube_dl/extractor/cda.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def _real_extract(self, url):
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):
Expand Down

1 comment on commit 7a91615

@raffaem
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the purpose of this commit?

Please sign in to comment.