1 Star 0 Fork 0

Gentlesprite/scitc-auto-linker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
resq.py 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
LZY/我不是盘神 提交于 2023-09-25 23:41 . 处理网络请求配置
# coding=UTF-8
# Author:LZY/我不是盘神
# Software:PyCharm
# Time:2023/4/1 20:43:42
# File:resq.py
import socket
class Url:
@staticmethod
def url_login():
url_login = 'http://10.10.11.14/portal.do?wlanuserip=' + \
Get_ip.get_host_ip() + '&wlanacname=XF_BRAS'
return url_login
@staticmethod
def url_logout():
url_logout = 'http://10.10.11.14/webdisconn.do?wlanuserip=' + \
Get_ip.get_host_ip() + '&wlanacname=XF_BRAS'
return url_logout
class Headers:
@staticmethod
def headers_pc():
headers_pc = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.9999.0 Safari/537.36"}
return headers_pc
@staticmethod
def headers_phone():
headers_phone = {
"User-Agent": "Mozilla/5.0 (Linux; Android 12; CPH2199) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36"}
return headers_phone
class Get_ip:
@staticmethod
def get_host_ip():
global get_host_way
try:
get_host_way = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
get_host_way.connect(('8.8.8.8', 80))
host_ip = get_host_way.getsockname()[0]
finally:
get_host_way.close()
return host_ip
@staticmethod
def get_local_ip():
local_ip = socket.gethostbyname(socket.gethostname())
return local_ip
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Gentlesprite/scitc-auto-linker.git
[email protected]:Gentlesprite/scitc-auto-linker.git
Gentlesprite
scitc-auto-linker
scitc-auto-linker
master

搜索帮助