mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Try favicon.ico if there's a HTMLParseError
This commit is contained in:
parent
fce16ba51f
commit
815a71fe8b
1 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from HTMLParser import HTMLParser
|
from HTMLParser import HTMLParser, HTMLParseError
|
||||||
from urlparse import urljoin, urlparse
|
from urlparse import urljoin, urlparse
|
||||||
from tempfile import mkstemp
|
from tempfile import mkstemp
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ class TrackerIcons(Component):
|
||||||
callbackArgs=(host,), errbackArgs=(host,))
|
callbackArgs=(host,), errbackArgs=(host,))
|
||||||
elif f.check(error.NoResource, error.ForbiddenResource) and icons:
|
elif f.check(error.NoResource, error.ForbiddenResource) and icons:
|
||||||
d = self.download_icon(icons, host)
|
d = self.download_icon(icons, host)
|
||||||
elif f.check(IndexError):
|
elif f.check(IndexError, HTMLParseError):
|
||||||
# No icons, try favicon.ico as an act of desperation
|
# No icons, try favicon.ico as an act of desperation
|
||||||
d = self.download_icon([(urljoin(host_to_url(host), "favicon.ico"), extension_to_mimetype("ico"))], host)
|
d = self.download_icon([(urljoin(host_to_url(host), "favicon.ico"), extension_to_mimetype("ico"))], host)
|
||||||
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…
Add table
Add a link
Reference in a new issue