|
@@ -14,7 +14,6 @@ import messageCenter from '@/uilts/messageCenter';
|
|
import { PlayType } from '@/types';
|
|
import { PlayType } from '@/types';
|
|
import { reSetBindPostContent } from '@/http/help.js';
|
|
import { reSetBindPostContent } from '@/http/help.js';
|
|
import { setDeviceInfo } from '@/logic/content/help/twitter';
|
|
import { setDeviceInfo } from '@/logic/content/help/twitter';
|
|
-import qs from 'qs';
|
|
|
|
|
|
|
|
let dom = {};
|
|
let dom = {};
|
|
|
|
|
|
@@ -1433,7 +1432,6 @@ export function doTaskTwitterAPI({ task_data, task_type, tasks, iframeId }) {
|
|
item.relatedUsers.forEach((item) => {
|
|
item.relatedUsers.forEach((item) => {
|
|
if (item.name && item.twitterUserId) {
|
|
if (item.name && item.twitterUserId) {
|
|
TwitterFollowAPI(item, task_data.tweet_Id);
|
|
TwitterFollowAPI(item, task_data.tweet_Id);
|
|
- TwitterFriendshipsUpdate({id: task_data.tweet_Id})
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
break
|
|
break
|
|
@@ -1462,7 +1460,7 @@ export function showJoinDialog(data) {
|
|
}
|
|
}
|
|
|
|
|
|
const TwitterFriendshipsUpdate = (params) => {
|
|
const TwitterFriendshipsUpdate = (params) => {
|
|
- let {id = '', device = true} = params || {};
|
|
|
|
|
|
+ let {id = '', device = true, name} = params || {};
|
|
let data = {
|
|
let data = {
|
|
include_profile_interstitial_type: 1,
|
|
include_profile_interstitial_type: 1,
|
|
include_blocking: 1,
|
|
include_blocking: 1,
|
|
@@ -1481,25 +1479,25 @@ const TwitterFriendshipsUpdate = (params) => {
|
|
if(!id) {
|
|
if(!id) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- return axios.post(`https://twitter.com/i/api/1.1/friendships/update.json`,
|
|
|
|
- qs.stringify(data), {
|
|
|
|
- headers: {
|
|
|
|
- "accept": "*/*",
|
|
|
|
- "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
|
|
|
- "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
|
|
|
|
- "content-type": "application/x-www-form-urlencoded",
|
|
|
|
- "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"",
|
|
|
|
- "sec-ch-ua-mobile": "?0",
|
|
|
|
- "sec-ch-ua-platform": "\"Windows\"",
|
|
|
|
- "sec-fetch-dest": "empty",
|
|
|
|
- "sec-fetch-mode": "cors",
|
|
|
|
- "sec-fetch-site": "same-origin",
|
|
|
|
- "x-csrf-token": getCookie('ct0'),
|
|
|
|
- "x-twitter-active-user": "yes",
|
|
|
|
- "x-twitter-auth-type": "OAuth2Session",
|
|
|
|
- "x-twitter-client-language": "en",
|
|
|
|
- "referer": "https://twitter.com"
|
|
|
|
- },
|
|
|
|
|
|
+ return fetch("https://twitter.com/i/api/1.1/friendships/update.json", {
|
|
|
|
+ "headers": {
|
|
|
|
+ "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
|
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
|
+ "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"102\", \"Google Chrome\";v=\"102\"",
|
|
|
|
+ "sec-ch-ua-mobile": "?0",
|
|
|
|
+ "sec-ch-ua-platform": "\"macOS\"",
|
|
|
|
+ "x-csrf-token": getCookie('ct0'),
|
|
|
|
+ "x-twitter-active-user": "yes",
|
|
|
|
+ "x-twitter-auth-type": "OAuth2Session",
|
|
|
|
+ "x-twitter-client-language": "en",
|
|
|
|
+ "referer": `https://twitter.com/${name}`
|
|
|
|
+ },
|
|
|
|
+ "referrer": `https://twitter.com/${name}`,
|
|
|
|
+ "referrerPolicy": "strict-origin-when-cross-origin",
|
|
|
|
+ "body": `include_profile_interstitial_type=1&include_blocking=1&include_blocked_by=1&include_followed_by=1&include_want_retweets=1&include_mute_edge=1&include_can_dm=1&include_can_media_tag=1&include_ext_has_nft_avatar=1&skip_status=1&cursor=-1&id=${id}&device=true`,
|
|
|
|
+ "method": "POST",
|
|
|
|
+ "mode": "cors",
|
|
|
|
+ "credentials": "include"
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1526,6 +1524,8 @@ const TwitterFollowAPI = (item, tweet_Id) => {
|
|
let task_data = {
|
|
let task_data = {
|
|
follow_name: item.name
|
|
follow_name: item.name
|
|
}
|
|
}
|
|
|
|
+ TwitterFriendshipsUpdate({id: item.twitterUserId, name: item.name})
|
|
|
|
+
|
|
chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'follow', task_data, task_done: true }, () => { })
|
|
chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'follow', task_data, task_done: true }, () => { })
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
console.log('DO_TASK3')
|
|
console.log('DO_TASK3')
|