Update gfw-pac.py
fixed the missing gfwlist rule that base64 decode fail
This commit is contained in:
@@ -11,6 +11,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import urllib.request, urllib.error, urllib.parse
|
import urllib.request, urllib.error, urllib.parse
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
import base64
|
||||||
|
|
||||||
gfwlist_url = 'https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt'
|
gfwlist_url = 'https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt'
|
||||||
|
|
||||||
@@ -104,7 +105,7 @@ def decode_gfwlist(content):
|
|||||||
try:
|
try:
|
||||||
if '.' in content:
|
if '.' in content:
|
||||||
raise Exception()
|
raise Exception()
|
||||||
return content.decode('base64')
|
return base64.b64decode(content).decode('utf-8')
|
||||||
except:
|
except:
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user