mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[generic] Do not follow redirects to the same URL
This commit is contained in:
		@@ -2635,11 +2635,14 @@ class GenericIE(InfoExtractor):
 | 
				
			|||||||
                    found = re.search(REDIRECT_REGEX, refresh_header)
 | 
					                    found = re.search(REDIRECT_REGEX, refresh_header)
 | 
				
			||||||
            if found:
 | 
					            if found:
 | 
				
			||||||
                new_url = compat_urlparse.urljoin(url, unescapeHTML(found.group(1)))
 | 
					                new_url = compat_urlparse.urljoin(url, unescapeHTML(found.group(1)))
 | 
				
			||||||
                self.report_following_redirect(new_url)
 | 
					                if new_url != url:
 | 
				
			||||||
                return {
 | 
					                    self.report_following_redirect(new_url)
 | 
				
			||||||
                    '_type': 'url',
 | 
					                    return {
 | 
				
			||||||
                    'url': new_url,
 | 
					                        '_type': 'url',
 | 
				
			||||||
                }
 | 
					                        'url': new_url,
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                else:
 | 
				
			||||||
 | 
					                    found = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not found:
 | 
					        if not found:
 | 
				
			||||||
            # twitter:player is a https URL to iframe player that may or may not
 | 
					            # twitter:player is a https URL to iframe player that may or may not
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user