mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
get the complete content
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1707 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
33f218d9a2
commit
b1708fc725
1 changed files with 3 additions and 4 deletions
|
|
@ -31,8 +31,7 @@ from linkcheck.i18n import _
|
|||
contents = {
|
||||
"html": re.compile(r'(?i)<html>.*</html>'),
|
||||
"opera" : re.compile(r'Opera Hotlist'),
|
||||
# XXX TODO
|
||||
# "text" : re.compile(r'(?i)# LinkChecker URL list'),
|
||||
"text" : re.compile(r'(?i)# LinkChecker URL list'),
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -115,7 +114,7 @@ class FileUrl (urlbase.UrlBase):
|
|||
def is_html (self):
|
||||
if linkcheck.checker.extensions['html'].search(self.url):
|
||||
return True
|
||||
if contents['html'].search(self.get_content()[:20]):
|
||||
if contents['html'].search(self.get_content()):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
@ -139,7 +138,7 @@ class FileUrl (urlbase.UrlBase):
|
|||
# try to read content (can fail, so catch error)
|
||||
try:
|
||||
for ro in contents.values():
|
||||
if ro.search(self.get_content()[:20]):
|
||||
if ro.search(self.get_content()):
|
||||
return True
|
||||
except IOError:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue