[generic] Do not follow redirects to the same URL

pull/8/head
Sergey M․ 2017-03-24 00:45:24 +07:00
rodzic a3ccd6bd11
commit 54b960f340
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 2C393E0F18A9236D
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -2635,11 +2635,14 @@ class GenericIE(InfoExtractor):
found = re.search(REDIRECT_REGEX, refresh_header)
if found:
new_url = compat_urlparse.urljoin(url, unescapeHTML(found.group(1)))
self.report_following_redirect(new_url)
return {
'_type': 'url',
'url': new_url,
}
if new_url != url:
self.report_following_redirect(new_url)
return {
'_type': 'url',
'url': new_url,
}
else:
found = None
if not found:
# twitter:player is a https URL to iframe player that may or may not