From d4079734503896145aeebfbd8a8085cfb486402b Mon Sep 17 00:00:00 2001 From: juneszh Date: Tue, 7 Jul 2020 14:57:27 +0800 Subject: [PATCH] Update gfw-pac.py fixed the missing gfwlist rule that base64 decode fail --- gfw-pac.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gfw-pac.py b/gfw-pac.py index 1b54332..63d0e1f 100755 --- a/gfw-pac.py +++ b/gfw-pac.py @@ -11,6 +11,7 @@ import json import logging import urllib.request, urllib.error, urllib.parse from argparse import ArgumentParser +import base64 gfwlist_url = 'https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt' @@ -104,7 +105,7 @@ def decode_gfwlist(content): try: if '.' in content: raise Exception() - return content.decode('base64') + return base64.b64decode(content).decode('utf-8') except: return content