whymustihaveaname / tsinghuatunet Goto Github PK
View Code? Open in Web Editor NEWTsinghua Tunet auto-connect script. 清华校园网自动连接脚本.
Tsinghua Tunet auto-connect script. 清华校园网自动连接脚本.
使用非清华DNS服务器且没有连接网关时,会无法解析 net.tsinghua.edu.cn 和 auth4.tsinghua.edu.cn,应当添加静态IP选项,但又不知道网关服务器的IP会不会经常改变。
现在 IPV6 还有小问题,但是由于宿舍没有 Tsinghua-IPv6 所以开发有些困难。分支 ipv6 存放着 beta 代码。
很多设备都有多张网卡,这应当予以支持
The encoding webpage returned is "ISO-8859-1", but actually "GBK" should be used to decode it.
To the one who takes responsibility for the login webpage: "FUCK YOU!"
有时候 net 失败但是 auth4 成功,当初以为这俩是等价的,现在看来不是,应当互为备份。
使用威联通NAS通过SSH命令行联网出现了一些报错,已经配置好了python3环境及依赖包,求解。log如下:
[admin@NAS00B282-WDM 001]# python3 connect.py --test-first
22/10/04 13:21:14 954 [INFO,test_network:225] getting: http://github.com
22/10/04 13:21:14 965 [INFO,test_and_reconnent:247] not online, reconnecting... reason: HTTPConnectionPool(host='github.com', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7517d9d0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
22/10/04 13:21:14 966 [INFO,net_login:196] posting: http://net.tsinghua.edu.cn/do_login.php
22/10/04 13:21:14 972 [WARNING,net_login:202] error happened: HTTPConnectionPool(host='net.tsinghua.edu.cn', port=80): Max retries exceeded with url: /do_login.php (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7517ddf0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
[admin@NAS00B282-WDM 001]# python3 connect.py --connect-auth4
22/10/04 13:21:40 861 [ERROR,auth_login:134] get challenge failed:
Traceback (most recent call last):
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect
self.sock = conn = self._new_conn()
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x750e1ac0>: Failed to establish a new connection: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='auth4.tsinghua.edu.cn', port=443): Max retries exceeded with url: /cgi-bin/get_challenge?callback=callback&username=$我的账号$&ip=&double_stack=1&=1664860900849 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x750e1ac0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/share/CACHEDEV1_DATA/homes/admin/001/connect.py", line 126, in auth_login
g1=requests.get(url,headers=headers,params=params,timeout=TIMEOUT)
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/share/CACHEDEV1_DATA/.qpkg/Python3/python3/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='auth4.tsinghua.edu.cn', port=443): Max retries exceeded with url: /cgi-bin/get_challenge?callback=callback&username=$我的账号$&ip=&double_stack=1&_=1664860900849 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x750e1ac0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
经常会报以下错误,似乎在清华校内都连不上清华的网,不知如何解决
./connect.py --connect
[INFO,net_login:37] posting: https://net.tsinghua.edu.cn/do_login.php
[WARNING,net_login:44] error happened: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.