top level domains can have 1 to 24 characters.
This commit is contained in:
parent
809e6d155a
commit
d521460bdc
13
buku.py
13
buku.py
@ -1332,8 +1332,10 @@ def is_bad_url(url):
|
||||
if not netloc:
|
||||
return True
|
||||
|
||||
# netloc cannot start with a '.'
|
||||
if netloc.startswith('.'):
|
||||
logger.debug('netloc: %s' % netloc)
|
||||
|
||||
# netloc cannot start or end with a '.'
|
||||
if netloc.startswith('.') or netloc.endswith('.'):
|
||||
return True
|
||||
|
||||
# netloc should have at least one '.'
|
||||
@ -1341,12 +1343,7 @@ def is_bad_url(url):
|
||||
if index < 0:
|
||||
return True
|
||||
|
||||
# '.' can be followed by 3 chars at most
|
||||
revindex = len(netloc) - 1 - index
|
||||
if revindex > 0 and revindex < 4:
|
||||
return False
|
||||
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_ignored_mime(url):
|
||||
|
Loading…
x
Reference in New Issue
Block a user