From ad55bfcfb700fbfc1364c04e3425761d6f95c0a7 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:36:17 -0500 Subject: [PATCH] [ie/10play] Handle geo-restriction errors (#14618) Authored by: bashonly --- yt_dlp/extractor/tenplay.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/tenplay.py b/yt_dlp/extractor/tenplay.py index 4393d147af..bf82f4bfda 100644 --- a/yt_dlp/extractor/tenplay.py +++ b/yt_dlp/extractor/tenplay.py @@ -98,7 +98,7 @@ class TenPlayIE(InfoExtractor): 'only_matching': True, }] _GEO_BYPASS = False - + _GEO_COUNTRIES = ['AU'] _AUS_AGES = { 'G': 0, 'PG': 15, @@ -208,8 +208,15 @@ class TenPlayIE(InfoExtractor): def _real_extract(self, url): content_id = self._match_id(url) - data = self._download_json( - f'https://10.com.au/api/v1/videos/{content_id}', content_id) + try: + data = self._download_json(f'https://10.com.au/api/v1/videos/{content_id}', content_id) + except ExtractorError as e: + if ( + isinstance(e.cause, HTTPError) and e.cause.status == 403 + and 'Error 54113' in e.cause.response.read().decode() + ): + self.raise_geo_restricted(countries=self._GEO_COUNTRIES) + raise video_data, urlh = self._call_playback_api(content_id) content_source_id = video_data['dai']['contentSourceId']