吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3000|回复: 30
收起左侧

[Java 原创] 某里网盘签到抽奖java

  [复制链接]
zhuoxin99 发表于 2023-5-15 22:18
仅供学习交流,请勿用于非法。

jar包
https://wwkc.lanzouf.com/ieitO0w9w1oj
密码:bhcm

打开链接 阿里云盘
控制台输入获取token  JSON.parse(localStorage.token).refresh_token


[Java] 纯文本查看 复制代码
package com.example.zhuoxin.util;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;

public class aLi {
    private static final String updateAccesssTokenURL = "https://auth.aliyundrive.com/v2/account/token";
    private static final String signinURL = "https://member.aliyundrive.com/v1/activity/sign_in_list?_rx-s=mobile";
    private static final String rewardURL = "https://member.aliyundrive.com/v1/activity/sign_in_reward?_rx-s=mobile";
    private static final RestTemplate re = new RestTemplate();
    public static final HttpHeaders headers = new HttpHeaders();
    private static final String refresh_token = "";
    private static final StringBuffer sb = new StringBuffer();

    public static void main(String[] args) {
        headers.add("Content-Type", "application/json");

        JSONObject updateAccesssDate = new JSONObject();
        updateAccesssDate.put("grant_type", "refresh_token");
        updateAccesssDate.put("refresh_token", refresh_token);

        HttpEntity<String> updateAccesssDateEntity = new HttpEntity<String>(JSONObject.toJSONString(updateAccesssDate), headers);
        ResponseEntity<String> updateAccesssDateRep = null;
        try {
            updateAccesssDateRep = re.postForEntity(updateAccesssTokenURL, updateAccesssDateEntity, String.class);
        } catch (RestClientException e) {
            sb.append("提示 : TOKEN 失效,请更新 !");
            System.out.println(sb);
            return;
        }
        JSONObject UpdateAccesssTokenRep = JSONObject.parseObject(updateAccesssDateRep.getBody());
        sb.append("------------------获取个人信息成功--------------------" + "\n");
        sb.append("用户名 :" + UpdateAccesssTokenRep.getString("user_name") + "\n");
//        sb.append("refresh_token :" + UpdateAccesssTokenRep.getString("refresh_token") + "\n");
//        sb.append("access_token :" + UpdateAccesssTokenRep.getString("access_token") + "\n");

        headers.add("Authorization", UpdateAccesssTokenRep.getString("access_token"));
        JSONObject signinURLDate = new JSONObject();
        signinURLDate.put("isReward", false);
        HttpEntity<String> signinURLDateEntity = new HttpEntity<String>(JSONObject.toJSONString(signinURLDate), headers);
        ResponseEntity<String> signinURLDateRep = null;
        JSONObject signinURListRep = null;

        try {
            signinURLDateRep = re.postForEntity(signinURL, signinURLDateEntity, String.class);
            signinURListRep = JSONObject.parseObject(signinURLDateRep.getBody());
        } catch (RestClientException e) {
            sb.append("提示 : 签到列表获取失败 !");
            System.out.println(sb);
            return;
        }
        String signInCount = signinURListRep.getJSONObject("result").getString("signInCount");
        JSONArray signInLogs = signinURListRep.getJSONObject("result").getJSONArray("signInLogs");
        sb.append("------------------获取签到列表信息成功------------------" + "\n");
        sb.append("本月累计签到 :" + signInCount + "\n");
        //当天签到信息
        JSONObject signDayInLogs = signInLogs.getJSONObject(Integer.valueOf(signInCount) - 1);
        //获取未领取奖励列表
        for (int i = 0; i < signInLogs.size(); i++) {
            if (signInLogs.getJSONObject(i).getString("status").equals("normal") && signInLogs.getJSONObject(i).getString("isReward").equals("false")) {
                final String day = signInLogs.getJSONObject(i).getString("day");
                JSONObject rewardDate = new JSONObject();
                rewardDate.put("signInDay", day);
                HttpEntity<String> rewardDateEntity = new HttpEntity<String>(rewardDate.toJSONString(), headers);
                ResponseEntity<String> rewardDateRep = null;
                JSONObject rewardListDateRep = null;
                try {
                    rewardDateRep = re.postForEntity(rewardURL, rewardDateEntity, String.class);
                    rewardListDateRep = JSONObject.parseObject(rewardDateRep.getBody());
                    if (rewardListDateRep.getString("success").equals("true")) {
                        sb.append("------------------奖励领取成功--------------------" + "\n");
                        sb.append("奖品名称 :" + rewardListDateRep.getJSONObject("result").getString("name") + "\n");
                        sb.append("奖品名称 :" + rewardListDateRep.getJSONObject("result").getString("description") + "\n");
                        sb.append("奖品名称 :" + rewardListDateRep.getJSONObject("result").getString("notice") + "\n");
                        System.out.println(sb);
                        return;
                    }
                } catch (RestClientException e) {
                    sb.append("提示 : 奖励领取失败 !");
                    System.out.println(sb);
                    return;
                }
            }
        }
        sb.append("------------------当天已领取奖励-------------------" + "\n");
        sb.append("奖品名称 :" + signDayInLogs.getJSONObject("reward").getString("name") + "\n");
        sb.append("奖品名称 :" + signDayInLogs.getJSONObject("reward").getString("description") + "\n");
        System.out.println(sb);
    }

}

