Fix tracker_icons not handling relative redirects
This commit is contained in:
parent
d6c8b13041
commit
53a9c217e7
|
@ -235,7 +235,7 @@ class TrackerIcons(Component):
|
||||||
d = f
|
d = f
|
||||||
if f.check(error.PageRedirect):
|
if f.check(error.PageRedirect):
|
||||||
# Handle redirect errors
|
# Handle redirect errors
|
||||||
location = error_msg.split(" to ")[1]
|
location = urljoin(host_to_url(host), error_msg.split(" to ")[1])
|
||||||
d = self.download_page(host, url=location)
|
d = self.download_page(host, url=location)
|
||||||
d.addCallbacks(self.on_download_page_complete, self.on_download_page_fail,
|
d.addCallbacks(self.on_download_page_complete, self.on_download_page_fail,
|
||||||
errbackArgs=(host,))
|
errbackArgs=(host,))
|
||||||
|
@ -345,7 +345,7 @@ class TrackerIcons(Component):
|
||||||
d = f
|
d = f
|
||||||
if f.check(error.PageRedirect):
|
if f.check(error.PageRedirect):
|
||||||
# Handle redirect errors
|
# Handle redirect errors
|
||||||
location = error_msg.split(" to ")[1]
|
location = urljoin(host_to_url(host), error_msg.split(" to ")[1])
|
||||||
d = self.download_icon([(location, extension_to_mimetype(location.rpartition('.')[2]))] + icons, host)
|
d = self.download_icon([(location, extension_to_mimetype(location.rpartition('.')[2]))] + icons, host)
|
||||||
if not icons:
|
if not icons:
|
||||||
d.addCallbacks(self.on_download_icon_complete, self.on_download_icon_fail,
|
d.addCallbacks(self.on_download_icon_complete, self.on_download_icon_fail,
|
||||||
|
|
Loading…
Reference in New Issue