mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-03 19:17:06 -05:00 
			
		
		
		
	[pbs] Improve geo restriction detection and use geo bypass mechanism
This commit is contained in:
		@@ -489,11 +489,12 @@ class PBSIE(InfoExtractor):
 | 
			
		||||
                headers=self.geo_verification_headers())
 | 
			
		||||
 | 
			
		||||
            if redirect_info['status'] == 'error':
 | 
			
		||||
                message = self._ERRORS.get(
 | 
			
		||||
                    redirect_info['http_code'], redirect_info['message'])
 | 
			
		||||
                if redirect_info['http_code'] == 403:
 | 
			
		||||
                    self.raise_geo_restricted(msg=message, countries=['US'])
 | 
			
		||||
                raise ExtractorError(
 | 
			
		||||
                    '%s said: %s' % (
 | 
			
		||||
                        self.IE_NAME,
 | 
			
		||||
                        self._ERRORS.get(redirect_info['http_code'], redirect_info['message'])),
 | 
			
		||||
                    expected=True)
 | 
			
		||||
                    '%s said: %s' % (self.IE_NAME, message), expected=True)
 | 
			
		||||
 | 
			
		||||
            format_url = redirect_info.get('url')
 | 
			
		||||
            if not format_url:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user