你考虑过csdn审核的感受吗.jpg
python 获取自己csdn vip可见文章的articleId curlconverter -CSDN博客
import requests # 原始获取文章列表的配置 cookies_get = { 保护隐私 } headers_get = { 'accept': 'application/json, text/plain, */*', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 'origin': 'https://mp.csdn.net', 'priority': 'u=1, i', 'referer': 'https://mp.csdn.net/', 'sec-ch-ua': '"Microsoft Edge";v="143", "Chromium";v="143", "Not A(Brand";v="24"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-site', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0', 'x-ca-key': '203803574', 'x-ca-nonce': '5139291b-05ff-46f2-a563-974ff2419287', 'x-ca-signature': 'S2o4cFnUcx1V5ks4us9kbX5Us98S3sNVek4Ap8iTpZA=', 'x-ca-signature-headers': 'x-ca-key,x-ca-nonce', } params = { 'page': '1', 'visible': 'vip', 'status': 'all_v3', 'pageSize': '20', } # 获取文章列表 response = requests.get( 'https://bizapi.csdn.net/blog/phoenix/console/v1/article/list', params=params, cookies=cookies_get, headers=headers_get, ) # 解析响应数据并提取 articleId data = response.json() article_list = data['data']['list'] article_ids = [article['articleId'] for article in article_list] print("文章ID列表:") print(article_ids) # 设置文章可见性的配置 cookies_post = { 保护隐私 } headers_post = { 'accept': 'application/json, text/plain, */*', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 'content-type': 'application/json;', 'origin': 'https://mp.csdn.net', 'priority': 'u=1, i', 'referer': 'https://mp.csdn.net/', 'sec-ch-ua': '"Microsoft Edge";v="143", "Chromium";v="143", "Not A(Brand";v="24"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-site', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0', 'x-ca-key': '203803574', 'x-ca-nonce': '9c093f0e-3094-4fbb-92f6-de487de2ef3f', 'x-ca-signature': 'lTCAx8UooUMP5Hggj/1eVZCBRNoUXtJbZrSm0wnMSUc=', 'x-ca-signature-headers': 'x-ca-key,x-ca-nonce', } # 对每个 articleId 执行 POST 请求 for article_id in article_ids: json_data = { 'articleId': article_id, 'visible': 'all', } response = requests.post( 'https://bizapi.csdn.net/blog/phoenix/console/v2/article/set-visible-range', cookies=cookies_post, headers=headers_post, json=json_data, ) print(f"文章 {article_id} 设置可见性结果: {response.status_code}") if response.status_code == 200: print(f"成功设置文章 {article_id} 的可见性") else: print(f"设置文章 {article_id} 可见性失败: {response.text}")