[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
你这自动请求的频率有点高啊。

我开了有一会刚好数据库500错误了。不知道有没有关系。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 4# 老刘1号


    我用你的程序跑出一个,你的用户名下成功率没有+1啊。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

无脑暴力比较好写。
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on 2017-07-02 02:21:10
  4. @author: codegay
  5. python3 & 编辑器 == spyder
  6. """
  7. import requests
  8. apiurl = "http://bbaass.tk/math/"
  9. math = 50
  10. data = {
  11.         'send': 'Answer',
  12.         'username': 'codegay',
  13.         'math': math,
  14.         }
  15. session = requests.Session()
  16. while True:
  17.     for r in range(1, 101):
  18.         data['math'] = r
  19.         post = session.post(apiurl, data=data)
  20.         re = post.json()['re']
  21.         if re == '=':
  22.             break
复制代码
1

评分人数

去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 10# happy886rr


   有空来写一个看看。我不会写呢。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

程序是不是崩了。一直返回500
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 17# bbaa


    举手,我干过。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

以下是模仿了happy和ro的程序写的。经过几次修改,应该是能比较长时间持续运行了。
这个网站一言不合就返回500错误或者无规律清空数据,在刚开始很困扰,很懵B。

后来长时间运行发现,也有可能极小概率请求后返回404或者跳转到首页。所以也必须要在关键代码上处理错误。
→_→代码丑。但是管用。
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on 2017-07-02 13:57:56
  4. @author: codegay
  5. python3 & 编辑器 == spyder
  6. """
  7. import requests
  8. import time
  9. apiurl = "http://bbaass.tk/math/"
  10. s = 0
  11. username = "codegay"
  12. data = {
  13.         'send': 'Answer',
  14.         'username': username,
  15.         'math': 0,
  16.         }
  17. def reg(username="codegay"):
  18.     data = {"send": "reg", "username": username}
  19.     try:
  20.         requests.post(apiurl, data=data)
  21.     except:
  22.         global s
  23.         s += 1
  24.         print("reg程序江化,错误+1s")
  25.         time.sleep(2)
  26. def answer(min=0, max=100):
  27.     answering = True
  28.     answercounter = 0
  29.     token = ''
  30.     global s
  31.     while answering:
  32.         math = data['math'] = round((min+max)/2)
  33.         try:
  34.             time.sleep(0.3)
  35.             post = requests.post(apiurl, data=data, timeout=6)
  36.             print(post.text)
  37.         except Exception as err:
  38.             s += 1
  39.             print(err)
  40.             print("程序江化,错误+1s", "    错误总次数:", s)
  41.             time.sleep(1)
  42.         else:
  43.             answercounter += 1
  44.             print("数字:", math, "    counter:", answercounter)
  45.             re = ''
  46.             if post.status_code == 500:
  47.                 reg()
  48.                 time.sleep(1)
  49.             elif post.status_code == 200:
  50.                 try:
  51.                     result = post.json()
  52.                 except:
  53.                     answering = False
  54.                     continue
  55.                 re = result['re']
  56.                 if token and token != result['tokens']:
  57.                     answering = False
  58.                     continue
  59.                 token = result['tokens']
  60.                 if re == '=':
  61.                     answering = False
  62.                 if re == ">":
  63.                     max = data['math']
  64.                 if re == "<":
  65.                     min = data['math']
  66.             else:
  67.                 s += 1
  68.                 print("远程目标服务器程序江化,错误+1s")
  69.                 time.sleep(1)
  70. reg()
  71. while True:
  72.     answer()
复制代码
2

评分人数

去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 30# 523066680


    感觉是没有用,高频率请求对双方都有影响。
我不知道服务器是不是防火墙之类会检查高频率请求会封IP什么的。所以主动加了0.3秒的睡眠。
只要火力全开的应该都超过我。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 27# happy886rr


    主要还是懒。
但是只是能请求成功,对我来说不存在会拒绝这种事情。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

网站挂了,快修。
我我我还要测试我的程序。
1

评分人数

去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP


前几天网络出奇的好。忘记关程序,跑一晚上就有四千了。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

我发现我网络差,经常超时的情况下,似乎数据经常重置啊。

可能和服务器处理超时的异常有关?
能不能改进一下?
或者改用sqlite数据库?
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP


又重置。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 43# bbaa


    nim代码:
  1. for r in 1..319137:
  2.     for s in 1..319137:
  3.         if r * s == 319137:
  4.             echo r,"   ",s
复制代码
  1. 1   319137
  2. 3   106379
  3. 7   45591
  4. 13   24549
  5. 21   15197
  6. 39   8183
  7. 49   6513
  8. 91   3507
  9. 147   2171
  10. 167   1911
  11. 273   1169
  12. 501   637
  13. 637   501
  14. 1169   273
  15. 1911   167
  16. 2171   147
  17. 3507   91
  18. 6513   49
  19. 8183   39
  20. 15197   21
  21. 24549   13
  22. 45591   7
  23. 106379   3
复制代码
我不理解,这个数字有什么意义吗?
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

哦,理解了,这个才是真正的作弊之道啊。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

返回列表