Skip to content

Commit

Permalink
修复未指定编码导致代理池加载失败的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Hsury committed Mar 13, 2019
1 parent 0c06a4c commit 69dfe7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h1 align="center">- Bilibili Toolkit -</h1>

<p align="center">
<img src="https://img.shields.io/badge/version-2019.3.11-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/version-2019.3.13-green.svg?longCache=true&style=for-the-badge">
<img src="https://img.shields.io/badge/license-SATA-blue.svg?longCache=true&style=for-the-badge">
</p>

Expand Down
10 changes: 5 additions & 5 deletions bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
__author__ = "Hsury"
__email__ = "i@hsury.com"
__license__ = "SATA"
__version__ = "2019.3.11"
__version__ = "2019.3.13"

class Bilibili():
app_key = "1d8b6e7d45233436"
Expand Down Expand Up @@ -1157,7 +1157,7 @@ def delay_wrapper(func, interval, args_list=[()], shuffle=False):
if config['proxy']['enable']:
if isinstance(config['proxy']['pool'], str):
try:
with open(config['proxy']['pool'], "r") as f:
with open(config['proxy']['pool'], "r", encoding="utf-8") as f:
instance.set_proxy(add=[proxy for proxy in f.read().strip().splitlines() if proxy and proxy[0] != "#"])
except:
pass
Expand Down Expand Up @@ -1298,7 +1298,7 @@ def main():
print("直播助手组件不支持在当前平台上运行")
if live_tool_support:
try:
with open(os.path.join(live_tool_cwd, "commit"), "r") as f:
with open(os.path.join(live_tool_cwd, "commit"), "r", encoding="utf-8") as f:
live_tool_current_commit = f.read()
except:
live_tool_current_commit = None
Expand All @@ -1323,7 +1323,7 @@ def main():
'uid': account.get("DedeUserID", ""),
'refresh_token': account.get("refresh_token", ""),
})
with open(os.path.join(live_tool_cwd, "conf", "user.toml"), "w") as f:
with open(os.path.join(live_tool_cwd, "conf", "user.toml"), "w", encoding="utf-8") as f:
toml.dump(live_tool_user, f)
live_tool_ctrl = {
'print_control': {'danmu': config['live_tool']['print_danmaku']},
Expand All @@ -1345,7 +1345,7 @@ def main():
'area_ids': [1, 2, 3, 4, 5, 6],
},
}
with open(os.path.join(live_tool_cwd, "conf", "ctrl.toml"), "w") as f:
with open(os.path.join(live_tool_cwd, "conf", "ctrl.toml"), "w", encoding="utf-8") as f:
toml.dump(live_tool_ctrl, f)
try:
live_tool_process = subprocess.Popen([live_tool_exec], cwd=live_tool_cwd)
Expand Down

0 comments on commit 69dfe7d

Please sign in to comment.