Skip to content
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

登录失败 3.8.0版本 termux安卓手机 #107

Open
zhiting9420 opened this issue Aug 4, 2021 · 16 comments
Open

登录失败 3.8.0版本 termux安卓手机 #107

zhiting9420 opened this issue Aug 4, 2021 · 16 comments
Labels
documentation Improvements or additions to documentation

Comments

@zhiting9420
Copy link

错误代码: -1, 消息: 网络请求失败, Post https://wappass.baidu.com/wp/api/login: lookup wappass.baidu.com on [::1]:53: read udp [::1]:50321->[::1]:53: read: connection refused
Uploading Screenshot_20210804_164554.jpg…

@qjfoidnh
Copy link
Owner

qjfoidnh commented Aug 4, 2021

老问题了,安卓平台上出现dns错误,目前没有完善的解决方案,有人换流量发现可以了

@zhiting9420
Copy link
Author

好吧,非常不稳定,谢谢

@pongfcnkl
Copy link

参考 #3
我帮你编译了安卓arm和arm64的二进制文件
https://we.tl/t-xut5L3QA89

@zhiting9420
Copy link
Author

成功了!非常感谢大神👍

@zhiting9420
Copy link
Author

zhiting9420 commented Aug 10, 2021 via email

@zhiting9420
Copy link
Author

zhiting9420 commented Aug 10, 2021 via email

@xiaoyaofenfen
Copy link

参考 #3
我帮你编译了安卓arm和arm64的二进制文件
https://we.tl/t-xut5L3QA89

能够帮忙发下你编译的环境吗?是那个系统版本,go版本是多少呀,android ndk 是那个版本?

@pongfcnkl
Copy link

pongfcnkl commented Aug 23, 2021

参考 #3
我帮你编译了安卓arm和arm64的二进制文件
https://we.tl/t-xut5L3QA89

能够帮忙发下你编译的环境吗?是那个系统版本,go版本是多少呀,android ndk 是那个版本?

这个原作者有教程,我是研究了一个礼拜才搞懂的,版本都是最新的

https://web.archive.org/web/20190830041727/http://www.iikira.com/2017/08/09/golang-compile-jc-2/
简单来说就是下载Android-ndk,设置一下环境变量,然后安装 CC 编译器,推荐第二步的python安装,最后第三部的命令输一下二进制程序就出来了
如果有proxy的报错就输一下这条命令
export GOPROXY=https://goproxy.io

@xiaoyaofenfen
Copy link

参考 #3
我帮你编译了安卓arm和arm64的二进制文件
https://we.tl/t-xut5L3QA89

能够帮忙发下你编译的环境吗?是那个系统版本,go版本是多少呀,android ndk 是那个版本?

这个原作者有教程,我是研究了一个礼拜才搞懂的,版本都是最新的

https://web.archive.org/web/20190830041727/http://www.iikira.com/2017/08/09/golang-compile-jc-2/
简单来说就是下载Android-ndk,设置一下环境变量,然后安装 CC 编译器,推荐第二步的python安装,最后第三部的命令输一下二进制程序就出来了
如果有proxy的报错就输一下这条命令
export GOPROXY=https://goproxy.io

我在ubuntu上试了一下,好像不行,有报错,有没有经验可分享?

runtime/cgo

gcc_android.c:6:10: fatal error: android/log.h: No such file or directory
#include <android/log.h>
^~~~~~~~~~~~~~~
compilation terminated.

@pongfcnkl
Copy link

参考 #3
我帮你编译了安卓arm和arm64的二进制文件
https://we.tl/t-xut5L3QA89

能够帮忙发下你编译的环境吗?是那个系统版本,go版本是多少呀,android ndk 是那个版本?

这个原作者有教程,我是研究了一个礼拜才搞懂的,版本都是最新的
https://web.archive.org/web/20190830041727/http://www.iikira.com/2017/08/09/golang-compile-jc-2/
简单来说就是下载Android-ndk,设置一下环境变量,然后安装 CC 编译器,推荐第二步的python安装,最后第三部的命令输一下二进制程序就出来了
如果有proxy的报错就输一下这条命令
export GOPROXY=https://goproxy.io

