New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix itchat bug on mac or not mac. #166
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1aa002b
feat: 增加支持将登录二维码开放出来的功能
mouyong dd7d3c3
fix itchat bug
mouyong 107604d
fix itchat bug
mouyong 36e0562
fix itchat bug
mouyong 6fccf02
fix itchat bug
mouyong 5989a45
fix itchat bug
mouyong 56f3f0d
fix error channel_type tips
mouyong 085b3b9
feat: allow http channel not set password to use chatgpt
mouyong 9b35082
fix: contfig-template.json format error
mouyong 068f7e4
feat: allow http nopassword
mouyong 0d7b5a5
fix: proxy fail on windows 11
mouyong dc9be52
fix: proxy fail on windows 11
mouyong b966e1a
feat: allow empty http password
mouyong fe22273
Merge branch 'master' into master
zhayujie File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
# @see https://stackoverflow.com/questions/30003570/how-to-use-gnu-sed-on-mac-os-10-10-brew-install-default-names-no-longer-su | ||
# @see https://www.cnblogs.com/fnlingnzb-learner/p/10657285.html | ||
cmd=sed | ||
if [ "$(uname)" == "Darwin" ];then | ||
brew install gnu-sed | ||
cmd=gsed | ||
fi | ||
|
||
echo "current sed command is: $cmd" | ||
|
||
echo "allow http nopasword" | ||
$cmd -i "s/\"http_auth_password\": \".*\"/\"http_auth_password\": \"\"/" config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"cookie": "YOUR COOKIE" | ||
}, | ||
"bing":{ | ||
"cookies":[] | ||
"cookies":[] | ||
} | ||
}, | ||
"channel": { | ||
|
@@ -28,6 +28,7 @@ | |
}, | ||
|
||
"wechat": { | ||
"receive_qrcode_api": "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个参数正常应该填什么值 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 一个 api 地址。例如 http://example.com/api/save-qrcode 然后网页端的其他页面再去读取,渲染成 二维码。 |
||
}, | ||
|
||
"wechat_mp": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
# @see https://stackoverflow.com/questions/30003570/how-to-use-gnu-sed-on-mac-os-10-10-brew-install-default-names-no-longer-su | ||
# @see https://www.cnblogs.com/fnlingnzb-learner/p/10657285.html | ||
cmd=sed | ||
if [ "$(uname)" == "Darwin" ];then | ||
brew install gnu-sed | ||
cmd=gsed | ||
fi | ||
|
||
echo "current sed command is: $cmd" | ||
|
||
pack_dir="$(pip3 show itchat-uos | grep "Location" | awk '{print $2}')" | ||
file_name="${pack_dir}/itchat/components/login.py" | ||
|
||
sleep15Code="time.sleep(15)" | ||
|
||
cat $file_name | grep $sleep15Code | ||
|
||
if [ "$?" != "0" ];then | ||
echo "fix $sleep15Code" | ||
$cmd -i "/while not isLoggedIn/i\ $sleep15Code" $file_name | ||
else | ||
echo "already fix $sleep15Code" | ||
fi | ||
|
||
sleep3Code="time.sleep(3)" | ||
|
||
cat $file_name | grep $sleep3Code | ||
|
||
if [ "$?" != "0" ];then | ||
echo "fix $sleep3Code" | ||
$cmd -i "s/elif status != '408'/elif status in ['408', '400']/" $file_name | ||
$cmd -i "/if isLoggedIn:/i\ time.sleep(3)" $file_name | ||
else | ||
echo "already fix $sleep3Code" | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里设置成全局代理会不会影响 wx 的连接
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不影响。
不加的时候。直接会导致无法请求 openai。