Update gfw-pac.py

fixed the missing gfwlist rule that base64 decode fail
This commit is contained in:
juneszh
2020-07-07 14:57:27 +08:00
committed by GitHub
parent 09e22aedf5
commit d407973450

View File

@@ -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