我在ubuntu上试了一下,好像不行,有报错,有没有经验可分享?

runtime/cgo

gcc_android.c:6:10: fatal error: android/log.h: No such file or directory
#include <android/log.h>
^~~~~~~~~~~~~~~
compilation terminated.

可以试试用虚拟机新装一个ubuntu系统在试试?
其实可以直接在手机上用termux编译的,方法和Linux一样

@qjfoidnh qjfoidnh added the documentation Improvements or additions to documentation label Dec 28, 2021
@swift-lee
Copy link

swift-lee commented May 7, 2022

老问题了,安卓平台上出现dns错误,目前没有完善的解决方案,有人换流量发现可以了

termux里加了个http代理从clash for android里绕了一圈,问题就消失了。虽然也不是不能用,但是还是希望大佬能以这个为突破点研究一下😂
#87 (comment)
提到的帖子没了,不过termux确实是缺少这个文件,可惜termux没root不让动/etc

@rhjdvsgsgks
Copy link

rhjdvsgsgks commented Jul 12, 2022

你们这思路就不对,dns 问题实际上是因为编译时没开 cgo 导致 LD_PRELOAD 里的 libtermux-exec.so 没有成功把 /etc/resolv.conf 劫持到 $PREFIX/etc/resolv.conf (也就是 /data/data/com.termux/files/usr/etc/resolv.conf ),对于本程序来说 resolv.conf 不存在,根本就没有设置 dns 服务器,所以才会尝试使用 127.0.0.1 或 ::1

@rhjdvsgsgks
Copy link

急着用可以来我库里的 action 里下载,有更新了可以自己 fork 后 pull 下,我不管了

@ametoyuki098
Copy link

用termux到下载baidupcs-go 出现notfound

@guyueshui
Copy link

扒了扒和termux相关的issue,总结一下。

有两种方式编译android版本的baidupcs

  1. termux直接配好go环境,直接编译
  2. 电脑上下载androind ndk,指定编译架构后编译

我最后使用第一个方案成功。第二个虽然编译成功,放到termux里面运行还是会报dns的问题。最后work的编译命令行

GOOS=android GOARCH=arm64 CGO_ENABLE=1 go build  

如果下载依赖过慢,设置一下GOPROXY环境变量,

$ go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
$ go env | grep GOPROX
GOPROXY='https://mirrors.aliyun.com/goproxy/,direct'

[!tip] 关于登录百度账号
建议直接使用bduss的方式登录,

./BaiduPCS-GO login -bduss <your_bduss_string>

账号密码貌似登录不上。bduss获取方式为,打开浏览器,登录pan.baidu.com,查看cookie,找到bduss对应的value即可。

参考

@ametoyuki098
Copy link

扒了扒和termux相关的issue,总结一下。

有两种方式编译android版本的baidupcs

  1. termux直接配好go环境,直接编译

  2. 电脑上下载androind ndk,指定编译架构后编译

我最后使用第一个方案成功。第二个虽然编译成功,放到termux里面运行还是会报dns的问题。最后work的编译命令行

GOOS=android GOARCH=arm64 CGO_ENABLE=1 go build  

如果下载依赖过慢,设置一下GOPROXY环境变量,

$ go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct

$ go env | grep GOPROX

GOPROXY='https://mirrors.aliyun.com/goproxy/,direct'

[!tip] 关于登录百度账号

建议直接使用bduss的方式登录,

./BaiduPCS-GO login -bduss <your_bduss_string>

账号密码貌似登录不上。bduss获取方式为,打开浏览器,登录pan.baidu.com,查看cookie,找到bduss对应的value即可。

参考

谢谢。我也使用第一种方式成功了。账号和cookie好像都不能登录成功

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

8 participants