|
|
@@ -1,20 +1,48 @@
|
|
|
+window.userSt = {}
|
|
|
// 监听拦截到的数据
|
|
|
-window.dataList = [
|
|
|
- ["昵称","发布时间","ID","时长","粉丝","关注","关注率","喜欢","喜欢率","热度","标题"]
|
|
|
-]
|
|
|
window.onInterceptedData = function (data) {
|
|
|
-
|
|
|
+ console.log(data)
|
|
|
window.systemInfo = data
|
|
|
- if (data.url.includes('https://douhot.douyin.com/douhot/v1/material/video_billboard')) {
|
|
|
- const dataTemp = JSON.parse(data.responseBody)
|
|
|
- console.log(dataTemp)
|
|
|
- dataTemp.data.objs.forEach(element => {
|
|
|
- window.dataList.push([element.nick_name, element.publish_time, element.item_id, element.item_duration, element.fans_cnt, element.follow_cnt, element.follow_rate, element.like_cnt, element.like_rate, element.score, element.item_title])
|
|
|
+ switch (data.url) {
|
|
|
+ case "https://utas.mob.v5.prd.futc-ext.gcp.ea.com/ut/auth":
|
|
|
+ const result = JSON.parse(data.responseBody)
|
|
|
+ if (result.sid) {
|
|
|
+ window.activeID = result.sid
|
|
|
+ if (window.logBox) window.logBox.add('获取到认证ID:' + window.activeID)
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (data.url.includes('https://utas.mob.v5.prd.futc-ext.gcp.ea.com/ut/game/fc26/auctionhouse')) {
|
|
|
+ console.log(data)
|
|
|
+ const result2 = data.requestBody
|
|
|
+ window.itemID = result2.itemData.id
|
|
|
+ if (window.logBox) window.logBox.add(`卖出物品:${window.itemID}`)
|
|
|
+ if (window.userSt[window.itemID]) {
|
|
|
+ window.logBox.add(`获取到物品ID:${window.userSt[window.itemID].assetId}`)
|
|
|
+ owoSocket.send("sell", {"id": window.itemID, "buyNowPrice": result2.buyNowPrice, "assetId": window.userSt[window.itemID].assetId})
|
|
|
+ } else {
|
|
|
+ window.logBox.add(`无法匹配物品:${window.itemID}`)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (data.url.includes('https://utas.mob.v5.prd.futc-ext.gcp.ea.com/ut/game/fc26/tradepile')) {
|
|
|
+ const result3 = JSON.parse(data.responseBody)
|
|
|
+ if (window.logBox) window.logBox.add(`获取到物品数量:${result3.auctionInfo.length}`)
|
|
|
+ result3.auctionInfo.forEach(element => {
|
|
|
+ window.userSt[element.itemData.id] = element.itemData
|
|
|
});
|
|
|
- loadData()
|
|
|
+ }
|
|
|
+ if (data.url.includes('https://utas.mob.v5.prd.futc-ext.gcp.ea.com/ut/game/fc26/trade/') && data.url.includes('/bid')) {
|
|
|
+ const result4 = JSON.parse(data.responseBody)
|
|
|
+ if (window.logBox) window.logBox.add(`买入物品:${result4.auctionInfo[0].tradeId}`)
|
|
|
+ window.userSt[result4.auctionInfo[0].itemData.id] = result4.auctionInfo[0].itemData
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+
|
|
|
let owoLoadList = []
|
|
|
function loadCSS (url) {
|
|
|
if (owoLoadList.includes(url)) {
|
|
|
@@ -72,60 +100,6 @@ if (!box[0]) {
|
|
|
document.body.appendChild(insertElement);
|
|
|
}
|
|
|
|
|
|
-function clearData() {
|
|
|
- window.dataList = [
|
|
|
- ["昵称","发布时间","ID","时长","粉丝","关注","关注率","喜欢","喜欢率","热度","标题"]
|
|
|
- ]
|
|
|
- loadData()
|
|
|
-}
|
|
|
-
|
|
|
-function loadData() {
|
|
|
- window.yhqd.innerText = `已获取数据数量:${window.dataList.length - 1}`
|
|
|
-}
|
|
|
-
|
|
|
-// 保存CSV
|
|
|
-function fake_click(obj) {
|
|
|
- var ev = document.createEvent("MouseEvents");
|
|
|
- ev.initMouseEvent(
|
|
|
- "click", true, false, window, 0, 0, 0, 0, 0
|
|
|
- , false, false, false, false, 0, null
|
|
|
- );
|
|
|
- obj.dispatchEvent(ev);
|
|
|
-}
|
|
|
-function download(name, data) {
|
|
|
- var urlObject = window.URL || window.webkitURL || window;
|
|
|
-
|
|
|
- var downloadData = new Blob([data]);
|
|
|
-
|
|
|
- var save_link = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
|
|
|
- save_link.href = urlObject.createObjectURL(downloadData);
|
|
|
- save_link.download = name;
|
|
|
- fake_click(save_link);
|
|
|
-}
|
|
|
-
|
|
|
-function saveCSV (name, data) {
|
|
|
- let saveData = ''
|
|
|
- data.forEach(element => {
|
|
|
- if (element) {
|
|
|
- saveData += element.join(',')
|
|
|
- saveData += '\r\n'
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- var urlObject = window.URL || window.webkitURL || window;
|
|
|
-
|
|
|
- var downloadData = new Blob(['\ufeff' + saveData], { type: 'text/csv,charset=UTF-8'});
|
|
|
-
|
|
|
- var save_link = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
|
|
|
- save_link.href = urlObject.createObjectURL(downloadData);
|
|
|
- save_link.download = name;
|
|
|
- fake_click(save_link);
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-function saveData() {
|
|
|
- saveCSV ("output.csv", window.dataList)
|
|
|
-}
|
|
|
|
|
|
function owostart () {
|
|
|
const box = document.getElementsByClassName('puge-box')[0]
|
|
|
@@ -183,11 +157,133 @@ function logPanel (el, max) {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
if (document.querySelector('.puge-box')) document.querySelector('.puge-box').innerHTML = `
|
|
|
- <h5 style="color:black;" id="yhqd">已获取数据数量:0</h5>
|
|
|
- <div class="owo button" onclick="clearData();" style=" background-color: #009fe9; text-align: center; line-height: 40px; margin-bottom:2px;">清理数据</div>
|
|
|
- <div class="owo button" onclick="saveData();" style=" background-color: #009fe9; text-align: center; line-height: 40px; margin-bottom:2px;">导出数据</div>
|
|
|
+ <div class="owo button" onclick="window.running=true;window.logBox.add('已开启下单');" style=" background-color: #009fe9; text-align: center; line-height: 40px; ">开始接收</div>
|
|
|
+ <div class="owo button" onclick="window.running=false;window.logBox.add('已关闭下单');" style=" background-color: #009fe9; text-align: center; line-height: 40px; ">停止接收</div>
|
|
|
+ <h5 style="color:black;">日志输出</h5>
|
|
|
+ <div class="log-panel" style="height:300px;background-color: darkcyan;"></div>
|
|
|
|
|
|
`
|
|
|
-
|
|
|
+ setTimeout(() => {
|
|
|
+ window.logBox = new logPanel(document.querySelector('.log-panel'))
|
|
|
+ }, 0);
|
|
|
}, 2000);
|
|
|
|
|
|
+
|
|
|
+function owoSocket(typeStr, options) {
|
|
|
+ const that = this
|
|
|
+ this.type = typeStr
|
|
|
+ let timeConnect = 0;
|
|
|
+
|
|
|
+ function reconnect(callBack) {
|
|
|
+ timeConnect++;
|
|
|
+ console.log("第" + timeConnect + "次重连");
|
|
|
+ // 普通连接
|
|
|
+ that.ws = new WebSocket('wss://ws.lamp.run')
|
|
|
+ that.ws.addEventListener('open', function (event) {
|
|
|
+ that.ws.send(JSON.stringify({"route": "login", "type": typeStr, "admin": options.isAdmin, "id": options.id}))
|
|
|
+ if (callBack) callBack()
|
|
|
+ if (options.onOpen) options.onOpen(that.ws)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ that.ws.onerror = function () {
|
|
|
+ console.error('服务器已经断开');
|
|
|
+ // 进行重连
|
|
|
+ setTimeout(function () {
|
|
|
+ reconnect();
|
|
|
+ }, 3000)
|
|
|
+ };
|
|
|
+ that.ws.addEventListener('message', function (event) {
|
|
|
+ const mess = JSON.parse(event.data)
|
|
|
+ if (mess.type === 'userInfo') {
|
|
|
+ that.wsUserInfo = mess.value
|
|
|
+ if (options.onReady) options.onReady(that.ws)
|
|
|
+ } else {
|
|
|
+ if (options.messageCallBack) options.messageCallBack(mess)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ reconnect()
|
|
|
+ this.send = function (route, value, sendTo) {
|
|
|
+ // 先判断连接是否关闭 如果关闭先重新连接
|
|
|
+ if (that.ws.readyState === 3) {
|
|
|
+ console.error('ws连接已断开正在重连!')
|
|
|
+ reconnect(()=> {
|
|
|
+ that.ws.send(JSON.stringify({"route": route, "type": typeStr, "userID": that.wsUserInfo.userID, "id": sendTo, "value": value}))
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ that.ws.send(JSON.stringify({"route": route, "type": typeStr, "userID": that.wsUserInfo.userID, "id": sendTo, "value": value}))
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+function searchItem(itemInfo, callBack) {
|
|
|
+ // 查找ID
|
|
|
+ window.logBox.add(`查找卡片:${itemInfo.assetId}`)
|
|
|
+ // window.logBox.add(`开始购买:${JSON.stringify(playerInfo)}`)
|
|
|
+ fetch(`https://utas.mob.v4.prd.futc-ext.gcp.ea.com/ut/game/fc26/transfermarket?num=21&start=0&type=player&maskedDefId=${itemInfo.assetId}&maxb=${itemInfo.buyNowPrice}`, {
|
|
|
+ "headers": {
|
|
|
+ "accept": "*/*",
|
|
|
+ "accept-language": "zh-CN",
|
|
|
+ "content-type": "application/json",
|
|
|
+ "x-ut-sid": window.activeID
|
|
|
+ },
|
|
|
+ "referrer": "https://www.ea.com/",
|
|
|
+ "body": null,
|
|
|
+ "method": "GET",
|
|
|
+ }).then((response) => response.json())
|
|
|
+ .then((result) => {
|
|
|
+ let resp = '搜索到列表:'
|
|
|
+ result.auctionInfo.forEach(element => {
|
|
|
+ resp += `[${element.itemData.id}]`
|
|
|
+ if(element.itemData.id == itemInfo.id) {
|
|
|
+ callBack(element.tradeId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ });
|
|
|
+ window.logBox.add(resp)
|
|
|
+ })
|
|
|
+ .catch((error) => console.error(error));
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+let wsOptions = {
|
|
|
+ isAdmin: true,
|
|
|
+ onReady: () => {
|
|
|
+ }
|
|
|
+}
|
|
|
+wsOptions.messageCallBack = (meg) => {
|
|
|
+ console.log(meg);
|
|
|
+ window.logBox.add(JSON.stringify(meg))
|
|
|
+ if (window.running) {
|
|
|
+ searchItem(meg.value, (tradeId) => {
|
|
|
+ window.logBox.add(`下单购买:${tradeId}`)
|
|
|
+ fetch(`https://utas.mob.v5.prd.futc-ext.gcp.ea.com/ut/game/fc26/trade/${tradeId}/bid`, {
|
|
|
+ "headers": {
|
|
|
+ "accept": "*/*",
|
|
|
+ "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
|
|
|
+ "content-type": "application/json",
|
|
|
+ "x-ut-sid": window.activeID
|
|
|
+ },
|
|
|
+ "referrer": "https://www.ea.com/",
|
|
|
+ "body": JSON.stringify({"bid": meg.value.buyNowPrice}),
|
|
|
+ "method": "PUT",
|
|
|
+ "mode": "cors",
|
|
|
+ "credentials": "omit"
|
|
|
+ }).then((response) => response.text())
|
|
|
+ .then((result) => {
|
|
|
+ if (result.includes('auctionInfo')) {
|
|
|
+ window.logBox.add(`${meg.value.id}购买成功!`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ window.logBox.add(result)
|
|
|
+ })
|
|
|
+ .catch((error) => console.error(error));
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+window.owoSocket = new owoSocket('eaGame', wsOptions)
|