mirror of
https://github.com/gfwlist/gfwlist.git
synced 2024-12-24 15:45:19 +00:00
don't need to decode here
This commit is contained in:
parent
febfb972fa
commit
41ad090ebf
@ -43,11 +43,6 @@ expect = {IP: 28, TLS: 35, URL: 56, INVALID: 0}
|
|||||||
def getUrl(rule):
|
def getUrl(rule):
|
||||||
global offset
|
global offset
|
||||||
|
|
||||||
rule = unquote(rule.encode())
|
|
||||||
try:
|
|
||||||
rule = rule.decode('utf-8', 'strict')
|
|
||||||
except UnicodeDecodeError:
|
|
||||||
rule = rule.decode('gbk', 'ignore')
|
|
||||||
if rule.startswith('||'): return ('http://' + rule[2:], IP)
|
if rule.startswith('||'): return ('http://' + rule[2:], IP)
|
||||||
if rule.startswith('|https'): return (rule[1:], TLS)
|
if rule.startswith('|https'): return (rule[1:], TLS)
|
||||||
if rule.startswith('|http://'):
|
if rule.startswith('|http://'):
|
||||||
|
Loading…
Reference in New Issue
Block a user