[ie/mtv] Fix geoblock bypass for mtv.it and mtv.de

This commit is contained in:
Adam Malcontenti-Wilson 2024-01-09 21:25:37 +11:00
parent fc5e46d2a5
commit 2c0c042e75
1 changed files with 12 additions and 0 deletions

View File

@ -522,6 +522,12 @@ class MTVDEIE(MTVServicesInfoExtractor):
'mgid': uri,
}
def _extract_mgid(self, webpage):
mgid = super()._extract_mgid(webpage)
# if accessing outside of geo-restrictions, mgid will contain invalid mtv.intl domain instead of correct mtv.de domain
if mgid:
return mgid.replace('mtv.intl', 'mtv.de')
class MTVItaliaIE(MTVServicesInfoExtractor):
IE_NAME = 'mtv.it'
@ -550,6 +556,12 @@ class MTVItaliaIE(MTVServicesInfoExtractor):
'mgid': uri,
}
def _extract_mgid(self, webpage):
mgid = super()._extract_mgid(webpage)
# if accessing outside of geo-restrictions, mgid will contain invalid mtv.intl domain instead of correct mtv.it domain
if mgid:
return mgid.replace('mtv.intl', 'mtv.it')
class MTVItaliaProgrammaIE(MTVItaliaIE): # XXX: Do not subclass from concrete IE
IE_NAME = 'mtv.it:programma'