projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3ccd6b
)
[generic] Do not follow redirects to the same URL
author
Sergey M․
<dstftw@gmail.com>
Thu, 23 Mar 2017 17:45:24 +0000
(
00:45
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 23 Mar 2017 17:45:24 +0000
(
00:45
+0700)
youtube_dl/extractor/generic.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/generic.py
b/youtube_dl/extractor/generic.py
index cb6308d29e16989b46c2a2036f610f5e9083eb53..da9d04efc3ad22ab9ef66d26b2e903c39ded94c4 100644
(file)
--- a/
youtube_dl/extractor/generic.py
+++ b/
youtube_dl/extractor/generic.py
@@
-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