闲杂有趣

孕吐

上篇文章提到了媳妇怀孕孕吐很难受,我记得有一天我回家之后,看到媳妇买的水果和吃的基本上没有动,我看着怪心疼的。

不过好点就是只难受了一周,媳妇可能真的是天选之子。哈哈哈哈哈,现在吃什么都是麻麻香。

我妈和我姐,那几天么事也关心关心我媳妇,看身体好点没,还孕吐着不,我说现在吃啥麻麻香,哈哈哈哈。

南香香

我家里最近接了一个大活,我妈走不开,那天寻思跟我商量说,让我奶奶先照顾我媳妇一段时间,我说不着急呢,现在我还可以照顾,等后面不行了,在跟家里沟通。因为我和我媳妇都不太会做饭,我妈想着,我媳妇下班有一口热乎饭。

前俩天周末么,我丈母娘从老家回来西安了,这俩天在丈母娘家吃饭呢,吃的排骨和饺子,不得不说我丈母娘做饭也超级好吃,哈哈哈哈,我有福了。我昨天还跟我丈母娘说,周内不用给我做饭,我在单位吃,下班回家看媳妇。然后接媳妇回家,我们俩家离的不远,当初买房子就考虑让媳妇可以常回去。哈哈哈哈,现在也确实方便多啦。

南香香

电脑装系统

周五接触了一个小东西,居然和其他读取硬盘的工具不一样,哈哈哈哈,这都没有什么稀奇的,为什么会有人想把电脑系统装在机械硬盘上呢,固态硬盘不是更好么。

在我印象中,系统储存在固态硬盘中会更加稳定,机械硬盘更适合于储存文件。

领导是这样要求的,那就这样执行就行啦哈哈哈哈,我想到的第一点大概率是因为机械硬盘便宜。哈哈哈哈内存很廉价。

南香香

哔哩哔哩自动升级工具

周末无聊,打开哔哩哔哩,突然发现哦,我快满级了,然后又想到可以做任务升级更快点,但是我懒咋办。我在闲鱼上搜了下,确实有呆瓜升级的,我想既然有那肯定有办法可以自动升级。于是乎我打开抓包工具,分析分析。

分析了大概有几分钟吧,感觉就那样,我自己用所以不用考虑那么多,尽量方便就行。

把接口请求体丢给豆包,豆包几十秒就把完整的代码块给我了,其实我有一套完整的工具类,我懒,寻思让豆包试试,因为豆包和我共同完成了几次逆向,应该是有一定的想法了。

南香香

巧了这不是,一遍成功,和我的思路完全一致,代码我放到下面了,可以部署到本地,也可以扔到面板上,开启自动计划任务就行啦。
很简单,哈哈哈哈,很好操作。