1

1

2

2

3

3

免费评分

参与人数 5吾爱币 +4 热心值 +5 收起 理由
mabin + 1 谢谢@Thanks!
TabKey9 + 1 + 1 用心讨论,共获提升!
zhangxiaoxiao + 1 + 1 谢谢@Thanks!
qiyuyue + 1 + 1 谢谢@Thanks!
yezhengw111 + 1 + 1 谢谢@Thanks!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

ossas 发表于 2023-5-16 01:36
感谢分享
xinxiu 发表于 2023-5-21 12:05
用chatGPT改成了python代码,多账号登陆签到,就是第一次运行的时候没有显示出签到的奖品名称和描述,有大佬帮看看吗?
[Python] 纯文本查看 复制代码
import requests
import json

updateAccesssTokenURL = "https://auth.aliyundrive.com/v2/account/token"
signinURL = "https://member.aliyundrive.com/v1/activity/sign_in_list?_rx-s=mobile"
rewardURL = "https://member.aliyundrive.com/v1/activity/sign_in_reward?_rx-s=mobile"
headers = {
    "Content-Type": "application/json"
}

accounts = [
    {
        "refresh_token": "你的token1"
    },
    {
        "refresh_token": "你的token2"
    }
]

for account in accounts:
    refresh_token = account["refresh_token"]

    data = {
        "grant_type": "refresh_token",
        "refresh_token": refresh_token
    }

    try:
        updateAccesssDateRep = requests.post(updateAccesssTokenURL, headers=headers, data=json.dumps(data))
        UpdateAccesssTokenRep = updateAccesssDateRep.json()
    except requests.exceptions.RequestException as e:
        print("提示 : TOKEN 失效,请更新 !")
        continue

    print("------------------获取个人信息成功--------------------")
    print("用户名 :", UpdateAccesssTokenRep["user_name"])

    headers["Authorization"] = UpdateAccesssTokenRep["access_token"]

    signinURLDate = {
        "isReward": False
    }

    try:
        signinURLDateRep = requests.post(signinURL, headers=headers, data=json.dumps(signinURLDate))
        signinURListRep = signinURLDateRep.json()
    except requests.exceptions.RequestException as e:
        print("提示 : 签到列表获取失败 !")
        continue

    signInCount = signinURListRep["result"]["signInCount"]
    signInLogs = signinURListRep["result"]["signInLogs"]

    print("------------------获取签到列表信息成功------------------")
    print("本月累计签到 :", signInCount)

    signDayInLogs = signInLogs[int(signInCount) - 1]

    for log in signInLogs:
        if log["status"] == "normal" and log["isReward"] == False:
            day = log["day"]
            rewardDate = {
                "signInDay": day
            }
            try:
                rewardDateRep = requests.post(rewardURL, headers=headers, data=json.dumps(rewardDate))
                rewardListDateRep = rewardDateRep.json()
                if rewardListDateRep["success"] == "true":
                    print("------------------奖励领取成功--------------------")
                    print("奖品名称 :", rewardListDateRep["result"]["name"])
                    print("奖品描述 :", rewardListDateRep["result"]["description"])
                    break
            except requests.exceptions.RequestException as e:
                print("提示 : 奖励领取失败 !")
                break

    print("------------------当天已领取奖励-------------------")
    print("奖品名称 :", signDayInLogs["reward"]["name"])
    print("奖品描述 :", signDayInLogs["reward"]["description"])
    print()
qiyuyue 发表于 2023-5-16 00:52
will52089 发表于 2023-5-16 03:03
感谢分享
dftop 发表于 2023-5-16 07:22
已下载,谢谢楼主分享
alfriend 发表于 2023-5-16 07:55
感谢分享
daoye9988 发表于 2023-5-16 08:06
有没有中大奖的
lovekezi 发表于 2023-5-16 08:32
感谢分享
JAKE2021 发表于 2023-5-16 08:34
感谢分享
zhongyishen2022 发表于 2023-5-16 08:43
这个有啥用?怎么用?只适合电脑呗
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-24 21:38

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表