猫史档案馆


一缕余晖

一缕余晖

Lv.1

夕阳西下 一缕余晖

获赞:418收藏:224浏览:7829作品收藏:162
回复帖子评论
上一页第 26 页 / 共 26 页下一页

在 我宣布,我要 中回复

进神射手要一精选作品

2021-12-18T17:49:36 点赞:0

在 这是什么bug???? 中回复

我宣布:是我搞得....(别举报

2021-12-18T17:52:06 点赞:0

在 这是什么bug???? 中回复

我错了,你赶紧删帖啊啊啊啊,我不想被封号啊啊啊

2021-12-18T17:52:34 点赞:0

在 一个孤独的女孩 中回复

没事,你玩了

2021-12-18T17:54:51 点赞:0

在 【恶搞帖】从前有个。。。。。 中回复

哈哈哈哈哈

2021-12-18T19:16:51 点赞:0

在 你们给我听好了 中回复

顶顶顶

2021-12-18T19:19:59 点赞:0

在 【预告】【新大事件】【SXD思轩】到底是怎么回事? 中回复

噢(炸个尸

2021-12-27T19:42:04 点赞:1

在 事情来了! 中回复

但他跟我关系很好,但我却不知道他是谁?他就不骂我,而且还回了我

2021-12-27T19:43:11 点赞:0

在 终于解封了呜呜呜呜呜 中回复

顶顶顶

2021-12-27T21:32:25 点赞:1

在 大家看看这个我的世界很lz 中回复

好了,我要开始了!!!

2021-12-28T19:16:08 点赞:0

在 大家看看这个我的世界很lz 中回复

额,他已经被封了

2021-12-28T19:17:30 点赞:0

在 【Python作品分享】新的作品【求助帖】 中回复

我有种更卡的

2021-12-29T18:34:08 点赞:0

在 电脑崩溃专用 中回复

我有种跟卡的

2021-12-29T18:34:33 点赞:1

在 【知识帝】知识帝再次...........卷土重来,而且还恶意举报!!! 中回复

import requests
import time
import re
url = 411953
times = 0
headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Content-Type': 'application/json;charset=UTF-8',
    'Cookie': '',
    'Host': 'api.codemao.cn',
    'Origin': 'https://shequ.codemao.cn',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-site',
    'User-Agent': ''
}
html = requests.get(
    'https://api.codemao.cn/web/forums/posts/{}/details'.format(4555555), headers=headers).json()
error = html
slep = False


def tryy(url, headers, error):
    html = requests.get(url, headers=headers).json()
    try:
        if html['error_code'] == error['error_code']:
            return False
        else:
            return True
    except:
        return True


def sleep(url, headers, error):
    html = requests.get(
        'https://api.codemao.cn/web/forums/posts/{}/details'.format(url), headers=headers).json()
    try:
        if html['error_code'] == error['error_code']:
            return True
        else:
            return False
    except:
        return False

def match(text):
    last = None
    first = re.search('互',text)
    if first != None:
        first = first.group()
        first =  '{}.*?'.format(first)
        second = re.search('{}赞|{}关|{}收藏|{}再创|{}在创|{}在创作|{}再创作'.format(
            first,first,first,first,first,first,first),text)
        if second != None:
            second = second.group()
            last = 1
            print(second)
    else:
        first = re.search('[点赞]',text)
        if first != None:
            first = first.group()
            first = '{}.*?'.format(first)
            second = re.search('{}能不能|{}可否|{}看一下|{}给|{}点|{}赞|{}也'.format(
                    first,first,first,first,first,first,first),text)
            if second != None:
                second = second.group()
                last = 2
                print(second)
        else:
            first = re.search('0-20|一|二|三|四|五|六|七|八|九|十',text)
            if first != None:
                first = first.group()
                second = re.search('{}赞|{}关|{}收藏|{}再创|{}在创|{}在创作|{}再创作'.format(
                    first,first,first,first,first,first,first),text)
                if second != None:
                    second = second.group()
                    second = '{}.*?'.format(second)
                    third = re.search('{}[回换]'.format(second),text)
                    if third != None:
                        third = third.group()
                        third = '{}.*?'.format(third)
                        fourth = re.search('{}赞|{}关|{}收藏|{}再创|{}在创|{}在创作|{}再创作'.format(
                            third,third,third,third,third,third,third),text)
                        if fourth != None:
                            fourth = fourth.group()
                            print(fourth)
                            last = 3
    return last

def communityprint(resp,url):
    userid =  int(resp['user']['id'])
    username = resp['user']['nickname']
    print('-----------------')
    print(userid)
    print('-----------------')
    print(username)
    print('-----------------')
    print('https://shequ.codemao.cn/community/' + str(url))

def answer(url,times, headers, error):
    while True:
        boo = tryy(
            'https://api.codemao.cn/web/forums/posts/{}/details'.format(url), headers, error)
        if boo == True:
            resp = requests.get('https://api.codemao.cn/web/forums/posts/{}/details?offset=1&limit=10'.format(url),headers = headers).json()
            text = resp['content'] + resp['title']
            answer_ = requests.get(
    'https://api.codemao.cn/web/forums/posts/{}/replies?page=1&limit=10&sort=-created_at'.format(url),headers = headers).json()
            for i in answer_['items']:
                true = re.search('不|杜绝|远离|萌新|互赞大佬|互赞的大佬|xxs|xs|小学生|小孩子|小孩纸|pen|屁|pi|毛',i['content'])
                if match(i['content']) != None and true == None:
                    communityprint(i,url)
            true = re.search('不|杜绝|远离|萌新|互赞大佬|互赞的大佬|xxs|xs|小学生|小孩子|小孩纸|pen|屁|pi|毛',text)
            if true == None:
                if match(text) != None:
                    communityprint(resp,url)
            url += 1
            times = 0
        elif times < 5:
            answer(url+1,times+1, headers, error)
            if times > 0:
                break
            else:
                return True, url
                break
        elif times == 5:
            break


while 1:
    if slep == True:
        slep = sleep(url, headers, error)
    else:
        slep, url = answer(url, times, headers, error)

2021-12-31T19:27:38 点赞:1

在 官方是把我们当小孩纸么? 中回复

ddd

2021-12-31T19:44:26 点赞:0

在 【知识帝】知识帝再次...........卷土重来,而且还恶意举报!!! 中回复

知识帝对不起,仔细一想其实你也就吹吹牛而已,吹牛在编程猫也不算错谬,所以对不起

2022-01-01T08:46:36 点赞:0

在 《SGY绘画报》𝕊𝔾𝕐动物园欢迎您! 中回复

他就是想当猴子,他的性质和碳基、二进制都不同

2022-01-01T13:23:56 点赞:0

在 【喵喵教程】第一期-邮箱制作竟然这么简单▪上 中回复

还以为诈尸了

2022-01-01T14:00:14 点赞:1