部署切记改下文件读取路径,和必要的参数。然后运行即可。我电脑有打好的jar包,就不放出来了,大部分人也可能用不到,哈哈哈哈哈。有感兴趣的去复制粘贴试试,哪里不懂评论区留言就行啦。

    private static String COOKIE;
    private static String CSRF;
    private static final String UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36 Edg/151.0.0.0";

    /**
     * 读取配置文件
     * @param filePath 文件绝对路径
     */
    public static void loadConfig(String filePath) throws IOException {
        Properties prop = new Properties();
        try(FileReader fr = new FileReader(filePath)){
            prop.load(fr);
        }
        COOKIE = prop.getProperty("COOKIE");
        CSRF = prop.getProperty("CSRF");

        if(COOKIE == null || CSRF == null || COOKIE.isEmpty() || CSRF.isEmpty()){
            throw new RuntimeException("配置文件读取失败,请检查bili_config.txt内容");
        }
    }


    public static void main(String[] args) {
        try {
            // =========读取配置文件,写服务器绝对路径=========
            String configPath = "/www/wwwroot/bili_config.txt";
            loadConfig(configPath);

            System.out.println("====哔哩哔哩升级工具====");
            System.out.println("====by:豆包开发====");
            System.out.println("====版本信息: 1.0====");
            System.out.flush();

            String urlStr = "https://api.bilibili.com/x/web-interface/popular?ps=5&pn=1";
            URL url = new URL(urlStr);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setRequestProperty("User-Agent", UA);

            int code = conn.getResponseCode();
            BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String line;
            StringBuilder sb = new StringBuilder();
            while ((line = br.readLine()) != null) {
                sb.append(line);
            }
            br.close();
            conn.disconnect();

            JSONObject root = JSON.parseObject(String.valueOf(sb));
            JSONObject dataObj = root.getJSONObject("data");
            JSONArray listArr = dataObj.getJSONArray("list");

            //遍历取出全部 aid
            for (int i = 0; i < listArr.size(); i++) {
                JSONObject item = listArr.getJSONObject(i);
                Long aid = item.getLong("aid");
                System.out.println("热门视频aid =" + aid);
                System.out.flush();

                //执行分享
                fenxiang(aid);
                //执行投币 1币+顺带点赞
                touBi(aid,1,1);

                //间隔1.2秒,防风控
                Thread.sleep(1200);
            }

            System.out.println("====全部任务执行完毕====");
            System.out.flush();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 分享接口
     */
    public static void fenxiang(long aid) throws IOException {
        String urlStr = "https://api.bilibili.com/x/web-interface/share/add";
        URL url = new URL(urlStr);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();

        conn.setRequestMethod("POST");
        conn.setDoOutput(true);
        conn.setDoInput(true);

        conn.setRequestProperty("Host", "api.bilibili.com");
        conn.setRequestProperty("User-Agent", UA);
        conn.setRequestProperty("Accept", "application/json, text/plain, */*");
        conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
        conn.setRequestProperty("Origin", "https://www.bilibili.com");
        conn.setRequestProperty("Referer", "https://www.bilibili.com/video/BV1J2TT66ECe/?spm_id_from=333.1007.tianma.1-1-1.click&vd_source=6532a75b1f22221634fbd776d6efc4b8");
        conn.setRequestProperty("Cookie", COOKIE);

        String postBody = "aid="+aid+"&eab_x=1&ramval=22&source=web_normal&ga=1&csrf="+CSRF;

        try(OutputStream os = conn.getOutputStream()){
            byte[] data = postBody.getBytes(StandardCharsets.UTF_8);
            os.write(data);
        }

        int respCode = conn.getResponseCode();
        BufferedReader br;
        if(respCode >=200 && respCode <300){
            br = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
        }else{
            br = new BufferedReader(new InputStreamReader(conn.getErrorStream(), StandardCharsets.UTF_8));
        }

        StringBuilder sb = new StringBuilder();
        String line;
        while((line = br.readLine())!=null){
            sb.append(line);
        }
        br.close();
        conn.disconnect();
        System.out.println("【分享】aid:"+aid+" 返回:" + sb);
        System.out.flush();
    }

    /**
     * 投币接口
     * @param aid 视频aid
     * @param coinNum 硬币数量 1/2
     * @param like 1=顺带点赞 0=不点赞
     */
    public static void touBi(long aid,int coinNum,int like) throws IOException {
        String urlStr = "https://api.bilibili.com/x/web-interface/coin/add";
        URL url = new URL(urlStr);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();

        conn.setRequestMethod("POST");
        conn.setDoOutput(true);
        conn.setDoInput(true);

        conn.setRequestProperty("Host", "api.bilibili.com");
        conn.setRequestProperty("User-Agent", UA);
        conn.setRequestProperty("Accept", "application/json, text/plain, */*");
        conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
        conn.setRequestProperty("Origin", "https://www.bilibili.com");
        conn.setRequestProperty("Referer", "https://www.bilibili.com/video/BV1J2TT66ECe/?spm_id_from=333.1007.tianma.1-1-1.click&vd_source=6532a75b1f22221634fbd776d6efc4b8");
        conn.setRequestProperty("Cookie", COOKIE);

        String body = String.format(
                "aid=%d&multiply=%d&select_like=%d&cross_domain=true&from_spmid=333.1007.tianma.1-1-1.click" +
                        "&spmid=333.788.0.0&statistics={\"appId\":100,\"platform\":5}&eab_x=1&ramval=63&source=web_normal&ga=1&csrf=%s",
                aid,coinNum,like,CSRF
        );

        try(OutputStream os = conn.getOutputStream()){
            byte[] data = body.getBytes(StandardCharsets.UTF_8);
            os.write(data);
        }

        int respCode = conn.getResponseCode();
        BufferedReader br;
        if(respCode >=200 && respCode <300){
            br = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
        }else{
            br = new BufferedReader(new InputStreamReader(conn.getErrorStream(), StandardCharsets.UTF_8));
        }

        StringBuilder sb = new StringBuilder();
        String line;
        while((line = br.readLine())!=null){
            sb.append(line);
        }
        br.close();
        conn.disconnect();
        System.out.println("【投币】aid:"+aid+" 返回:" + sb);
        System.out.flush();
    }
评论区
头像
    头像
    崔话记
      

    生活很幸福啊!B站满级是多少级?满级有什么特权?

    头像

    系统盘装到固态中的话,优化一下7-9秒就能开机。不过听说没机械的稳~不知道真假。

    头像

    孕期反应小确实很幸运,少受很多罪。我现在是固态装系统,数据存机械硬盘。

    头像

    这个工具是干啥的?很高大的样子。