当前位置:   article > 正文

我去图书馆-抢座助手_koqtftain241hm ""cdbveddajvj@9"252112345623456$"@d

koqtftain241hm ""cdbveddajvj@9"252112345623456$"@d

2019.07.22 文章已更新:

[igtl-again] 我去图书馆-抢座主逻辑详解-https://blog.csdn.net/RenjiaLu9527/article/details/96843605

写在前面

github项目地址

某天觉得这个 ’ 我去图书馆 ’ 图书馆定座系统体验很不好,抓包简单分析发现它的数据传输没有加密,于是尝试用py模拟手动抢座

正文##

就是个简单的 python借用requests模块,设置好headers、cookies,直接get就可以了。主要的py文件如下

RSmain.py

#!/usr/bin/python
# -*- coding: UTF-8 -*-
#@filename:RSmain.py
#@user: wheee/RenjiaLu
#@time:20180408
#@illustration:  reserve a seat 

import ConfigParser
import json
import time
import random
import os,sys
import requests
from datetime import date, datetime
reload(sys) 
sys.setdefaultencoding('utf-8')



#配置信息
# anum = int(time.mktime(time.strptime("2018-04-07 23:09:30", "%Y-%m-%d %H:%M:%S")  ))
# ymd_hms = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(1523113200))

FLG_AGAIN = "AGAIN"
FLG_NEXTSEAT = "NEXTSEAT"
CONFIG_NAME = "RSconf.ini"
#section标签为:[openIdConf_2018-04-08]

RUNTIME =  int(time.mktime(time.strptime(time.strftime('%Y-%m-%d',time.localtime(time.time())) \
			+" 20:00:00", "%Y-%m-%d %H:%M:%S")  ))   #"2018-03-05 11:39:19" 
READYTIME = RUNTIME - 30 #提前 0.5 分钟准备
delayTime = 10

mheaders =  {
'Host':	'wechat.v2.traceint.com',
'User-Agent':	'Mozilla/5.0 (Linux; Android 7.0; MI 5 Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/043909 Mobile Safari/537.36 MicroMessenger/6.6.5.1280(0x26060536) NetType/WIFI Language/zh_CN',
'Accept':	'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,image/wxpic,image/sharpp,image/apng,*/*;q=0.8',
'Accept-Encoding':	'gzip, deflate',
'Accept-Language':	'zh-CN,en-US;q=0.8'
}
mcookies = dict(FROM_TYPE="weixin" ,wechatSESS_ID="your_sessionid",
	Hm_lvt_7ecd21a13263a714793f376c18038a87="1521332626,1521734275",
	Hm_lpvt_7ecd21a13263a714793f376c18038a87=str(int(time.time())))

#=========
	
#类
class GlobalValue :

	#[座位标号:坐标],不同学校的座位表不同
	R1_SEATTABLE={
	#第一自习室座位编码 		252 个
	 '1':'39,20','10':'37,23','100':'7,21','101':'8,21','102':'10,21','103':'10,20','104':'8,20','105':'7,20','106':'5,20','107':'7,13','108':'8,12','109':'9,11','11':'36,23','110':'10,10','111':'11,9','112':'16,6','113':'16,8','114':'16,9','115':'16,11','116':'16,12','117':'16,14','118':'17,14','119':'17,12','12':'34,23','120':'17,11','121':'17,9','122':'17,8','123':'17,6','124':'19,6','125':'19,8','126':'19,9','127':'19,11','128':'19,12','129':'19,14','13':'34,24','130':'20,14','131':'20,12','132':'20,11','133':'20,9','134':'20,8','135':'20,6','136':'22,6','137':'22,8','138':'22,9','139':'22,11','14':'36,24','140':'22,12','141':'22,14','142':'23,14','143':'23,12','144':'23,11','145':'23,9','146':'23,8','147':'23,6','148':'25,6','149':'25,8','15':'37,24',&#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/307156
推荐阅读
相关标签
  

闽ICP备14008679号