快乐的小萌新 发表于 2022-1-11 08:59

京东Nian的鞭炮收集


重新学了下抓包和requests,刚好京东的活动来了。就是技术很菜,只能做出来这样需要的可以在青龙面板上新建导入,每个小时执行一次就可以了鞭炮再小也是肉有没有大佬能解答京东的火爆咋个处理呢?
import requests
import re

class jd:

    list = ["pt_key=XXX;pt_pin=XXX",]#这里输入cookie,有几个输入几个

    # 获取一些post需要的数据数据
    def home(self):
      data = {
            "functionId": "tigernian_getHomeData",
            "body": {},
            "client": "wh5",
            "clientVersion": "1.0.0",
      }
      response = requests.post("https://api.m.jd.com/client.action?functionId=tigernian_getHomeData",
                                 headers=self.header, data=data)
      patter = 'secretp":"(.*?)"'
      secretp = re.compile(patter).findall(response.text)
      # print(secretp)
      print(response.text)
      # 签到获取鞭炮
      self.nian_collect(secretp)
      # 互助的,能抓包,互助就是火爆
      # self.nian_help(secretp)

    # 签到获取鞭炮
    def nian_collect(self, secretp):
      collectAutoScore_data = {
            "functionId": "tigernian_collectAutoScore",
            "body": {
                "{\"ss\":\"{\\\"extraData\\\":{\\\"log\\\":\\\"1641776236526~1HfBfnuLKDbMDFxUElPczAxMQ==.QGZ9fkRGZnt+RkNofjEBQGMaejhCJQZ5DUB8fmNKXWE3fQ1ALj0MJxwBJh0HJgAidychBzw8HBw4DCwiDw==.e3c4d89b~9,1~067984678BCB81FC2ABBEF2B397F0F18BB8358AF~1yk8ncv~C~ThFBWhINbD4eFRVeWRQKbhVVBh8GZhl1dht5T0cbFRIYFFQAGgQCHgxqGXYADxsCHkNDHBZSBxgCBBsLbB90BHcbVk9GFTwcFlFCWxULBR4XQEYVChUGVQYGVgcCBAIEBAcCBgIBDRUcFUAGVhVbEkBCREFRV0JUFx8XQFVWFVkQUQdEQENEQFYTGxBFV1sVCmwOTwEDWBwGGgMZBB0GbxkRX10SDQZPEFQSEg4UB1YCAFMCVAABBQYHAlYEUlAHUVVSBgQJBgYGUFQEUw4VTxBZERIOFHxcWURPElRBWEEHWxVPEENDCgUABAQABgEABgUABQYbFQlZFVsSVRQcF1FBVRAPEUF0ZFpmDGBDNmBfDmRlYEREXVhbcFRhFRtBXEFDChZxX1pQXVISfF1WGRIbFQ1TQUMKFg4IDQIDFR4XQFZFEg1sWgMCTQQFBG0ZFUNYEA9oF1YSGxUCEBtDURYaElQVHRVTFx8XVhIbFQIQak0SXVlRFw0TUVRTVVNRREMVTxBWCxIOFEUXGxNUWxcJF0ADGQNNAhVNEldQb0MVCxUCBBEZFVJTFVkQRQBeUFldCAEDDgMNBwECEhsVDlgVW2sFGgAZB2wbEFdfWlASDRUCEBtDXUdREg8VUBVP~01nabve\\\",\\\"sceneid\\\":\\\"ZNShPageh5\\\"},\\\"secretp\\\":\\\"" + str(
                  secretp) + "\\\",\\\"random\\\":\\\"62918445\\\"}\"}"
            },
            "client": "wh5",
            "clientVersion": "1.0.0",
      }
      response = requests.post("https://api.m.jd.com/client.action?functionId=tigernian_collectAutoScore",
                                 headers=self.header, data=collectAutoScore_data)
      print(response.text)

    # 年兽互助
    def nian_help(self, secretp):
      collectAutoScore_data = {
            "functionId": "tigernian_collectScore",
            "body": {
                  "{\"ss\":\"{\\\"extraData\\\":{\\\"log\\\":\\\"1641803110744~1NKS1TI9XJ5MDFocWxvQzAxMQ%3D%3D.WUdYXntYQl1fdlpGWREpXUMfABAuPFVaPVldW0N6REASXT1ZDwMhLT43NFYwXRkvJzc9IDomAg8kCwsSVUwS.74272e26~9%2C1~4860683BF67DEF83E1BD773FACB07741C68A9F2C~1ggv2cy~C~TxVDCBMMa2pNF0NWWRAPbEdQAhpTdBp0Yk0BY3MYAxsHVQQbQ0cdFFQATANyFHBnGQMwdxsGSwEGABsVFxsaUAMYASAYc2FJBWBjGxQZQxppHhdQF1oVDVQdFENEQw8VCQIGBA9VBwYHUQkPBANTAgUaGBBCUgEWDRURRUJEQwdAURoYEEJSBBYNFQNXQkRDFUBWGhgQRVMLFg1sXB0CABtTGQQUBR4AakkWXV1HCwccFQJGFQIWUAFUBwBTUwdTVQUCWA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YrcVtlNHZRZVI0d2JeSgNRQAkCXAdHHRRdRAYXDRoWTw%3D%3D~1ijta4v\\\",\\\"sceneid\\\":\\\"ZNSZLh7\\\"},\\\"secretp\\\":\\\"" + str(
                  secretp) + "\\\",\\\"random\\\":\\\"10101149\\\"}\",'inviteId':'ZXASTT022vP13RRkZ9F3SPRv3kP8OcAFjRWn6W7zB55awQ',}"
            },
            "client": "wh5",
            "clientVersion": "1.0.0",

      }
      response = requests.post("https://api.m.jd.com/client.action?functionId=tigernian_collectScore",
                                 headers=self.header, data=collectAutoScore_data)
      print(response.text)


    def __init__(self):
      for i in range(len(self.list)):      #设置请求头
            self.header = {
                'Host': 'api.m.jd.com',
                'Connection': 'keep-alive',
                'Content-Type': 'application/x-www-form-urlencoded',
                'user-agent': 'jdapp;android;10.0.6;11;9363537336739353-2636733333439346;network/wifi;model/KB2000;addressid/138121554;aid/9657c795bc73349d;oaid/;osVer/30;appBuild/88852;partner/oppo;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 11; KB2000 Build/RP1A.201005.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045537 Mobile Safari/537.36',
                "Cookie": str(self.list)
            }
            self.home()
