steamutils 1.2.77 → 1.2.78
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +1 -1
- package/index.js +15 -5
- package/package.json +1 -1
package/SteamClient.js
CHANGED
package/index.js
CHANGED
@@ -15,7 +15,7 @@ import {getTableHasHeaders, table2json} from './cheerio.js'
|
|
15
15
|
import {getJSObjectFronXML} from './xml2json.js'
|
16
16
|
import axios from 'axios'
|
17
17
|
import url from 'url'
|
18
|
-
import * as
|
18
|
+
import * as cheerio from "cheerio";
|
19
19
|
import fs from "fs";
|
20
20
|
import FormData from "form-data";
|
21
21
|
|
@@ -2427,7 +2427,7 @@ class SteamUser {
|
|
2427
2427
|
}
|
2428
2428
|
|
2429
2429
|
_parsePendingFriendList(html, selector) {
|
2430
|
-
const $ =
|
2430
|
+
const $ = cheerio.load(html || '')
|
2431
2431
|
const data = []
|
2432
2432
|
$(selector).each(function () {
|
2433
2433
|
const el = $(this)
|
@@ -5691,7 +5691,7 @@ class SteamUser {
|
|
5691
5691
|
|
5692
5692
|
async getTradeURL() {
|
5693
5693
|
const result = await this._httpRequest(`${this.getMyProfileURL()}/tradeoffers/privacy`)
|
5694
|
-
const $ =
|
5694
|
+
const $ = cheerio.load(result?.data || '')
|
5695
5695
|
const trade_offer_access_url = $('#trade_offer_access_url').attr('value')
|
5696
5696
|
return trade_offer_access_url
|
5697
5697
|
}
|
@@ -5825,9 +5825,19 @@ class SteamUser {
|
|
5825
5825
|
}
|
5826
5826
|
const partnerSteamId = partner.split(`',`)[0].trim()
|
5827
5827
|
let partnerName = partner.split(`', "`)[1].trim();
|
5828
|
+
const playerAvatar = $1.find('.playerAvatar')
|
5829
|
+
const avatar = playerAvatar.find('img')?.attr('src')
|
5830
|
+
const link = playerAvatar.find('a')?.attr('href')
|
5831
|
+
const header = $1.find('.tradeoffer_header').text().replaceAll(/\t/g, ' ').replaceAll(/\s+/g, ' ').trim()
|
5832
|
+
const active = $1.find('.tradeoffer_items_ctn').hasClass("active")
|
5833
|
+
|
5828
5834
|
tradeOffers.push({
|
5829
5835
|
tradeofferid, partner: {
|
5830
|
-
steamId: partnerSteamId,
|
5836
|
+
steamId: partnerSteamId,
|
5837
|
+
name: partnerName,
|
5838
|
+
avatar,
|
5839
|
+
link,
|
5840
|
+
header,
|
5831
5841
|
},
|
5832
5842
|
})
|
5833
5843
|
}
|
@@ -6061,7 +6071,7 @@ class SteamUser {
|
|
6061
6071
|
url: `market/mylistings/render/?count=100`,
|
6062
6072
|
}))?.data
|
6063
6073
|
if (result?.success === true) {
|
6064
|
-
const $ =
|
6074
|
+
const $ = cheerio.load(result.results_html)
|
6065
6075
|
const list = []
|
6066
6076
|
$('.market_listing_row').each(function () {
|
6067
6077
|
try {
|