Hellager / weibo_supertopic_sign

基于Python/Nodejs的微博超话签到脚本,支持云函数运行或青龙面板运行
MIT License
90 stars 40 forks source link

只能获取到超话第一页的数据,超过15个了就无法获取 #25

Open Wangfugui110 opened 1 year ago

Wangfugui110 commented 1 year ago

7G%U6E52D)(4W3RP 8ZD)_W `}H3LTX%8UN4 PUHNYC8ZSD @U}1}EF3IJ{$0SQ$44F5@B8

IMG_6149 stream对链接请求重放也是可以获取到所有超话名字的,15个以内的话可以正常跑

Hellager commented 1 year ago

第一页这个结构是对的,主要问题应该是后续获取的数据结构问题,可以修改下代码看看返回的数据问题 了解一点编程的话可以尝试本地运行打断点或者直接跑主分支 test 的代码,看看脚本的请求参数和实际请求参数直接存在哪些差异

// Sign_Weibo.js line 216
res_obj = res.data;
+ console.log(res_obj);

// Sign_Weibo.js line 227
since_id = card_list_info.since_id;
+ console.log(since_id);
Hellager commented 1 year ago

应该是参数有问题,具体看这个 issue https://github.com/Hellager/weibo_supertopic_sign/issues/24 关注下 containerid

1018987534 commented 1 year ago
        if(res_obj.cards.length>0){
        let card_group = res_obj.cards[0].card_group;
        let card_list_info = res_obj.cardlistInfo;

        since_id = card_list_info.since_id;
        console.log(since_id);
        try {
            page = JSON.parse(since_id).page.toString();
        } catch {
            page = (parseInt(page) + 1).toString(); 
        }

        for (const item of card_group) {
            if (item.card_type === '8') {
                const page_index = item.itemid.slice(item.itemid.indexOf('follow_super_follow_') + 'follow_super_follow_'.length, item.itemid.length);
                const topic = {
                    title: item.title_sub,
                    level: item.desc1.slice(item.desc1.indexOf('.') + 1, item.desc1.length),
                    sign_status: item.buttons[0].name,
                    sign_action: item.buttons[0].name === '已签' ? '' : item.buttons[0].params.action,
                    since_id: since_id,
                    page: page_index.split('_')[0],
                }

                follow_list.push(topic);
            }                
        }

        log.info(`获取超话列表第 ${page-1} 页数据成功`); 
        } else{
         since_id = '0';
        }     

        处理了一下空指针问题,解决问题
Hellager commented 1 year ago

@1018987534 这个好这个好,我改一下

Wangfugui110 commented 1 year ago

`$G~G FKI1QUTVA0@94RPEG geng'x更新了最新代码后第一天签到还是正常后面就获取不到第二页了,现在显示为超时

Wangfugui110 commented 1 year ago

取消关注几个后就正常了