/t/232710 这个没用正则且需要手动改帐号
这个版本实现正则+自动获取帐号
一个能帮助北京联通光纤用户利用沃宽提速到 100M 的脚本 /可执行文件。
执行 python 脚本 ( speedy.py for python2; speedy3.py for python3)
Windows 用户可以执行 speedy.exe
For Python2
import urllib2
import urllib
import datetime
import time
import re
import os
ContentID = urllib2.urlopen('http://bj.wokuan.cn/web/startenrequest.php').read()
ID = "".join(re.findall(r"cn=(\d*)",ContentID))
Content = urllib2.urlopen('http://bj.wokuan.cn/phoneservice/get_server_time.php').read()
YR = int("".join(re.findall(r"\"(\d*)-",Content)))
MTH = int("".join(re.findall(r"-(\d*)-",Content)))
D= int("".join(re.findall(r"-(\d*) ",Content)))
HR = int("".join(re.findall(r" (\d*):",Content)))
MIN = int("".join(re.findall(r":(\d*):",Content)))
SEC = int("".join(re.findall(r":(\d*)\"",Content)))
s = datetime.datetime(YR,MTH,D,HR,MIN,SEC)
TM = str(int(time.mktime(s.timetuple()))*1000)
data = {}
data['device'] = 'Android Phone'
data['devicename'] = 'Android Phone'
data['reqtime'] = TM
data['paras'] = '{"device":"Android Phone","devicename":"Android Phone","reqtime":"'+TM+'","upspeedcode":"09","oldspeedcode":"01","adslaccount":"'+ID+'","accetime":"300000.0","sv":"is"}'
data['accetime'] = '300000.0'
post_data = urllib.urlencode(data)
url = 'http://bj.wokuan.cn/phoneservice/mobile_improvespeed.php'
req = urllib2.urlopen(url, post_data)
res = req.read()
print("".join(re.findall(r":\"(.*)\",\"",res)))
print("Press Enter to exit.")
raw_input()
For Python3
import urllib.request
import urllib.parse
import urllib
import datetime
import time
import re
ContentID = urllib.request.urlopen('http://bj.wokuan.cn/web/startenrequest.php').read().decode('utf-8')
ID = "".join(re.findall(r"cn=(\d*)",ContentID))
Content = urllib.request.urlopen('http://bj.wokuan.cn/phoneservice/get_server_time.php').read().decode('utf-8')
YR = int("".join(re.findall(r"\"(\d*)-",Content)))
MTH = int("".join(re.findall(r"-(\d*)-",Content)))
D= int("".join(re.findall(r"-(\d*) ",Content)))
HR = int("".join(re.findall(r" (\d*):",Content)))
MIN = int("".join(re.findall(r":(\d*):",Content)))
SEC = int("".join(re.findall(r":(\d*)\"",Content)))
s = datetime.datetime(YR,MTH,D,HR,MIN,SEC)
TM = str(int(time.mktime(s.timetuple()))*1000)
data = {}
data['device'] = 'Android Phone'
data['devicename'] = 'Android Phone'
data['reqtime'] = TM
data['paras'] = '{"device":"Android Phone","devicename":"Android Phone","reqtime":"'+TM+'","upspeedcode":"09","oldspeedcode":"01","adslaccount":"'+ID+'","accetime":"300000.0","sv":"is"}'
data['accetime'] = '300000.0'
post_data = urllib.parse.urlencode(data).encode(encoding='UTF8')
url = 'http://bj.wokuan.cn/phoneservice/mobile_improvespeed.php'
req = urllib.request.urlopen(url, post_data)
res = req.read().decode('utf-8')
print(res)
http://pan.baidu.com/s/1o69w23C
efae
Q :为啥不用 Github 等?
A :懒
Q :有 Bug 么?能用么?
A :不保证
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.