jd()

laycher 发表于 2022-1-11 10:47

测了下,## 开始执行... 2022-01-11 10:46:06


{"code":-30001,"msg":"登陆失败"}
{"code":-30001,"msg":"登陆失败"}
{"code":-30001,"msg":"登陆失败"}
{"code":-30001,"msg":"登陆失败"}

wsmdmy2011 发表于 2022-1-11 09:29

始执行脚本
## 开始执行... 2022-01-11 09:27:22


File "jd.py", line 9
    def home(self):
                  ^
IndentationError: unindent does not match any outer indentation level

倔强的小菊花 发表于 2022-1-11 09:04

看不懂......

快乐的小萌新 发表于 2022-1-11 09:08

倔强的小菊花 发表于 2022-1-11 09:04
看不懂......

你在青龙面板新建文件,随便输入名字.py 代码复制进去,去定时任务添加执行就好了啊

dj215 发表于 2022-1-11 09:13

全部任务都能够做得还是?

hy_cicada 发表于 2022-1-11 09:15

那个body 里面的 ss 数据包含的 log 对应字符串能重复使用吗?

总想搞个大新闻 发表于 2022-1-11 09:16

直接把邀请码写死了?
'inviteId':'ZXASTT022vP13RRkZ9F3SPRv3kP8OcAFjRWn6W7zB55awQ'

akang 发表于 2022-1-11 09:18

青龙面板是安装在docker上的吗,那必须有nas吧?

wsmdmy2011 发表于 2022-1-11 09:20

登陆失败

快乐的小萌新 发表于 2022-1-11 09:22

总想搞个大新闻 发表于 2022-1-11 09:16
直接把邀请码写死了?
'inviteId':'ZXASTT022vP13RRkZ9F3SPRv3kP8OcAFjRWn6W7zB55awQ'

你没看到,我邀请功能都没做出来啊

快乐的小萌新 发表于 2022-1-11 09:24

wsmdmy2011 发表于 2022-1-11 09:20
登陆失败

对的啊,我刚刚测了下
页: [1] 2 3 4 5 6
查看完整版本: 京东Nian的鞭炮收集