fix
parent
33322cc472
commit
8458017498
|
@ -75,7 +75,7 @@ class proxy:
|
||||||
for i in lins:
|
for i in lins:
|
||||||
p = i.strip("\n")
|
p = i.strip("\n")
|
||||||
self.proxy_filter_list.append(p)
|
self.proxy_filter_list.append(p)
|
||||||
except TypeError:
|
except Exception:
|
||||||
with open(path, "r", ) as f:
|
with open(path, "r", ) as f:
|
||||||
lins = f.readlines()
|
lins = f.readlines()
|
||||||
for i in lins:
|
for i in lins:
|
||||||
|
|
|
@ -74,7 +74,7 @@ class CDNProxy:
|
||||||
if i and "kyfw.12306.cn:443" not in i:
|
if i and "kyfw.12306.cn:443" not in i:
|
||||||
cdn.append(i.replace("\n", ""))
|
cdn.append(i.replace("\n", ""))
|
||||||
return cdn
|
return cdn
|
||||||
except TypeError:
|
except Exception:
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
for i in f.readlines():
|
for i in f.readlines():
|
||||||
# print(i.replace("\n", ""))
|
# print(i.replace("\n", ""))
|
||||||
|
|
|
@ -15,7 +15,7 @@ def _get_yaml():
|
||||||
try: # 兼容2和3版本
|
try: # 兼容2和3版本
|
||||||
with open(path, encoding="utf-8") as f:
|
with open(path, encoding="utf-8") as f:
|
||||||
s = yaml.load(f)
|
s = yaml.load(f)
|
||||||
except TypeError:
|
except Exception:
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
s = yaml.load(f)
|
s = yaml.load(f)
|
||||||
return s.decode() if isinstance(s, bytes) else s
|
return s.decode() if isinstance(s, bytes) else s
|
||||||
|
|
|
@ -140,7 +140,7 @@ class select:
|
||||||
try:
|
try:
|
||||||
with open(path, encoding="utf-8") as result:
|
with open(path, encoding="utf-8") as result:
|
||||||
info = result.read().split('=')[1].strip("'").split('@')
|
info = result.read().split('=')[1].strip("'").split('@')
|
||||||
except TypeError:
|
except Exception:
|
||||||
with open(path) as result:
|
with open(path) as result:
|
||||||
info = result.read().split('=')[1].strip("'").split('@')
|
info = result.read().split('=')[1].strip("'").split('@')
|
||||||
del info[0]
|
del info[0]
|
||||||
|
|
|
@ -29,7 +29,7 @@ def getPassCodeNewOrderAndLogin(session, imgType):
|
||||||
try:
|
try:
|
||||||
with open(img_path, 'wb', encoding="utf-8") as img:
|
with open(img_path, 'wb', encoding="utf-8") as img:
|
||||||
img.write(result)
|
img.write(result)
|
||||||
except TypeError:
|
except Exception:
|
||||||
with open(img_path, 'wb') as img:
|
with open(img_path, 'wb') as img:
|
||||||
img.write(result)
|
img.write(result)
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue