steamutils 1.0.80 → 1.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/steamutils.iml +1 -1
- package/.idea/vcs.xml +1 -1
- package/index.js +1275 -818
- package/package.json +1 -1
package/index.js
CHANGED
@@ -35,7 +35,7 @@ const FRIEND_CODE_REPLACEMENTS = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'm', '
|
|
35
35
|
const EPrivacyState = {
|
36
36
|
Private: 'Private',
|
37
37
|
FriendsOnly: 'FriendsOnly',
|
38
|
-
Public: 'Public'
|
38
|
+
Public: 'Public',
|
39
39
|
}
|
40
40
|
const EActivityType = Object.freeze({
|
41
41
|
newFriend: 'newFriend',
|
@@ -54,7 +54,7 @@ const PrivacySettings = {
|
|
54
54
|
gameDetails: 'Public',
|
55
55
|
playtime: 'Public',
|
56
56
|
friendsList: 'Public',
|
57
|
-
comment: 'Private'
|
57
|
+
comment: 'Private',
|
58
58
|
}
|
59
59
|
|
60
60
|
const EFriendRelationship = {
|
@@ -79,9 +79,89 @@ const EFriendRelationship = {
|
|
79
79
|
}
|
80
80
|
|
81
81
|
const EGroupRank = Object.freeze({
|
82
|
-
Owner: [
|
83
|
-
|
84
|
-
|
82
|
+
Owner: [
|
83
|
+
'Group Owner',
|
84
|
+
'Ιδιοκτήτης ομάδας',
|
85
|
+
'Groepseigenaar',
|
86
|
+
'Gruppeeier',
|
87
|
+
'Gruppeejer',
|
88
|
+
'Gruppenbesitzer',
|
89
|
+
'Владелец группы',
|
90
|
+
'Proprietarul grupului',
|
91
|
+
'Chủ sở hữu nhóm',
|
92
|
+
'Собственик на групата',
|
93
|
+
'Gruppägare',
|
94
|
+
'Propietario del grupo',
|
95
|
+
'Власник групи',
|
96
|
+
'Proprietario del gruppo',
|
97
|
+
'グループのオーナー',
|
98
|
+
'组所有者',
|
99
|
+
'群組擁有者',
|
100
|
+
'Vlastník skupiny',
|
101
|
+
'เจ้าของกลุ่ม',
|
102
|
+
'Grubun Sahibi',
|
103
|
+
'Dono do grupo',
|
104
|
+
'Proprietário do grupo',
|
105
|
+
'Właściciel grupy',
|
106
|
+
'Propriétaire du groupe',
|
107
|
+
'Omistaja',
|
108
|
+
'그룹 소유자',
|
109
|
+
'Csoporttulajdonos'],
|
110
|
+
Officer: [
|
111
|
+
'Group Officer',
|
112
|
+
'Διαχειριστής ομάδας',
|
113
|
+
'Groepsbeheerder',
|
114
|
+
'Gruppeoffiser',
|
115
|
+
'Gruppeofficer',
|
116
|
+
'Gruppenadministrator',
|
117
|
+
'Офицер группы',
|
118
|
+
'Ofițer de grup',
|
119
|
+
'Ủy viên nhóm',
|
120
|
+
'Офицер на групата',
|
121
|
+
'Gruppofficer',
|
122
|
+
'Oficial del grupo',
|
123
|
+
'Адміністратор групи',
|
124
|
+
'Amministratore del gruppo',
|
125
|
+
'グループの上級メンバー',
|
126
|
+
'组官员',
|
127
|
+
'群組幹部',
|
128
|
+
'Správce skupiny',
|
129
|
+
'เจ้าหน้าที่กลุ่ม',
|
130
|
+
'Grup Yetkilisi',
|
131
|
+
'Administrador do grupo',
|
132
|
+
'Oficial de Grupo',
|
133
|
+
'Oficer grupy',
|
134
|
+
'Responsable du groupe',
|
135
|
+
'Ylläpitäjä',
|
136
|
+
'그룹 임원',
|
137
|
+
'Csoport-elöljáró'],
|
138
|
+
Moderator: [
|
139
|
+
'Group Moderator',
|
140
|
+
'Συντονιστής ομάδας',
|
141
|
+
'Groepsmoderator',
|
142
|
+
'Gruppemoderator',
|
143
|
+
'Gruppenmoderator',
|
144
|
+
'Модератор группы',
|
145
|
+
'Moderator de grup',
|
146
|
+
'Điều hành viên nhóm',
|
147
|
+
'Модератор на групата',
|
148
|
+
'Gruppmoderator',
|
149
|
+
'Moderador del grupo',
|
150
|
+
'Модератор групи',
|
151
|
+
'Moderatore del gruppo',
|
152
|
+
'グループのモデレーター',
|
153
|
+
'组版主',
|
154
|
+
'群組板務',
|
155
|
+
'Moderátor skupiny',
|
156
|
+
'ผู้ช่วยดูแลกลุ่ม',
|
157
|
+
'Grup Moderatörü',
|
158
|
+
'Moderador do grupo',
|
159
|
+
'Moderador de Grupo',
|
160
|
+
'Moderator grupy',
|
161
|
+
'Modération du groupe',
|
162
|
+
'Valvoja',
|
163
|
+
'그룹 모더레이터',
|
164
|
+
'Csoportmoderátor'],
|
85
165
|
})
|
86
166
|
|
87
167
|
const ELanguage = Object.freeze({
|
@@ -112,19 +192,309 @@ const ELanguage = Object.freeze({
|
|
112
192
|
french: 'french',
|
113
193
|
finnish: 'finnish',
|
114
194
|
koreana: 'koreana',
|
115
|
-
hungarian: 'hungarian'
|
195
|
+
hungarian: 'hungarian',
|
116
196
|
})
|
117
197
|
|
118
|
-
export const NotYetSetupProfileTextList = Object.freeze([
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
198
|
+
export const NotYetSetupProfileTextList = Object.freeze([
|
199
|
+
'This user has not yet set up their Steam Community profile.If you know this person, encourage them to set up their profile and join in the gaming!',
|
200
|
+
'Αυτός ο χρήστης δεν έχει ρυθμίσει το προφίλ του στην Κοινότητα του Steam.Αν τον γνωρίζετε, ενθαρρύνετέ τον να στήσει το προφίλ του και να συμμετάσχει στο παιχνίδι!',
|
201
|
+
'Deze gebruiker heeft nog geen Steam-communityprofiel.Als je deze persoon kent, moedig hem of haar dan aan om een profiel te maken en deel te nemen aan de gamingcommunity!',
|
202
|
+
'Denne brukeren har ikke satt opp Steam-samfunnsprofilen.Hvis du kjenner denne personen, kan du oppmuntre vedkommende til å sette opp profilen og bli med på spillingen!',
|
203
|
+
'Denne bruger har endnu ikke tilpasset sin profil på Steam-fællesskabet.Hvis du kender vedkommende, så få dem til at tilpasse deres profil og deltage i spilfællesskabet!',
|
204
|
+
'Diese Person hat ihr Steam-Communityprofil noch nicht eingerichtet.Wenn Sie diese Person kennen, fordern Sie sie doch auf, ihr Profil einzurichten und an der Spielecommunity teilzunehmen!',
|
205
|
+
'Этот пользователь ещё не настроил свой профиль в сообществе Steam.Если вы знакомы, посоветуйте ему настроить профиль, чтобы играть вместе!',
|
206
|
+
'Acest utilizator nu și-a configurat încă profilul din comunitatea Steam.Dacă cunoști această persoană, încurajeaz-o să-și configureze un profil și să se alăture comunității!',
|
207
|
+
'Người dùng này vẫn chưa thiết lập hồ sơ cộng đồng Steam.Nếu là người bạn quen, hãy khuyến khích người ấy thiết lập hồ sơ và cùng chơi!',
|
208
|
+
'Този потребител все още не е настроил своя профил за Steam общността.Ако познавате това лице, насърчете го да установи своя профил и да се присъедини към игралното преживяване!',
|
209
|
+
'Den här användaren har inte lagt upp sin gemenskapsprofil på Steam.Uppmuntra hen att lägga upp en profil och börja spela, om du känner personen!',
|
210
|
+
'Este/a usuario/a aún no ha configurado su perfil de la Comunidad Steam.Si conoces a esta persona, anímala a configurar su perfil para unirse a la fiesta.',
|
211
|
+
'Este usuario aún no ha configurado su perfil de la Comunidad Steam.Si lo conoces, anímale a configurar su perfil para unirse a la fiesta.',
|
212
|
+
'This user has not yet set up their Steam Community profile.If you know this person, encourage them to set up their profile and join in the gaming!',
|
213
|
+
'Цей користувач ще не налаштував свій профіль спільноти Steam. Якщо ви знайомі, то порадьте йому/їй налаштувати свій профіль і почати грати!',
|
214
|
+
'Questo utente non ha ancora configurato il suo profilo della Comunità di Steam.Se lo conosci, invitalo a configurare il suo profilo e unirsi al divertimento!',
|
215
|
+
'このユーザーはまだSteamコミュニティのプロフィールを作成していません。このユーザーを知っている場合は、プロフィールを作成してゲーマーとして参加するよう伝えてみましょう。',
|
216
|
+
'此用户尚未设置自己的 Steam 社区个人资料。如果您认识此人,请鼓励对方设置个人资料并加入到游戏当中!',
|
217
|
+
'這位使用者尚未設定 Steam 社群個人檔案。如果您認識對方,請鼓勵他設定個人檔案,並加入遊戲世界!',
|
218
|
+
'Tento uživatel si zatím nenastavil svůj profil v komunitě služby Steam.Pokud tohoto uživatele znáte, napište mu, aby si nastavil svůj profil a stal se tak opravdovým členem komunity!',
|
219
|
+
'ผู้ใช้นี้ยังไม่ได้ตั้งค่าโปรไฟล์ชุมชน Steamหากคุณรู้จักผู้ใช้นี้ บอกให้เขาตั้งค่าโปรไฟล์ แล้วมาเล่นเกมด้วยกัน!',
|
220
|
+
'Bu kullanıcı Steam Topluluğu profilini henüz oluşturmadı.Eğer bu kullanıcıyı tanıyorsanız, profilini oluşturmasını ve oyun dünyasına katılmasını sağlayın!',
|
221
|
+
'Esse(a) usuário(a) ainda não criou um perfil da Comunidade Steam.Caso o(a) conheça, encoraje-o(a) a criá-lo e jogar com você!',
|
222
|
+
'Esta pessoa ainda não configurou o seu perfil na Comunidade Steam.Se conheces esta pessoa, encoraja-a a configurar um perfil e a jogar contigo!',
|
223
|
+
'Ten użytkownik jeszcze nie uzupełnił swojego profilu Społeczności Steam.Jeżeli to twój znajomy, zachęć go, żeby to zrobił.',
|
224
|
+
'Cette personne n’a pas encore de profil dans la communauté Steam.Si vous la connaissez, encouragez-la à créer un profil et à rejoindre des parties !',
|
225
|
+
'Käyttäjä ei ole vielä luonut Steam-yhteisön profiilia.Jos tunnet hänet, kehota häntä luomaan profiili ja liittymään peliyhteisöön.',
|
226
|
+
'이 사용자는 아직 Steam 커뮤니티 프로필을 설정하지 않았습니다.이 사용자를 알고 계시면 프로필을 설정하고 게임에 참가하도록 권해 주십시오!',
|
227
|
+
'Ez a felhasználó még nem állította be Steam közösségi profilját.Ha az ismerősöd, bátorítsd, hogy állítsa be profilját, és vegyen részt a játékban!'])
|
228
|
+
export const PrivateProfileTextList = Object.freeze([
|
229
|
+
'This profile is private.',
|
230
|
+
'Αυτό το προφίλ είναι ιδιωτικό.',
|
231
|
+
'Dit is een privéprofiel',
|
232
|
+
'Denne profilen er privat.',
|
233
|
+
'Denne profil er privat.',
|
234
|
+
'Dieses Profil ist privat.',
|
235
|
+
'Профиль скрыт',
|
236
|
+
'Acest profil este privat.',
|
237
|
+
'Hồ sơ này không công khai.',
|
238
|
+
'Този профил е личен.',
|
239
|
+
'Den här profilen är privat.',
|
240
|
+
'Este perfil es privado.',
|
241
|
+
'Este perfil es privado.',
|
242
|
+
'This profile is private.',
|
243
|
+
'Профіль приховано',
|
244
|
+
'Questo profilo è privato.',
|
245
|
+
'プロフィールは非公開に設定されています。',
|
246
|
+
'此个人资料是私密的。',
|
247
|
+
'此個人檔案未公開。',
|
248
|
+
'Tento profil je soukromý.',
|
249
|
+
'โปรไฟล์นี้เป็นโปรไฟล์ส่วนตัว',
|
250
|
+
'Bu profil gizlidir.',
|
251
|
+
'Este perfil é privado.',
|
252
|
+
'Este perfil é privado.',
|
253
|
+
'Ten profil jest prywatny.',
|
254
|
+
'Ce profil est privé.',
|
255
|
+
'Tämä profiili on yksityinen.',
|
256
|
+
'이 프로필은 비공개입니다.',
|
257
|
+
'Privát profil.'])
|
258
|
+
const ErrorProcessingRequest = Object.freeze([
|
259
|
+
'An error was encountered while processing your request:',
|
260
|
+
'Παρουσιάστηκε σφάλμα κατά την επεξεργασία του αιτήματός σας:',
|
261
|
+
'Er is een fout opgetreden bij het verwerken van je verzoek.',
|
262
|
+
'Det oppstod en feil under behandling av forespørselen:',
|
263
|
+
'Der skete en fejl ved behandling af din forespørgsel:',
|
264
|
+
'Bei der Verarbeitung Ihrer Anfrage ist ein Fehler aufgetreten:',
|
265
|
+
'При обработке вашего запроса произошла ошибка:',
|
266
|
+
'A apărut o eroare în timpul procesării:',
|
267
|
+
'Đã có lỗi xảy ra trong quá trình xử lí yêu cầu của bạn:',
|
268
|
+
'Възникна грешка, докато обработвахме заявката Ви:',
|
269
|
+
'Ett fel uppstod när din begäran behandlades:',
|
270
|
+
'Se ha producido un error mientras se procesaba la solicitud:',
|
271
|
+
'Se ha producido un error mientras se procesaba la solicitud:',
|
272
|
+
'An error was encountered while processing your request:',
|
273
|
+
'Під час обробки вашого запиту сталася помилка:',
|
274
|
+
'Si è verificato un errore durante l\'elaborazione della tua richiesta:',
|
275
|
+
'リクエストの処理中にエラーが発生しました。',
|
276
|
+
'处理您的请求时遇到错误:',
|
277
|
+
'處理您的要求時發生錯誤:',
|
278
|
+
'Při zpracovávání Vašeho požadavku došlo k chybě:',
|
279
|
+
'ตรวจพบข้อผิดพลาดขณะกำลังประมวลผลคำร้องขอของคุณ:',
|
280
|
+
'İşleminiz sırasında bir hata meydana geldi:',
|
281
|
+
'Ocorreu um erro ao processar a sua solicitação:',
|
282
|
+
'Foi encontrado um erro ao processar o pedido',
|
283
|
+
'Wystąpił błąd przetwarzania żądania użytkownika:',
|
284
|
+
'Une erreur est survenue lors du traitement de votre requête :',
|
285
|
+
'Pyyntösi käsittelyssä tapahtui virhe:',
|
286
|
+
'요청을 처리하는 동안 오류가 발생했습니다.',
|
287
|
+
'Hiba lépett fel a kérésed feldolgozása közben:'])
|
288
|
+
export const EmptyProfileSummary = Object.freeze([
|
289
|
+
'No information given.',
|
290
|
+
'Δεν έχουν δοθεί πληροφορίες.',
|
291
|
+
'Geen informatie gegeven.',
|
292
|
+
'Ingen informasjon oppgitt.',
|
293
|
+
'Ingen oplysninger.',
|
294
|
+
'Keine Informationen angegeben.',
|
295
|
+
'Информация отсутствует.',
|
296
|
+
'Nicio informație oferită.',
|
297
|
+
'Không có thông tin nào được cấp.',
|
298
|
+
'Няма предоставена информация.',
|
299
|
+
'Information saknas.',
|
300
|
+
'No se ha proporcionado información.',
|
301
|
+
'No se ha proporcionado información.',
|
302
|
+
'No information given.',
|
303
|
+
'Не надано жодної інформації.',
|
304
|
+
'Nessuna informazione.',
|
305
|
+
'情報が指定されていません。',
|
306
|
+
'未提供信息。',
|
307
|
+
'未提供任何資訊。',
|
308
|
+
'Nebyly zadány žádné informace.',
|
309
|
+
'ไม่ระบุข้อมูล',
|
310
|
+
'Herhangi bir bilgi verilmedi.',
|
311
|
+
'Nada informado.',
|
312
|
+
'Sem informações.',
|
313
|
+
'Nie podano informacji.',
|
314
|
+
'Aucune information disponible.',
|
315
|
+
'Ei tietoja.',
|
316
|
+
'관련 정보가 없습니다.',
|
317
|
+
'Nincs információ.'])
|
318
|
+
const ECurrentlyTradeBanned = Object.freeze([
|
319
|
+
'Currently trade banned',
|
320
|
+
'Αποκλεισμένος από ανταλλαγές',
|
321
|
+
'Heeft momenteel ruilban',
|
322
|
+
'For øyeblikket utestengt fra byttehandel',
|
323
|
+
'I øjeblikket udelukket fra at bytte',
|
324
|
+
'Zurzeit vom Handel ausgeschlossen',
|
325
|
+
'Заблокирован в системе обмена',
|
326
|
+
'În prezent, abilitate de schimb este banată',
|
327
|
+
'Hiện đang bị cấm trao đổi',
|
328
|
+
'Понастоящем със забрана за търгуване',
|
329
|
+
'Har för närvarande bytesförbud',
|
330
|
+
'Intercambio actualmente bloqueado',
|
331
|
+
'Intercambio actualmente bloqueado',
|
332
|
+
'Currently trade banned',
|
333
|
+
'Наразі обмін заблоковано',
|
334
|
+
'Attualmente bandito dagli scambi',
|
335
|
+
'現在トレード禁止',
|
336
|
+
'当前已禁止交易',
|
337
|
+
'目前已遭交易封鎖',
|
338
|
+
'Momentálně má zakázáno obchodovat',
|
339
|
+
'ถูกแบนการแลกเปลี่ยนอยู่ในขณะนี้',
|
340
|
+
'Şu anda takas yasaklı',
|
341
|
+
'Banido de trocar',
|
342
|
+
'Banido do sistema de trocas',
|
343
|
+
'Wymiana obecnie zablokowana',
|
344
|
+
'Actuellement interdit d\'échange',
|
345
|
+
'Vaihtokiellossa',
|
346
|
+
'거래 차단 상태',
|
347
|
+
'Jelenleg kitiltva a cseréből'])
|
348
|
+
const E1VACBanOnRecord = Object.freeze([
|
349
|
+
'1 VAC ban on record | Info',
|
350
|
+
'1 αποκλεισμός VAC στο αρχείο | Πληροφορίες',
|
351
|
+
'1 vastgelegde VAC-verbanning | Info',
|
352
|
+
'1 VAC-utestengelse registrert | Info',
|
353
|
+
'1 VAC-udelukkelse registreret | Info',
|
354
|
+
'1 VAC-Ausschluss | Informationen',
|
355
|
+
'1 блокировка VAC | Подробнее',
|
356
|
+
'1 banare VAC înregistrată | Informații',
|
357
|
+
'1 lệnh cấm VAC được ghi nhận | Thông tin',
|
358
|
+
'1 вписана VAC забрана | Информация',
|
359
|
+
'1 registrerad VAC-avstängning | Info',
|
360
|
+
'1 bloqueo por VAC registrado | Detalles',
|
361
|
+
'1 bloqueo por VAC registrado | Detalles',
|
362
|
+
'1 VAC ban on record | Info',
|
363
|
+
'1 зареєстроване блокування VAC | Інформація',
|
364
|
+
'1 ban VAC registrato | Informazioni',
|
365
|
+
'1 件の VAC 検出記録 | 情報',
|
366
|
+
'1 个记录在案的 VAC 封禁 | 信息',
|
367
|
+
'1 個 VAC 封鎖紀錄 | 資訊',
|
368
|
+
'1 ban ochrany VAC | Informace',
|
369
|
+
'VAC แบน 1 ครั้ง ในบันทึก | ข้อมูล',
|
370
|
+
'Kayıtlarda 1 VAC yasaklanması | Bilgi',
|
371
|
+
'1 banimento VAC em registro | Informações',
|
372
|
+
'1 banimento do VAC em registo | Informações',
|
373
|
+
'1 zarejestrowana blokada VAC | Informacje',
|
374
|
+
'1 bannissement VAC enregistré | Infos',
|
375
|
+
'1 VAC-kielto merkitty | Tietoa',
|
376
|
+
'VAC 차단 기록 1건 | 정보',
|
377
|
+
'1 feljegyzett VAC-kitiltás | Információ'])
|
378
|
+
const EMultipleVACBansOnRecord = Object.freeze([
|
379
|
+
'Multiple VAC bans on record | Info',
|
380
|
+
'Πολλαπλοί αποκλεισμοί VAC στο αρχείο | Πληροφορίες',
|
381
|
+
'Meerdere vastgelegde VAC-bans | Info',
|
382
|
+
'Flere VAC-utestengelser registrert | Info',
|
383
|
+
'Adskillige VAC-udelukkelser registreret | Info',
|
384
|
+
'Mehrere VAC-Ausschlüsse | Informationen',
|
385
|
+
'Несколько блокировок VAC | Подробнее',
|
386
|
+
'Multiple banări VAC înregistrate | Informații',
|
387
|
+
'Nhiều lệnh cấm VAC được ghi nhận | Thông tin',
|
388
|
+
'Множество VAC забрани | Информация',
|
389
|
+
'Flera registrerade VAC-avstängningar | Info',
|
390
|
+
'Varios bloqueos por VAC registrados | Detalles',
|
391
|
+
'Varios bloqueos por VAC registrados | Detalles',
|
392
|
+
'Multiple VAC bans on record | Info',
|
393
|
+
'Декілька зареєстрованих блокувань VAC | Інформація',
|
394
|
+
'Più ban VAC registrati | Informazioni',
|
395
|
+
'複数の VAC 検出記録 | 情報',
|
396
|
+
'多个记录在案的 VAC 封禁 | 信息',
|
397
|
+
'多個 VAC 封鎖紀錄 | 資訊',
|
398
|
+
'Více banů ochrany VAC | Informace',
|
399
|
+
'VAC แบนหลายครั้ง ในบันทึก | ข้อมูล',
|
400
|
+
'Kayıtlarda birden fazla VAC yasaklanması | Bilgi',
|
401
|
+
'Vários banimentos VAC em registro | Informações',
|
402
|
+
'Vários banimentos do VAC em registo | Informações',
|
403
|
+
'Wiele zarejestrowanych blokad VAC | Informacje',
|
404
|
+
'Plusieurs bannissements VAC enregistrés | Infos',
|
405
|
+
'Useita VAC-kieltoja merkitty | Tietoa',
|
406
|
+
'다수의 VAC 차단 기록 | 정보',
|
407
|
+
'Több feljegyzett VAC-kitiltás | Információ'])
|
408
|
+
const E1GameBanOnRecord = Object.freeze([
|
409
|
+
'1 game ban on record | Info',
|
410
|
+
'1 αποκλεισμός παιχνιδιού στο αρχείο | Πληροφορίες',
|
411
|
+
'1 vastgelegde spelverbanning | Info',
|
412
|
+
'1 spillutestengelse registrert | Info',
|
413
|
+
'1 spiludelukkelse registreret | Info',
|
414
|
+
'1 Spielausschluss | Informationen',
|
415
|
+
'1 игровая блокировка | Подробнее',
|
416
|
+
'1 banare de joc înregistrată | Informații',
|
417
|
+
'1 lệnh cấm trò chơi được ghi nhận | Thông tin',
|
418
|
+
'1 игрална забрана | Информация',
|
419
|
+
'1 registrerad spelavstängning | Info',
|
420
|
+
'1 bloqueo en juego registrado | Detalles',
|
421
|
+
'1 bloqueo en juego registrado | Detalles',
|
422
|
+
'1 game ban on record | Info',
|
423
|
+
'1 зареєстроване блокування у грі | Інформація',
|
424
|
+
'1 ban di gioco registrato | Informazioni',
|
425
|
+
'1 件のゲーム禁止記録 | 情報',
|
426
|
+
'1 个记录在案的游戏封禁 | 信息',
|
427
|
+
'1 個遊戲封鎖紀錄 | 資訊',
|
428
|
+
'1 herní ban | Informace',
|
429
|
+
'เกมแบน 1 ครั้ง ในบันทึก | ข้อมูล',
|
430
|
+
'Kayıtlarda 1 oyun yasaklanması | Bilgi',
|
431
|
+
'1 banimento de jogo em registro | Informações',
|
432
|
+
'1 banimento de jogo em registo | Informações',
|
433
|
+
'1 zarejestrowana blokada na grę | Informacje',
|
434
|
+
'1 bannissement en jeu enregistré | Infos',
|
435
|
+
'1 pelikielto merkitty | Tietoa',
|
436
|
+
'게임 차단 기록 1건 | 정보',
|
437
|
+
'1 feljegyzett játékkitiltás | Információ'])
|
438
|
+
const EMultipleGameBansOnRecord = Object.freeze([
|
439
|
+
'Multiple game bans on record | Info',
|
440
|
+
'Πολλαπλοί αποκλεισμοί παιχνιδιών στο αρχείο | Πληροφορίες',
|
441
|
+
'Meerdere vastgelegde spelbans | Info',
|
442
|
+
'Flere spillutestengelser registrert | Info',
|
443
|
+
'Adskillige spiludelukkelser registreret | Info',
|
444
|
+
'Mehrere Spielausschlüsse | Informationen',
|
445
|
+
'Несколько игровых блокировок | Подробнее',
|
446
|
+
'Multiple banări de joc înregistrate | Informații',
|
447
|
+
'Nhiều lệnh cấm trò chơi được ghi nhận | Thông tin',
|
448
|
+
'Множество игрални забрани | Информация',
|
449
|
+
'Flera registrerade spelavstängningar | Info',
|
450
|
+
'Varios bloqueos en juegos registrados | Detalles',
|
451
|
+
'Varios bloqueos en juegos registrados | Detalles',
|
452
|
+
'Multiple game bans on record | Info',
|
453
|
+
'Декілька зареєстрованих блокувань в іграх | Інформація',
|
454
|
+
'Più ban di gioco registrati | Informazioni',
|
455
|
+
'複数のゲーム禁止記録 | 情報',
|
456
|
+
'多个记录在案的游戏封禁 | 信息',
|
457
|
+
'多個遊戲封鎖紀錄 | 資訊',
|
458
|
+
'Více herních banů | Informace',
|
459
|
+
'เกมแบนหลายครั้ง ในบันทึก | ข้อมูล',
|
460
|
+
'Kayıtlarda birden fazla oyun yasaklanması | Bilgi',
|
461
|
+
'Vários banimentos de jogos em registro | Informações',
|
462
|
+
'Vários banimentos de jogos em registo | Informações',
|
463
|
+
'Wiele zarejestrowanych blokad na gry | Informacje',
|
464
|
+
'Plusieurs bannissements en jeu enregistrés | Infos',
|
465
|
+
'Useita pelikieltoja merkitty | Tietoa',
|
466
|
+
'다수의 게임 차단 기록 | 정보',
|
467
|
+
'Több feljegyzett játékkitiltás | Információ'])
|
468
|
+
const EdaySinceLastBanRegExp = Object.freeze([
|
469
|
+
'(\\d+) day\\(s\\) since last ban',
|
470
|
+
'(\\d+) μέρες από τον τελευταίο αποκλεισμό',
|
471
|
+
'(\\d+) dag\\(en\\) sinds vorige ban',
|
472
|
+
'(\\d+) dag\\(er\\) siden siste utestengelse',
|
473
|
+
'(\\d+) dag\\(e\\) siden sidste udelukkelse.',
|
474
|
+
'(\\d+) Tag\\(e\\) seit dem letzten Ausschluss',
|
475
|
+
'Дней с последней блокировки: (\\d+)',
|
476
|
+
'(\\d+) zi\\(le\\) de la ultima banare',
|
477
|
+
'(\\d+) ngày từ lần cấm cuối',
|
478
|
+
'(\\d+) ден\\(дни\\) от последна забрана',
|
479
|
+
'(\\d+) dag\\(ar\\) sedan senaste avstängning',
|
480
|
+
'(\\d+) día\\(s\\) desde su último bloqueo',
|
481
|
+
'(\\d+) día\\(s\\) desde su último bloqueo',
|
482
|
+
'(\\d+) day\\(s\\) since last ban',
|
483
|
+
'Днів з моменту останнього блокування: (\\d+)',
|
484
|
+
'(\\d+) giorno/i dall\'ultimo ban',
|
485
|
+
'最後の接続禁止から (\\d+) 日',
|
486
|
+
'上次封禁于 (\\d+) 天前',
|
487
|
+
'距離上次封鎖共 (\\d+) 天',
|
488
|
+
'Poslední ban byl uvalen před (\\d+) dny',
|
489
|
+
'(\\d+) วัน นับตั้งแต่วันที่ถูกแบนครั้งล่าสุด',
|
490
|
+
'En son (\\d+) gün önce yasaklandı',
|
491
|
+
'(\\d+) dia\\(s\\) desde o último banimento',
|
492
|
+
'(\\d+) dia\\(s\\) desde o último ban',
|
493
|
+
'Dni od ostatniej blokady: (\\d+)',
|
494
|
+
'(\\d+) jour\\(s\\) depuis le dernier bannissement',
|
495
|
+
'(\\d+) päivä\\(ä\\) viime kiellosta',
|
496
|
+
'마지막 차단 이후 (\\d+)일 경과',
|
497
|
+
'(\\d+) nap az utolsó kitiltás óta'])
|
128
498
|
const SteamImageCDN = ['community.cloudflare.steamstatic.com', 'community.akamai.steamstatic.com'].map(cdn => `https://${cdn}`)
|
129
499
|
|
130
500
|
class SteamUser {
|
@@ -133,22 +503,22 @@ class SteamUser {
|
|
133
503
|
static _EPrivacyState = Object.freeze({
|
134
504
|
Private: 1,
|
135
505
|
FriendsOnly: 2,
|
136
|
-
Public: 3
|
506
|
+
Public: 3,
|
137
507
|
})
|
138
508
|
|
139
509
|
static _ECommentPrivacyState = Object.freeze({
|
140
510
|
Private: 2,
|
141
511
|
FriendsOnly: 0,
|
142
|
-
Public: 1
|
512
|
+
Public: 1,
|
143
513
|
})
|
144
514
|
|
145
|
-
constructor(cookies, steamMachineAuth) {
|
515
|
+
constructor (cookies, steamMachineAuth) {
|
146
516
|
this.setCookies(cookies, steamMachineAuth)
|
147
517
|
}
|
148
518
|
|
149
|
-
setSteamLanguage(language) {
|
519
|
+
setSteamLanguage (language) {
|
150
520
|
language = language?.toLowerCase()
|
151
|
-
if(!Object.hasOwn(ELanguage, language)) {
|
521
|
+
if (!Object.hasOwn(ELanguage, language)) {
|
152
522
|
return
|
153
523
|
}
|
154
524
|
this.Steam_Language = language
|
@@ -158,8 +528,8 @@ class SteamUser {
|
|
158
528
|
})
|
159
529
|
}
|
160
530
|
|
161
|
-
setCookies(cookies, _steamMachineAuth) {
|
162
|
-
if(!cookies) {
|
531
|
+
setCookies (cookies, _steamMachineAuth) {
|
532
|
+
if (!cookies) {
|
163
533
|
return
|
164
534
|
}
|
165
535
|
cookies = Array.isArray(cookies) ? cookies.join(';') : cookies
|
@@ -173,10 +543,10 @@ class SteamUser {
|
|
173
543
|
sessionid,
|
174
544
|
} = SteamUser.parseCookie(cookies)
|
175
545
|
|
176
|
-
if(!steamMachineAuth && _steamMachineAuth) {
|
546
|
+
if (!steamMachineAuth && _steamMachineAuth) {
|
177
547
|
steamMachineAuth = _steamMachineAuth
|
178
548
|
}
|
179
|
-
if(!sessionid) {
|
549
|
+
if (!sessionid) {
|
180
550
|
sessionid = SteamUser.generateSessionID()
|
181
551
|
}
|
182
552
|
|
@@ -198,8 +568,8 @@ class SteamUser {
|
|
198
568
|
this._steamRememberLogin = steamRememberLogin
|
199
569
|
}
|
200
570
|
|
201
|
-
static parseCookie(cookies) {
|
202
|
-
if(!Array.isArray(cookies)) {
|
571
|
+
static parseCookie (cookies) {
|
572
|
+
if (!Array.isArray(cookies)) {
|
203
573
|
cookies = cookies.split(';')
|
204
574
|
}
|
205
575
|
cookies = cookies.map(c => decodeURIComponent(c.trim()))
|
@@ -208,10 +578,10 @@ class SteamUser {
|
|
208
578
|
const Steam_Language = cookies.find(c => c.startsWith('Steam_Language'))?.substringAfter('=')
|
209
579
|
|
210
580
|
let steamID = cookies.find(c => c.startsWith('steamRememberLogin='))?.substringBetween('=', '||')
|
211
|
-
if(!steamID) {
|
581
|
+
if (!steamID) {
|
212
582
|
//multiple steamMachineAuth for multiple steamID
|
213
583
|
//steamID = cookies.find(c => c.startsWith('steamMachineAuth'))?.substringBetween('steamMachineAuth', '=')
|
214
|
-
if(!steamID) {
|
584
|
+
if (!steamID) {
|
215
585
|
steamID = cookies.find(c => c.startsWith('steamLoginSecure='))?.substringBetween('=', '||')
|
216
586
|
}
|
217
587
|
}
|
@@ -231,7 +601,7 @@ class SteamUser {
|
|
231
601
|
}
|
232
602
|
}
|
233
603
|
|
234
|
-
static generateCookie({
|
604
|
+
static generateCookie ({
|
235
605
|
steamMachineAuth,
|
236
606
|
steamLoginSecure,
|
237
607
|
steamRememberLogin,
|
@@ -239,34 +609,39 @@ class SteamUser {
|
|
239
609
|
sessionid,
|
240
610
|
Steam_Language,
|
241
611
|
}) {
|
242
|
-
return [
|
612
|
+
return [
|
613
|
+
steamLoginSecure && `steamLoginSecure=${steamID}||${steamLoginSecure}`,
|
614
|
+
steamMachineAuth && `steamMachineAuth${steamID}=${steamMachineAuth}`,
|
615
|
+
steamRememberLogin !== undefined ? `steamRememberLogin=${steamID}||${steamRememberLogin}` : steamRememberLogin,
|
616
|
+
sessionid && `sessionid=${sessionid}`,
|
617
|
+
Steam_Language && `Steam_Language=${Steam_Language}`].filter(Boolean).join(';')
|
243
618
|
}
|
244
619
|
|
245
|
-
getCookies() {
|
620
|
+
getCookies () {
|
246
621
|
return this._cookies
|
247
622
|
}
|
248
623
|
|
249
|
-
getSteamidUser() {
|
624
|
+
getSteamidUser () {
|
250
625
|
return this._steamid_user
|
251
626
|
}
|
252
627
|
|
253
|
-
getMiniProfileUser() {
|
628
|
+
getMiniProfileUser () {
|
254
629
|
return this._miniprofile_user
|
255
630
|
}
|
256
631
|
|
257
|
-
getSessionid() {
|
632
|
+
getSessionid () {
|
258
633
|
return this._sessionid
|
259
634
|
}
|
260
635
|
|
261
|
-
getSteamMachineAuth() {
|
636
|
+
getSteamMachineAuth () {
|
262
637
|
return this._steamMachineAuth
|
263
638
|
}
|
264
639
|
|
265
|
-
getSteamUserProfileURL(steamID = this.getSteamidUser()) {
|
640
|
+
getSteamUserProfileURL (steamID = this.getSteamidUser()) {
|
266
641
|
return `profiles/${steamID}`
|
267
642
|
}
|
268
643
|
|
269
|
-
getMySteamUserProfileURL() {
|
644
|
+
getMySteamUserProfileURL () {
|
270
645
|
return this.getSteamUserProfileURL()
|
271
646
|
}
|
272
647
|
|
@@ -277,11 +652,11 @@ class SteamUser {
|
|
277
652
|
* */
|
278
653
|
|
279
654
|
|
280
|
-
async getUserSummary(steamID = this.getSteamidUser(), parts = []) {
|
655
|
+
async getUserSummary (steamID = this.getSteamidUser(), parts = []) {
|
281
656
|
return await SteamUser.getUserSummary(steamID, parts, this.getCookies())
|
282
657
|
}
|
283
658
|
|
284
|
-
static async getUserSummary(steamID, parts = [], cookie = null) {
|
659
|
+
static async getUserSummary (steamID, parts = [], cookie = null) {
|
285
660
|
const xmlMap = {
|
286
661
|
name: null,
|
287
662
|
realname: null,
|
@@ -336,12 +711,12 @@ class SteamUser {
|
|
336
711
|
const mustFetchFromURL = parts.length === 0 || parts.some(key => !Object.hasOwn(xmlMap, key))//because xml not have some parts
|
337
712
|
let mustFetchFromXML = parts.length === 0 || parts.some(key => !Object.hasOwn(profileMap, key))//because profile not have some parts
|
338
713
|
|
339
|
-
if(!mustFetchFromURL && !mustFetchFromXML) {
|
714
|
+
if (!mustFetchFromURL && !mustFetchFromXML) {
|
340
715
|
mustFetchFromXML = true
|
341
716
|
}
|
342
717
|
|
343
718
|
const queue = []
|
344
|
-
if(mustFetchFromURL) {
|
719
|
+
if (mustFetchFromURL) {
|
345
720
|
queue.push((async function () {
|
346
721
|
try {
|
347
722
|
const result = (await request({
|
@@ -349,54 +724,54 @@ class SteamUser {
|
|
349
724
|
headers: { ...cookie && { cookie } },
|
350
725
|
})).data
|
351
726
|
return SteamUser._parseUserProfile(result) || 'Error'
|
352
|
-
} catch(e) {
|
727
|
+
} catch (e) {
|
353
728
|
}
|
354
729
|
})())
|
355
730
|
}
|
356
|
-
if(mustFetchFromXML) {
|
731
|
+
if (mustFetchFromXML) {
|
357
732
|
queue.push((async function () {
|
358
733
|
try {
|
359
734
|
const resultXml = await SteamUser._httpRequestXML(`https://steamcommunity.com/profiles/${steamID}/?xml=1`)
|
360
735
|
return await SteamUser._parseSummaryFromXML(resultXml)
|
361
|
-
} catch(e) {
|
736
|
+
} catch (e) {
|
362
737
|
}
|
363
738
|
})())
|
364
739
|
}
|
365
740
|
|
366
741
|
const results = await Promise.all(queue)
|
367
742
|
return results.reduce(function (previousValue, currentValue) {
|
368
|
-
if(previousValue === 'Invalid' || currentValue === 'Invalid') {
|
743
|
+
if (previousValue === 'Invalid' || currentValue === 'Invalid') {
|
369
744
|
return 'Invalid'
|
370
745
|
}
|
371
|
-
if(previousValue === 'Error' || currentValue === 'Error') {
|
746
|
+
if (previousValue === 'Error' || currentValue === 'Error') {
|
372
747
|
return 'Error'
|
373
748
|
}
|
374
749
|
|
375
750
|
//order : undefined, null, '', Boolean
|
376
|
-
for(const key in currentValue) {
|
751
|
+
for (const key in currentValue) {
|
377
752
|
let previousValueOrder = 0
|
378
|
-
if(previousValue[key] === undefined) {
|
753
|
+
if (previousValue[key] === undefined) {
|
379
754
|
previousValueOrder = 0
|
380
|
-
} else if(previousValue[key] === null) {
|
755
|
+
} else if (previousValue[key] === null) {
|
381
756
|
previousValueOrder = 1
|
382
|
-
} else if(previousValue[key] === '') {
|
757
|
+
} else if (previousValue[key] === '') {
|
383
758
|
previousValueOrder = 2
|
384
759
|
} else {
|
385
760
|
previousValueOrder = 3
|
386
761
|
}
|
387
762
|
|
388
763
|
let currentValueOrder = 0
|
389
|
-
if(currentValue[key] === undefined) {
|
764
|
+
if (currentValue[key] === undefined) {
|
390
765
|
currentValueOrder = 0
|
391
|
-
} else if(currentValue[key] === null) {
|
766
|
+
} else if (currentValue[key] === null) {
|
392
767
|
currentValueOrder = 1
|
393
|
-
} else if(currentValue[key] === '') {
|
768
|
+
} else if (currentValue[key] === '') {
|
394
769
|
currentValueOrder = 2
|
395
770
|
} else {
|
396
771
|
currentValueOrder = 3
|
397
772
|
}
|
398
773
|
|
399
|
-
if(currentValueOrder > previousValueOrder) {
|
774
|
+
if (currentValueOrder > previousValueOrder) {
|
400
775
|
previousValue[key] = currentValue[key]
|
401
776
|
}
|
402
777
|
}
|
@@ -405,44 +780,44 @@ class SteamUser {
|
|
405
780
|
}, {})
|
406
781
|
}
|
407
782
|
|
408
|
-
static async getUserSummaryFromXML(steamID) {
|
783
|
+
static async getUserSummaryFromXML (steamID) {
|
409
784
|
const resultXml = await SteamUser._httpRequestXML(`https://steamcommunity.com/profiles/${steamID}/?xml=1`)
|
410
785
|
return await SteamUser._parseSummaryFromXML(resultXml)
|
411
786
|
}
|
412
787
|
|
413
|
-
static async _parseSummaryFromXML(resultXml) {
|
414
|
-
if(!resultXml) {
|
788
|
+
static async _parseSummaryFromXML (resultXml) {
|
789
|
+
if (!resultXml) {
|
415
790
|
return
|
416
791
|
}
|
417
792
|
|
418
793
|
let json
|
419
794
|
try {
|
420
795
|
json = await xml2js.parseStringPromise(resultXml)
|
421
|
-
} catch(e) {
|
796
|
+
} catch (e) {
|
422
797
|
// console.error(e)
|
423
798
|
return
|
424
799
|
}
|
425
800
|
|
426
|
-
if(json?.response?.error?.[0] === 'The specified profile could not be found.') {
|
801
|
+
if (json?.response?.error?.[0] === 'The specified profile could not be found.') {
|
427
802
|
return 'Invalid'
|
428
803
|
}
|
429
804
|
|
430
|
-
if(!json?.profile) {
|
805
|
+
if (!json?.profile) {
|
431
806
|
return
|
432
807
|
}
|
433
|
-
for(let key in json.profile) {
|
434
|
-
if(Array.isArray(json.profile[key]) && json.profile[key].length === 1) {
|
808
|
+
for (let key in json.profile) {
|
809
|
+
if (Array.isArray(json.profile[key]) && json.profile[key].length === 1) {
|
435
810
|
json.profile[key] = json.profile[key][0]
|
436
811
|
}
|
437
812
|
}
|
438
813
|
|
439
814
|
const _profile = json.profile
|
440
|
-
if(!_profile) {
|
815
|
+
if (!_profile) {
|
441
816
|
return
|
442
817
|
}
|
443
818
|
|
444
819
|
let memberSince
|
445
|
-
if((memberSince = moment.utc(`November 3, 2016`, ['MMMM DD, YYYY', 'MMMM D, YYYY', 'MMMM DD', 'MMMM D'], true)).isValid()) {
|
820
|
+
if ((memberSince = moment.utc(`November 3, 2016`, ['MMMM DD, YYYY', 'MMMM D, YYYY', 'MMMM DD', 'MMMM D'], true)).isValid()) {
|
446
821
|
memberSince = memberSince.valueOf()
|
447
822
|
} else {
|
448
823
|
memberSince = _profile.memberSince
|
@@ -455,18 +830,18 @@ class SteamUser {
|
|
455
830
|
let stateMessage = '',
|
456
831
|
stateMessageGame = '',
|
457
832
|
stateMessage_NonSteamGame = ''
|
458
|
-
if(!_profile.stateMessage) {
|
459
|
-
} else if(['Online', 'Online using Big Picture', 'Online using VR'].includes(_profile.stateMessage)) {
|
833
|
+
if (!_profile.stateMessage) {
|
834
|
+
} else if (['Online', 'Online using Big Picture', 'Online using VR'].includes(_profile.stateMessage)) {
|
460
835
|
stateMessage = 'online'
|
461
836
|
_profile.stateMessage = ''
|
462
|
-
} else if(_profile.stateMessage === 'Offline') {
|
837
|
+
} else if (_profile.stateMessage === 'Offline') {
|
463
838
|
stateMessage = 'offline'
|
464
839
|
_profile.stateMessage = ''
|
465
|
-
} else if(_profile.stateMessage.startsWith('In non-Steam game<br/>')) {
|
840
|
+
} else if (_profile.stateMessage.startsWith('In non-Steam game<br/>')) {
|
466
841
|
stateMessage = 'in-game'
|
467
842
|
stateMessage_NonSteamGame = _profile.stateMessage.substringAfter('<br/>')
|
468
843
|
_profile.stateMessage = ''
|
469
|
-
} else if(_profile.stateMessage.startsWith('In-Game<br/>')) {
|
844
|
+
} else if (_profile.stateMessage.startsWith('In-Game<br/>')) {
|
470
845
|
stateMessage = 'in-game'
|
471
846
|
stateMessageGame = _profile.stateMessage.substringAfter('<br/>')
|
472
847
|
_profile.stateMessage = ''
|
@@ -501,11 +876,11 @@ class SteamUser {
|
|
501
876
|
}
|
502
877
|
}
|
503
878
|
|
504
|
-
async getUserSummaryFromProfile(steamID = this.getSteamidUser()) {
|
879
|
+
async getUserSummaryFromProfile (steamID = this.getSteamidUser()) {
|
505
880
|
return await SteamUser.getUserSummaryFromProfile(steamID, this.getCookies())
|
506
881
|
}
|
507
882
|
|
508
|
-
static async getUserSummaryFromProfile(steamID, cookie) {
|
883
|
+
static async getUserSummaryFromProfile (steamID, cookie) {
|
509
884
|
const result = (await request({
|
510
885
|
url: 'https://steamcommunity.com/profiles/' + steamID,
|
511
886
|
headers: { ...cookie && { cookie } },
|
@@ -513,22 +888,22 @@ class SteamUser {
|
|
513
888
|
return SteamUser._parseUserProfile(result)
|
514
889
|
}
|
515
890
|
|
516
|
-
static _formatSummary(summary) {
|
891
|
+
static _formatSummary (summary) {
|
517
892
|
summary = summary || ''
|
518
|
-
for(let i = 1; i < SteamImageCDN.length; i++) {
|
893
|
+
for (let i = 1; i < SteamImageCDN.length; i++) {
|
519
894
|
summary = summary.replaceAll(SteamImageCDN[i], SteamImageCDN[0])
|
520
895
|
}
|
521
896
|
return EmptyProfileSummary.includes(summary) ? null : summary
|
522
897
|
}
|
523
898
|
|
524
|
-
static _parseUserProfile(html) {
|
525
|
-
if(!html) {
|
899
|
+
static _parseUserProfile (html) {
|
900
|
+
if (!html) {
|
526
901
|
return
|
527
902
|
}
|
528
903
|
const $ = cheerio.load(html)
|
529
904
|
|
530
905
|
const sectionText = $('#message .sectionText').text()?.trim()
|
531
|
-
if(ErrorProcessingRequest.includes(sectionText)) {
|
906
|
+
if (ErrorProcessingRequest.includes(sectionText)) {
|
532
907
|
return
|
533
908
|
}
|
534
909
|
const profile_private_info = $('.profile_header_summary .profile_private_info').text()?.trim()
|
@@ -541,10 +916,10 @@ class SteamUser {
|
|
541
916
|
url: 'https://steamcommunity.com/id/natri99/',
|
542
917
|
steamid: '76561199040402348',
|
543
918
|
personaname: 'Natri',
|
544
|
-
summary: 'Sub: <a class="bb_link" href="https://steamcommunity.com/id/Natri2099/" target="_blank" rel="noreferrer" >https://steamcommunity.com/id/Natri2099/</a> '
|
919
|
+
summary: 'Sub: <a class="bb_link" href="https://steamcommunity.com/id/Natri2099/" target="_blank" rel="noreferrer" >https://steamcommunity.com/id/Natri2099/</a> ',
|
545
920
|
}
|
546
921
|
const g_rgProfileData = JSON_parse(html.substringBetweenOrNull('g_rgProfileData = ', '"};') + '"}')
|
547
|
-
if(!g_rgProfileData) {
|
922
|
+
if (!g_rgProfileData) {
|
548
923
|
return
|
549
924
|
}
|
550
925
|
|
@@ -553,19 +928,15 @@ class SteamUser {
|
|
553
928
|
|
554
929
|
const profileBanStatusEl = $('.profile_ban_status').clone()
|
555
930
|
|
556
|
-
const gameBanFull = [...($(profileBanStatusEl.children()))]
|
557
|
-
.
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
}).concat(profileBanStatusEl.text()).map(text => text?.replaceAll(/[\t\n\r]/gi, ' ')?.replaceAll(/\s+/gi, ' ')?.trim()).filter(Boolean)
|
931
|
+
const gameBanFull = [...($(profileBanStatusEl.children()))].map(line => {
|
932
|
+
const text = $(line).text()
|
933
|
+
$(line).remove()
|
934
|
+
return text
|
935
|
+
}).concat(profileBanStatusEl.text()).map(text => text?.replaceAll(/[\t\n\r]/gi, ' ')?.replaceAll(/\s+/gi, ' ')?.trim()).filter(Boolean)
|
562
936
|
const GameBan = SteamUser.parseGameBanType(gameBanFull)
|
563
937
|
let dayLastBan = null
|
564
|
-
if(GameBan && GameBan.daysSinceLastBan !== null) {
|
565
|
-
dayLastBan = moment()
|
566
|
-
.startOf('day')
|
567
|
-
.subtract(GameBan.daysSinceLastBan, 'days')
|
568
|
-
.valueOf()
|
938
|
+
if (GameBan && GameBan.daysSinceLastBan !== null) {
|
939
|
+
dayLastBan = moment().startOf('day').subtract(GameBan.daysSinceLastBan, 'days').valueOf()
|
569
940
|
}
|
570
941
|
|
571
942
|
const url = g_rgProfileData.url ? (g_rgProfileData.url.endsWith('/') ? g_rgProfileData.url.substringBeforeLast('/') : g_rgProfileData.url) : ''
|
@@ -576,7 +947,11 @@ class SteamUser {
|
|
576
947
|
avatarFrameEl.remove()
|
577
948
|
|
578
949
|
// const avatarFull = $(`.profile_header .playerAvatar img`).attr('src')
|
579
|
-
const avatarFulls = [
|
950
|
+
const avatarFulls = [
|
951
|
+
$(`head > link[rel="image_src"][href$="_full.jpg"]`).attr('href'),
|
952
|
+
$(`head > meta[name="twitter:image"][content$="_full.jpg"]`).attr('content'),
|
953
|
+
$(`head > meta[property="og:image"][content$="_full.jpg"]`).attr('content'),
|
954
|
+
$(`.profile_header .playerAvatar img`).attr('src')].filter(Boolean)
|
580
955
|
const avatarHash = SteamUser.GetAvatarHashFromMultipleURL(avatarFulls)
|
581
956
|
const location = $('img.profile_flag').attr('src')?.substringBetweenOrNull('/images/countryflags/', '.')?.toUpperCase() || ''
|
582
957
|
|
@@ -584,7 +959,7 @@ class SteamUser {
|
|
584
959
|
const onlineState = ['online', 'offline', 'in-game'].find(_onlineState => playerAvatarClass.includes(_onlineState))
|
585
960
|
const gamename = $('.profile_in_game .profile_in_game_name').text()?.trim() || ''
|
586
961
|
let stateMessageGame = ''
|
587
|
-
if(onlineState === 'in-game') {
|
962
|
+
if (onlineState === 'in-game') {
|
588
963
|
stateMessageGame = gamename
|
589
964
|
}
|
590
965
|
|
@@ -599,7 +974,9 @@ class SteamUser {
|
|
599
974
|
location,
|
600
975
|
summary: SteamUser._formatSummary(g_rgProfileData.summary),
|
601
976
|
notYetSetup: NotYetSetupProfileTextList.includes(profile_private_info),
|
602
|
-
profile_private_info: profile_private_info ? ((NotYetSetupProfileTextList.includes(profile_private_info)
|
977
|
+
profile_private_info: profile_private_info ? ((NotYetSetupProfileTextList.includes(profile_private_info)
|
978
|
+
? '___NotYetSetupProfile___'
|
979
|
+
: (PrivateProfileTextList.includes(profile_private_info) ? '___PrivateProfile___' : profile_private_info))) : null,
|
603
980
|
lobbyLink,
|
604
981
|
addFriendEnable,
|
605
982
|
isPrivate: PrivateProfileTextList.includes(profile_private_info),
|
@@ -617,30 +994,28 @@ class SteamUser {
|
|
617
994
|
}
|
618
995
|
}
|
619
996
|
|
620
|
-
static async QueryLocations() {
|
997
|
+
static async QueryLocations () {
|
621
998
|
let response = await request(`https://steamcommunity.com//actions/QueryLocations/`)
|
622
999
|
return response?.data || []
|
623
|
-
const resultExample = [
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
1000
|
+
const resultExample = [
|
1001
|
+
{
|
1002
|
+
countrycode: 'US',
|
1003
|
+
hasstates: 1,
|
1004
|
+
countryname: 'United States',
|
1005
|
+
}, {
|
1006
|
+
countrycode: 'CA',
|
1007
|
+
hasstates: 1,
|
1008
|
+
countryname: 'Canada',
|
1009
|
+
}]
|
1010
|
+
}
|
1011
|
+
|
1012
|
+
static async queryAppList (term) {
|
1013
|
+
let response = await request(
|
1014
|
+
`https://store.steampowered.com/search/results/?query&start=0&count=50&dynamic_data=&sort_by=_ASC&term=${encodeURIComponent(term)}&infinite=1`)
|
1015
|
+
if (!response?.data?.results_html) {
|
637
1016
|
return []
|
638
1017
|
}
|
639
|
-
const $ = cheerio.load(response
|
640
|
-
?.data
|
641
|
-
?.results_html
|
642
|
-
?.replaceAll(/[\t\n\r]/gi, '')
|
643
|
-
.trim())
|
1018
|
+
const $ = cheerio.load(response?.data?.results_html?.replaceAll(/[\t\n\r]/gi, '').trim())
|
644
1019
|
const results = []
|
645
1020
|
$(`a.search_result_row`).each(function () {
|
646
1021
|
const el = $(this)
|
@@ -659,9 +1034,10 @@ class SteamUser {
|
|
659
1034
|
|
660
1035
|
}
|
661
1036
|
|
662
|
-
static async suggestAppList(term) {
|
663
|
-
let response = await request(`https://store.steampowered.com/search/suggest?term=${encodeURIComponent(
|
664
|
-
|
1037
|
+
static async suggestAppList (term) {
|
1038
|
+
let response = await request(`https://store.steampowered.com/search/suggest?term=${encodeURIComponent(
|
1039
|
+
term)}&f=games&cc=VN&realm=1&l=english&excluded_content_descriptors%5B%5D=3&excluded_content_descriptors%5B%5D=4&use_store_query=1`)
|
1040
|
+
if (!response?.data) {
|
665
1041
|
return []
|
666
1042
|
}
|
667
1043
|
const $ = response._$()
|
@@ -682,13 +1058,13 @@ class SteamUser {
|
|
682
1058
|
return results
|
683
1059
|
}
|
684
1060
|
|
685
|
-
static steamID642Miniprofile(steamID) {
|
1061
|
+
static steamID642Miniprofile (steamID) {
|
686
1062
|
return parseInt((new SteamID(steamID)).getSteam3RenderedID().split(':').pop().split(']')[0])
|
687
1063
|
}
|
688
1064
|
|
689
|
-
static miniprofile2SteamID64(miniprofile) {
|
1065
|
+
static miniprofile2SteamID64 (miniprofile) {
|
690
1066
|
const accountid = parseInt(miniprofile)
|
691
|
-
if(isNaN(accountid)) {
|
1067
|
+
if (isNaN(accountid)) {
|
692
1068
|
//debug
|
693
1069
|
console_log('debug')
|
694
1070
|
return
|
@@ -696,9 +1072,9 @@ class SteamUser {
|
|
696
1072
|
return (SteamID.fromIndividualAccountID(accountid)).getSteamID64()
|
697
1073
|
}
|
698
1074
|
|
699
|
-
static groupminiid2SteamID64(miniid) {
|
1075
|
+
static groupminiid2SteamID64 (miniid) {
|
700
1076
|
const accountid = parseInt(miniid)
|
701
|
-
if(isNaN(accountid)) {
|
1077
|
+
if (isNaN(accountid)) {
|
702
1078
|
//debug
|
703
1079
|
console_log('debug')
|
704
1080
|
return
|
@@ -713,63 +1089,64 @@ class SteamUser {
|
|
713
1089
|
return sid.getSteamID64()
|
714
1090
|
}
|
715
1091
|
|
716
|
-
static getCustomURL_from_ProfileURL(profileURL) {
|
1092
|
+
static getCustomURL_from_ProfileURL (profileURL) {
|
717
1093
|
const split = 'steamcommunity.com/id/'
|
718
|
-
if(profileURL.includes(split)) {
|
1094
|
+
if (profileURL.includes(split)) {
|
719
1095
|
const customURL = profileURL.substringAfter(split)
|
720
1096
|
return customURL.includes('/') ? customURL.substringBefore('/') : customURL
|
721
1097
|
}
|
722
1098
|
return null
|
723
1099
|
}
|
724
1100
|
|
725
|
-
static getProfileURL_from_CustomURL(customURL) {
|
726
|
-
if(typeof customURL !== 'string' || !customURL) {
|
1101
|
+
static getProfileURL_from_CustomURL (customURL) {
|
1102
|
+
if (typeof customURL !== 'string' || !customURL) {
|
727
1103
|
return null
|
728
1104
|
}
|
729
1105
|
return `https://steamcommunity.com/id/${customURL.trim()}`
|
730
1106
|
}
|
731
1107
|
|
732
|
-
static async GetAppList() {
|
1108
|
+
static async GetAppList () {
|
733
1109
|
let result = await request(`http://api.steampowered.com/ISteamApps/GetAppList/v0002/?format=json`)
|
734
1110
|
return result?.data
|
735
1111
|
const resultExample = {
|
736
1112
|
applist: {
|
737
|
-
apps: [
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
1113
|
+
apps: [
|
1114
|
+
{
|
1115
|
+
appid: 1829051,
|
1116
|
+
name: 'XXXXX',
|
1117
|
+
}],
|
1118
|
+
},
|
742
1119
|
}
|
743
1120
|
}
|
744
1121
|
|
745
|
-
static async GetCurrentVersion(appID) {
|
1122
|
+
static async GetCurrentVersion (appID) {
|
746
1123
|
for (let i = 0; i < 10; i++) {
|
747
1124
|
try {
|
748
1125
|
return (await request(
|
749
|
-
|
1126
|
+
`https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?format=json&appid=${appID}&version=0`)).data.response.required_version
|
750
1127
|
} catch (e) {
|
751
1128
|
await sleep(1000)
|
752
1129
|
}
|
753
1130
|
}
|
754
1131
|
}
|
755
1132
|
|
756
|
-
static generateSessionID() {
|
1133
|
+
static generateSessionID () {
|
757
1134
|
return randomBytes(12).toString('hex')
|
758
1135
|
}
|
759
1136
|
|
760
|
-
static async communityLogin({
|
1137
|
+
static async communityLogin ({
|
761
1138
|
username,
|
762
1139
|
password,
|
763
1140
|
emailauth,
|
764
1141
|
cookie,
|
765
|
-
steamMachineAuth
|
1142
|
+
steamMachineAuth,
|
766
1143
|
}) {
|
767
|
-
if(!username || !password) {
|
1144
|
+
if (!username || !password) {
|
768
1145
|
return
|
769
1146
|
}
|
770
1147
|
username = username?.toLowerCase()
|
771
1148
|
const rsakey = await this.getrsakey(username)
|
772
|
-
if(!rsakey || !rsakey.success) {
|
1149
|
+
if (!rsakey || !rsakey.success) {
|
773
1150
|
return
|
774
1151
|
}
|
775
1152
|
|
@@ -777,9 +1154,9 @@ class SteamUser {
|
|
777
1154
|
key.setPublic(rsakey.publickey_mod, rsakey.publickey_exp)
|
778
1155
|
const encryptedPassword = hex2b64(key.encrypt(password))
|
779
1156
|
|
780
|
-
if(cookie) {
|
1157
|
+
if (cookie) {
|
781
1158
|
const cookieParts = SteamUser.parseCookie(cookie)
|
782
|
-
if(!cookieParts.steamMachineAuth && steamMachineAuth) {
|
1159
|
+
if (!cookieParts.steamMachineAuth && steamMachineAuth) {
|
783
1160
|
cookieParts.steamMachineAuth = steamMachineAuth
|
784
1161
|
}
|
785
1162
|
cookie = SteamUser.generateCookie(cookieParts)
|
@@ -824,19 +1201,19 @@ class SteamUser {
|
|
824
1201
|
},
|
825
1202
|
data: Object.keys(postData).map(function (key) {
|
826
1203
|
let value = postData[key]
|
827
|
-
if(typeof value === 'undefined') {
|
1204
|
+
if (typeof value === 'undefined') {
|
828
1205
|
value = ''
|
829
1206
|
}
|
830
1207
|
return `${key}=${encodeURIComponent(value.toString())}`
|
831
1208
|
}).join('&'),
|
832
1209
|
})
|
833
1210
|
|
834
|
-
if(result?.data) {
|
1211
|
+
if (result?.data) {
|
835
1212
|
const jsonResponse = {
|
836
1213
|
...result.data,
|
837
|
-
timestamp: moment().unix()
|
1214
|
+
timestamp: moment().unix(),
|
838
1215
|
}
|
839
|
-
if(jsonResponse.success) {
|
1216
|
+
if (jsonResponse.success) {
|
840
1217
|
const resultExample = {
|
841
1218
|
success: true,
|
842
1219
|
requires_twofactor: false,
|
@@ -847,17 +1224,21 @@ class SteamUser {
|
|
847
1224
|
token_secure: 'AE985344A09FABA46E8095E1AD6B49AC0B64C8FA',
|
848
1225
|
auth: 'be54a809d47fe7d61082c806474b9583',
|
849
1226
|
remember_login: true,
|
850
|
-
webcookie: '323B473A2023BE5868F2445AF41D814283A7CD7E'
|
851
|
-
}
|
1227
|
+
webcookie: '323B473A2023BE5868F2445AF41D814283A7CD7E',
|
1228
|
+
},
|
852
1229
|
}
|
853
1230
|
let cookies = result.headers['set-cookie']?.map(c => decodeURI(c.substringBefore(';')).trim()) //array
|
854
1231
|
let expires
|
855
1232
|
try {
|
856
|
-
expires = result.headers['set-cookie'].find(c => c.toLowerCase().startsWith('steamRememberLogin'.toLowerCase())).
|
857
|
-
|
1233
|
+
expires = result.headers['set-cookie'].find(c => c.toLowerCase().startsWith('steamRememberLogin'.toLowerCase())).
|
1234
|
+
split(';').
|
1235
|
+
map(k => k.trim()).
|
1236
|
+
find(k => k.toLowerCase().startsWith('Expires='.toLowerCase())).
|
1237
|
+
substringAfter('Expires=')
|
1238
|
+
} catch (e) {
|
858
1239
|
}
|
859
1240
|
|
860
|
-
if(!cookies.some(c => c.startsWith('sessionid='))) {
|
1241
|
+
if (!cookies.some(c => c.startsWith('sessionid='))) {
|
861
1242
|
const sessionid = SteamUser.generateSessionID()
|
862
1243
|
cookies.push(`sessionid=${sessionid}`)
|
863
1244
|
}
|
@@ -866,25 +1247,25 @@ class SteamUser {
|
|
866
1247
|
...jsonResponse,
|
867
1248
|
expiresStr: expires,
|
868
1249
|
expires: expires ? moment(expires).valueOf() : null,
|
869
|
-
cookie: cookies.join(';')
|
1250
|
+
cookie: cookies.join(';'),
|
870
1251
|
}
|
871
1252
|
} else {
|
872
|
-
if(jsonResponse.emailauth_needed) {
|
1253
|
+
if (jsonResponse.emailauth_needed) {
|
873
1254
|
const resultExample = {
|
874
1255
|
success: false,
|
875
1256
|
requires_twofactor: false,
|
876
1257
|
message: '',
|
877
1258
|
emailauth_needed: true,
|
878
1259
|
emaildomain: 'gmail.com',
|
879
|
-
emailsteamid: '76561199277189971'
|
1260
|
+
emailsteamid: '76561199277189971',
|
880
1261
|
}
|
881
|
-
} else if(jsonResponse.message) {
|
1262
|
+
} else if (jsonResponse.message) {
|
882
1263
|
const resultExample = {
|
883
1264
|
success: false,
|
884
1265
|
requires_twofactor: false,
|
885
1266
|
message: 'There have been too many login failures from your network in a short time period. Please wait and try again later.',
|
886
1267
|
captcha_needed: false,
|
887
|
-
captcha_gid: -1
|
1268
|
+
captcha_gid: -1,
|
888
1269
|
}
|
889
1270
|
}
|
890
1271
|
|
@@ -900,8 +1281,8 @@ class SteamUser {
|
|
900
1281
|
// return result
|
901
1282
|
}
|
902
1283
|
|
903
|
-
static async getrsakey(username) {
|
904
|
-
if(!username) {
|
1284
|
+
static async getrsakey (username) {
|
1285
|
+
if (!username) {
|
905
1286
|
return
|
906
1287
|
}
|
907
1288
|
username = username?.toLowerCase()
|
@@ -923,7 +1304,7 @@ class SteamUser {
|
|
923
1304
|
'x-kl-ajax-request': 'Ajax_Request',
|
924
1305
|
'x-requested-with': 'XMLHttpRequest',
|
925
1306
|
Referer: 'https://steamcommunity.com/login/home/',
|
926
|
-
'Referrer-Policy': 'strict-origin-when-cross-origin'
|
1307
|
+
'Referrer-Policy': 'strict-origin-when-cross-origin',
|
927
1308
|
},
|
928
1309
|
data: {
|
929
1310
|
username,
|
@@ -933,7 +1314,7 @@ class SteamUser {
|
|
933
1314
|
|
934
1315
|
return response?.data ? {
|
935
1316
|
...response?.data,
|
936
|
-
cookie: response.headers['set-cookie']?.map(c => decodeURI(c.substringBefore(';'))) || []
|
1317
|
+
cookie: response.headers['set-cookie']?.map(c => decodeURI(c.substringBefore(';'))) || [],
|
937
1318
|
} : null
|
938
1319
|
|
939
1320
|
const resultExample = {
|
@@ -941,11 +1322,11 @@ class SteamUser {
|
|
941
1322
|
publickey_mod: 'ca0cfb7ffc3b6f8926f3f822c535da4ee4c6c83ed3e318b7f72c1d714ae92c02dae6ec19a011b3a8c5d10399dd58e3df9d12d7d0dc3b20856d62b2860c89fb65140ccbc11f36d3cce1373c6067ba8bcc9de2a1d0188d0ae6c23e9fdeca11dd59ae13f7fd3f750b8f6f921d62279edef90b9726e421c98a511a9c62c3f65a8587285bed3be8dda32eee74d9fecbb1243833f0ddf8c19eaa22847aa736675e32560d4a59695bf90dc22eb2f2879364dbc6ac86ae3aee1cd7fb0a444471735d45a00250f96ec5fe60fea257ad7b1699153e790dc3a102d1c0cb5b2f3e1844dbc1409f60ff7f29be771afacd22e3aeb879ed0e0e9e9c2fb9ab0d9a2142c6462d9e61',
|
942
1323
|
publickey_exp: '010001',
|
943
1324
|
timestamp: '403345600000',
|
944
|
-
token_gid: '2be211c91a7dd170'
|
1325
|
+
token_gid: '2be211c91a7dd170',
|
945
1326
|
}
|
946
1327
|
}
|
947
1328
|
|
948
|
-
static async oAuthLogin(steamguard, access_token) {
|
1329
|
+
static async oAuthLogin (steamguard, access_token) {
|
949
1330
|
steamguard = steamguard.split('||')
|
950
1331
|
const steamID = (new SteamID(steamguard[0])).getSteamID64()
|
951
1332
|
const sessionID = this.generateSessionID()
|
@@ -953,15 +1334,19 @@ class SteamUser {
|
|
953
1334
|
url: `https://api.steampowered.com/IMobileAuthService/GetWGToken/v1/`,
|
954
1335
|
method: 'POST',
|
955
1336
|
headers: {
|
956
|
-
'Content-Type': 'multipart/form-data'
|
1337
|
+
'Content-Type': 'multipart/form-data',
|
957
1338
|
},
|
958
1339
|
data: {
|
959
1340
|
access_token,
|
960
1341
|
},
|
961
1342
|
})
|
962
1343
|
|
963
|
-
if(result?.data?.response?.token) {
|
964
|
-
const cookies = [
|
1344
|
+
if (result?.data?.response?.token) {
|
1345
|
+
const cookies = [
|
1346
|
+
'steamLogin=' + encodeURIComponent(steamID + '||' + result?.data?.response?.token),
|
1347
|
+
'steamLoginSecure=' + encodeURIComponent(steamID + '||' + result?.data?.response?.token_secure),
|
1348
|
+
'steamMachineAuth' + steamID + '=' + steamguard[1],
|
1349
|
+
'sessionid=' + sessionID]
|
965
1350
|
return {
|
966
1351
|
sessionID,
|
967
1352
|
cookies,
|
@@ -979,15 +1364,15 @@ class SteamUser {
|
|
979
1364
|
* */
|
980
1365
|
|
981
1366
|
|
982
|
-
_formatHttpRequest(params) {
|
983
|
-
if(typeof params === 'string') {
|
1367
|
+
_formatHttpRequest (params) {
|
1368
|
+
if (typeof params === 'string') {
|
984
1369
|
params = {
|
985
1370
|
url: params,
|
986
1371
|
method: 'GET',
|
987
1372
|
}
|
988
1373
|
}
|
989
1374
|
|
990
|
-
if(!(params.headers instanceof Header)) {
|
1375
|
+
if (!(params.headers instanceof Header)) {
|
991
1376
|
params.headers = new Header(params.headers)
|
992
1377
|
}
|
993
1378
|
|
@@ -1010,10 +1395,10 @@ class SteamUser {
|
|
1010
1395
|
})
|
1011
1396
|
|
1012
1397
|
let referer = params.headers.get('referer')
|
1013
|
-
if(!referer) {
|
1398
|
+
if (!referer) {
|
1014
1399
|
referer = SteamcommunityURL
|
1015
1400
|
const URLReferer = URL.parse(params.url)
|
1016
|
-
if(URLReferer.protocol && URLReferer.host) {
|
1401
|
+
if (URLReferer.protocol && URLReferer.host) {
|
1017
1402
|
referer = URLReferer.protocol + '//' + URLReferer.host
|
1018
1403
|
}
|
1019
1404
|
}
|
@@ -1021,13 +1406,13 @@ class SteamUser {
|
|
1021
1406
|
Referer: referer,
|
1022
1407
|
})
|
1023
1408
|
|
1024
|
-
if(!params.data) {
|
1409
|
+
if (!params.data) {
|
1025
1410
|
params.data = {}
|
1026
1411
|
}
|
1027
1412
|
|
1028
1413
|
params.referrerPolicy = 'strict-origin-when-cross-origin'
|
1029
1414
|
|
1030
|
-
if(!params.method) {
|
1415
|
+
if (!params.method) {
|
1031
1416
|
params.method = 'GET'
|
1032
1417
|
}
|
1033
1418
|
params.method = params.method.toUpperCase()
|
@@ -1035,30 +1420,30 @@ class SteamUser {
|
|
1035
1420
|
return params
|
1036
1421
|
}
|
1037
1422
|
|
1038
|
-
static _isPlsLoginFirst(data) {
|
1423
|
+
static _isPlsLoginFirst (data) {
|
1039
1424
|
try {
|
1040
|
-
if(data?.includes(`<p>Please login first.</p>`)) {
|
1425
|
+
if (data?.includes(`<p>Please login first.</p>`)) {
|
1041
1426
|
return true
|
1042
1427
|
}
|
1043
|
-
} catch(e) {
|
1428
|
+
} catch (e) {
|
1044
1429
|
}
|
1045
1430
|
return false
|
1046
1431
|
}
|
1047
1432
|
|
1048
|
-
async _httpRequest(params) {
|
1433
|
+
async _httpRequest (params) {
|
1049
1434
|
let result = null,
|
1050
1435
|
i = 0
|
1051
1436
|
params = this._formatHttpRequest(params)
|
1052
1437
|
|
1053
|
-
if(!this._cookies) {
|
1438
|
+
if (!this._cookies) {
|
1054
1439
|
throw new Error('You have not set cookie yet')
|
1055
1440
|
}
|
1056
1441
|
|
1057
|
-
if(params.method.toUpperCase() === 'POST') {
|
1058
|
-
if(params.data instanceof URLSearchParams) {
|
1442
|
+
if (params.method.toUpperCase() === 'POST') {
|
1443
|
+
if (params.data instanceof URLSearchParams) {
|
1059
1444
|
params.data.append('sessionid', this._sessionid)
|
1060
1445
|
params.data.append('sessionID', this._sessionid)
|
1061
|
-
} else if(typeof params.data === 'string') {
|
1446
|
+
} else if (typeof params.data === 'string') {
|
1062
1447
|
params.data += '&sessionid=' + this._sessionid
|
1063
1448
|
params.data += '&sessionID=' + this._sessionid
|
1064
1449
|
} else {
|
@@ -1073,23 +1458,23 @@ class SteamUser {
|
|
1073
1458
|
// }
|
1074
1459
|
}
|
1075
1460
|
|
1076
|
-
if(params.data instanceof URLSearchParams) {
|
1461
|
+
if (params.data instanceof URLSearchParams) {
|
1077
1462
|
params.headers.set('content-type', 'application/x-www-form-urlencoded')
|
1078
1463
|
}
|
1079
1464
|
|
1080
1465
|
}
|
1081
1466
|
|
1082
|
-
while(!result && i++ < MAX_RETRY) {
|
1467
|
+
while (!result && i++ < MAX_RETRY) {
|
1083
1468
|
const config = {
|
1084
1469
|
baseURL: SteamcommunityURL, ...params,
|
1085
1470
|
data: typeof params.data === 'object' && !Object.keys(params.data).length ? undefined : params.data,
|
1086
1471
|
headers: params.headers.get(),
|
1087
1472
|
beforeRedirect: (options) => {
|
1088
1473
|
options.headers = options.headers || {}
|
1089
|
-
if(options?.hostname === 'steamcommunity.com') {
|
1474
|
+
if (options?.hostname === 'steamcommunity.com') {
|
1090
1475
|
options.headers.cookie = this._cookies
|
1091
1476
|
}
|
1092
|
-
if(options.headers.location?.startsWith('https://login.steampowered.com/jwt/refresh')) {
|
1477
|
+
if (options.headers.location?.startsWith('https://login.steampowered.com/jwt/refresh')) {
|
1093
1478
|
//should login first
|
1094
1479
|
}
|
1095
1480
|
},
|
@@ -1098,31 +1483,31 @@ class SteamUser {
|
|
1098
1483
|
let plsLoginFirst = false
|
1099
1484
|
|
1100
1485
|
result = await request(config)
|
1101
|
-
if(result.status === 429) {
|
1486
|
+
if (result.status === 429) {
|
1102
1487
|
console.log('Too Many Requests')
|
1103
1488
|
await sleep(60000)
|
1104
1489
|
result = await request(config)
|
1105
|
-
} else if(result.status === 401) {
|
1490
|
+
} else if (result.status === 401) {
|
1106
1491
|
console.log('Unauthorized')
|
1107
|
-
if(params.method.toUpperCase() === 'POST') {
|
1492
|
+
if (params.method.toUpperCase() === 'POST') {
|
1108
1493
|
config.headers['Content-Type'] = 'multipart/form-data'
|
1109
1494
|
result = await request(config)
|
1110
1495
|
}
|
1111
1496
|
}
|
1112
|
-
if(result?.error?.code === 'ERR_FR_TOO_MANY_REDIRECTS') {
|
1497
|
+
if (result?.error?.code === 'ERR_FR_TOO_MANY_REDIRECTS') {
|
1113
1498
|
//Maximum number of redirects exceeded
|
1114
1499
|
plsLoginFirst = true
|
1115
1500
|
}
|
1116
1501
|
|
1117
|
-
if(SteamUser._isPlsLoginFirst(result?.data?.data)) {
|
1502
|
+
if (SteamUser._isPlsLoginFirst(result?.data?.data)) {
|
1118
1503
|
plsLoginFirst = true
|
1119
1504
|
}
|
1120
1505
|
|
1121
|
-
if(plsLoginFirst) {
|
1506
|
+
if (plsLoginFirst) {
|
1122
1507
|
console.error(params.url, `Please login first`)
|
1123
1508
|
return {
|
1124
1509
|
data: null,
|
1125
|
-
headers: config.headers
|
1510
|
+
headers: config.headers,
|
1126
1511
|
}
|
1127
1512
|
}
|
1128
1513
|
}
|
@@ -1130,7 +1515,7 @@ class SteamUser {
|
|
1130
1515
|
return result
|
1131
1516
|
}
|
1132
1517
|
|
1133
|
-
async _httpRequestAjax(params) {
|
1518
|
+
async _httpRequestAjax (params) {
|
1134
1519
|
params = this._formatHttpRequest(params)
|
1135
1520
|
const headers = params.headers instanceof Header ? params.headers : new Header(_.cloneDeep(params.headers))
|
1136
1521
|
params.headers = headers.set({
|
@@ -1143,13 +1528,14 @@ class SteamUser {
|
|
1143
1528
|
|
1144
1529
|
static RequestXML_TooManyRequests = 0
|
1145
1530
|
|
1146
|
-
static async _httpRequestXML(link) {
|
1147
|
-
if(SteamUser.RequestXML_TooManyRequests && (new Date()).getTime() - SteamUser.RequestXML_TooManyRequests < 60000) {
|
1531
|
+
static async _httpRequestXML (link) {
|
1532
|
+
if (SteamUser.RequestXML_TooManyRequests && (new Date()).getTime() - SteamUser.RequestXML_TooManyRequests < 60000) {
|
1148
1533
|
return
|
1149
1534
|
}
|
1150
1535
|
|
1151
1536
|
const resultXml = (await request(link))?.data
|
1152
|
-
if(resultXml?.includes(`An error was encountered while processing your request:`) &&
|
1537
|
+
if (resultXml?.includes(`An error was encountered while processing your request:`) &&
|
1538
|
+
resultXml?.includes(`You've made too many requests recently. Please wait and try your request again later.`)) {
|
1153
1539
|
//log
|
1154
1540
|
SteamUser.RequestXML_TooManyRequests = (new Date()).getTime()
|
1155
1541
|
} else {
|
@@ -1158,7 +1544,7 @@ class SteamUser {
|
|
1158
1544
|
return resultXml
|
1159
1545
|
}
|
1160
1546
|
|
1161
|
-
async getQuickInviteData() {
|
1547
|
+
async getQuickInviteData () {
|
1162
1548
|
const { data } = await this._httpRequestAjax({
|
1163
1549
|
url: `invites/ajaxcreate`,
|
1164
1550
|
data: {
|
@@ -1172,7 +1558,7 @@ class SteamUser {
|
|
1172
1558
|
})
|
1173
1559
|
return data?.success === 1 ? {
|
1174
1560
|
...data.invite,
|
1175
|
-
steamid_user: this.getSteamidUser()
|
1561
|
+
steamid_user: this.getSteamidUser(),
|
1176
1562
|
} : null
|
1177
1563
|
|
1178
1564
|
const resultExample = {
|
@@ -1187,62 +1573,64 @@ class SteamUser {
|
|
1187
1573
|
success: 1,
|
1188
1574
|
rwgrsn: -2,
|
1189
1575
|
steamid_user: '76561199040402348',
|
1190
|
-
}
|
1576
|
+
},
|
1191
1577
|
}
|
1192
1578
|
const errorExample = {
|
1193
1579
|
success: 'false',
|
1194
|
-
error: 15
|
1580
|
+
error: 15,
|
1195
1581
|
}
|
1196
1582
|
}
|
1197
1583
|
|
1198
1584
|
//add friend link
|
1199
|
-
async getQuickInviteLink() {
|
1585
|
+
async getQuickInviteLink () {
|
1200
1586
|
const short_url = `https://s.team/p/${SteamUser.createFriendCode(this.getSteamidUser())}`
|
1201
1587
|
const quickInviteData = await this.getQuickInviteData()
|
1202
1588
|
return quickInviteData?.invite_token ? `${short_url}/${quickInviteData?.invite_token}` : null
|
1203
1589
|
}
|
1204
1590
|
|
1205
|
-
async getCurrentQuickInviteTokens() {
|
1591
|
+
async getCurrentQuickInviteTokens () {
|
1206
1592
|
return (await this._httpRequest(`invites/ajaxgetall?sessionid=${this._sessionid}`))?.data
|
1207
1593
|
const successExample = {
|
1208
1594
|
success: 1,
|
1209
|
-
tokens: [
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1595
|
+
tokens: [
|
1596
|
+
{
|
1597
|
+
invite_token: 'hrcchjjm',
|
1598
|
+
invite_limit: '1',
|
1599
|
+
invite_duration: '2591695',
|
1600
|
+
time_created: 1662777551,
|
1601
|
+
valid: 1,
|
1602
|
+
}, {
|
1603
|
+
invite_token: 'kwmppbvm',
|
1604
|
+
invite_limit: '1',
|
1605
|
+
invite_duration: '2591702',
|
1606
|
+
time_created: 1662777558,
|
1607
|
+
valid: 1,
|
1608
|
+
}, {
|
1609
|
+
invite_token: 'vpghcgjp',
|
1610
|
+
invite_limit: '1',
|
1611
|
+
invite_duration: '2584709',
|
1612
|
+
time_created: 1662770565,
|
1613
|
+
valid: 1,
|
1614
|
+
}],
|
1228
1615
|
}
|
1229
1616
|
}
|
1230
1617
|
|
1231
1618
|
//{ success: 1 }
|
1232
1619
|
//{ success: 91 }
|
1233
1620
|
//{ success: 8 }//link expires
|
1234
|
-
async acceptQuickInviteData(quickInviteData) {
|
1235
|
-
return (await this._httpRequest(
|
1621
|
+
async acceptQuickInviteData (quickInviteData) {
|
1622
|
+
return (await this._httpRequest(
|
1623
|
+
`invites/ajaxredeem?sessionid=${this._sessionid}&steamid_user=${quickInviteData.steamid_user}&invite_token=${quickInviteData.invite_token}`))?.data
|
1236
1624
|
}
|
1237
1625
|
|
1238
|
-
async acceptQuickInviteLink(quickInviteLink) {
|
1626
|
+
async acceptQuickInviteLink (quickInviteLink) {
|
1239
1627
|
const invite_token = quickInviteLink.removeSuffix('/').substringAfterLast('/')
|
1240
1628
|
const result = await this._httpRequest(quickInviteLink)
|
1241
|
-
if(!result.data) {
|
1629
|
+
if (!result.data) {
|
1242
1630
|
return
|
1243
1631
|
}
|
1244
1632
|
let g_rgProfileData = JSON_parse(result.data.substringBetweenOrNull('g_rgProfileData = ', '"};') + '"}')
|
1245
|
-
if(!g_rgProfileData) {
|
1633
|
+
if (!g_rgProfileData) {
|
1246
1634
|
return
|
1247
1635
|
}
|
1248
1636
|
const quickInviteData = {
|
@@ -1252,7 +1640,7 @@ class SteamUser {
|
|
1252
1640
|
return await this.acceptQuickInviteData(quickInviteData)
|
1253
1641
|
}
|
1254
1642
|
|
1255
|
-
_parseComments(html) {
|
1643
|
+
_parseComments (html) {
|
1256
1644
|
const $ = cheerio.load(`<div>${html}</div>`)
|
1257
1645
|
const comments = []
|
1258
1646
|
$('.commentthread_comment').each(function () {
|
@@ -1281,32 +1669,32 @@ class SteamUser {
|
|
1281
1669
|
name,
|
1282
1670
|
avatar,
|
1283
1671
|
avatarHash,
|
1284
|
-
}
|
1672
|
+
},
|
1285
1673
|
})
|
1286
1674
|
})
|
1287
1675
|
return comments
|
1288
1676
|
}
|
1289
1677
|
|
1290
|
-
async getMyComments() {
|
1678
|
+
async getMyComments () {
|
1291
1679
|
return await this.getUserComments()
|
1292
1680
|
}
|
1293
1681
|
|
1294
|
-
async getUserComments(steamID = this.getSteamidUser()) {
|
1682
|
+
async getUserComments (steamID = this.getSteamidUser()) {
|
1295
1683
|
const result = await this._httpRequest(`comment/Profile/render/${steamID}/-1/`)
|
1296
|
-
if(!result.data) {
|
1684
|
+
if (!result.data) {
|
1297
1685
|
return []
|
1298
1686
|
}
|
1299
1687
|
const {
|
1300
1688
|
total_count,
|
1301
1689
|
pagesize,
|
1302
|
-
comments_html
|
1690
|
+
comments_html,
|
1303
1691
|
} = result.data
|
1304
1692
|
|
1305
1693
|
let comments = this._parseComments(comments_html)
|
1306
|
-
if(comments.length < total_count) {
|
1694
|
+
if (comments.length < total_count) {
|
1307
1695
|
let i = comments.length
|
1308
1696
|
const queue = []
|
1309
|
-
while(i <= total_count) {
|
1697
|
+
while (i <= total_count) {
|
1310
1698
|
queue.push(this._httpRequest({
|
1311
1699
|
url: `comment/Profile/render/${steamID}/-1/`,
|
1312
1700
|
data: {
|
@@ -1315,21 +1703,19 @@ class SteamUser {
|
|
1315
1703
|
count: pagesize,
|
1316
1704
|
feature2: -1,
|
1317
1705
|
},
|
1318
|
-
method: 'POST'
|
1706
|
+
method: 'POST',
|
1319
1707
|
}))
|
1320
1708
|
i += pagesize
|
1321
1709
|
}
|
1322
1710
|
const results = await Promise.all(queue)
|
1323
|
-
comments = comments.concat(
|
1324
|
-
.filter(result => result?.data?.comments_html)
|
1325
|
-
.map(result => result.data.comments_html.trim())
|
1326
|
-
.join('')))
|
1711
|
+
comments = comments.concat(
|
1712
|
+
this._parseComments(results.filter(result => result?.data?.comments_html).map(result => result.data.comments_html.trim()).join('')))
|
1327
1713
|
}
|
1328
1714
|
|
1329
1715
|
return comments
|
1330
1716
|
}
|
1331
1717
|
|
1332
|
-
static _formatGroupLink({
|
1718
|
+
static _formatGroupLink ({
|
1333
1719
|
link,
|
1334
1720
|
gid,
|
1335
1721
|
groupURL,
|
@@ -1339,34 +1725,32 @@ class SteamUser {
|
|
1339
1725
|
pathname = '',
|
1340
1726
|
}) {
|
1341
1727
|
searchKey = searchKey?.trim?.()
|
1342
|
-
if(!link) {
|
1728
|
+
if (!link) {
|
1343
1729
|
link = gid ? `gid/${gid}/?p=${page}` : `groups/${groupURL}/?p=${page}`
|
1344
1730
|
}
|
1345
1731
|
link = new Url(link)
|
1346
|
-
link.query = '?' + [
|
1347
|
-
.split('&')
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
if(pathname) {
|
1732
|
+
link.query = '?' + [
|
1733
|
+
...link.query.removePrefix('?').split('&').map(q => q.split('=')).filter(q => !['searchKey', 'content_only'].includes(q[0])).map(q => q.join('=')),
|
1734
|
+
!!content_only && `content_only=true`,
|
1735
|
+
!!searchKey && `searchKey=${encodeURIComponent(searchKey)}`].filter(Boolean).join('&')
|
1736
|
+
|
1737
|
+
if (pathname) {
|
1354
1738
|
let _pathname = link.pathname.removeSuffix('/')
|
1355
|
-
if(!_pathname.endsWith(pathname)) {
|
1739
|
+
if (!_pathname.endsWith(pathname)) {
|
1356
1740
|
link.pathname = _pathname + '/' + pathname + '/'
|
1357
1741
|
}
|
1358
1742
|
}
|
1359
1743
|
|
1360
1744
|
Object.assign(link, _.pick((new Url(SteamcommunityURL)), ['slashes', 'host', 'hostname', 'origin', 'protocol']))
|
1361
|
-
if(link.pathname && !link.pathname.startsWith('/')) {
|
1745
|
+
if (link.pathname && !link.pathname.startsWith('/')) {
|
1362
1746
|
link.pathname = '/' + link.pathname
|
1363
1747
|
}
|
1364
1748
|
|
1365
1749
|
return link.toString()
|
1366
1750
|
}
|
1367
1751
|
|
1368
|
-
static _parseGroupInfo(html) {
|
1369
|
-
if(!html) {
|
1752
|
+
static _parseGroupInfo (html) {
|
1753
|
+
if (!html) {
|
1370
1754
|
return null
|
1371
1755
|
}
|
1372
1756
|
|
@@ -1376,36 +1760,34 @@ class SteamUser {
|
|
1376
1760
|
let totalPages = -1
|
1377
1761
|
const $ = cheerio.load(html)
|
1378
1762
|
let gid
|
1379
|
-
if(html.includes('InitializeCommentThread') && html.includes('https://steamcommunity.com/comment/Clan')) {
|
1763
|
+
if (html.includes('InitializeCommentThread') && html.includes('https://steamcommunity.com/comment/Clan')) {
|
1380
1764
|
gid = html.substringBetweenOrNull(`InitializeCommentThread( "Clan", "Clan_`, `",`)
|
1381
1765
|
}
|
1382
|
-
if(!gid) {
|
1766
|
+
if (!gid) {
|
1383
1767
|
gid = $('#reportAbuseModalContents form input[name="abuseID"]').val()
|
1384
1768
|
}
|
1385
|
-
if(!gid) {
|
1769
|
+
if (!gid) {
|
1386
1770
|
gid = $('.content .joinchat_bg').attr('onclick')?.substringBetweenOrNull(`'`, `'`)
|
1387
1771
|
}
|
1388
1772
|
|
1389
1773
|
$('.grouppage_header_abbrev').remove()
|
1390
1774
|
const groupName = html.substringBetweenOrNull(`g_strGroupName = "`, `";`) || $('.grouppage_header_name').text()?.trim()
|
1391
1775
|
|
1392
|
-
let _groupURL = html.substringBetweenOrNull(`InitGroupPage( 'https://steamcommunity.com/groups/`, `',`) ||
|
1776
|
+
let _groupURL = html.substringBetweenOrNull(`InitGroupPage( 'https://steamcommunity.com/groups/`, `',`) ||
|
1777
|
+
$('#group_tab_overview').attr('href')?.substringAfter('https://steamcommunity.com/groups/') ||
|
1778
|
+
$('#searchEditForm[action]').attr('action')?.substringAfter('https://steamcommunity.com/groups/')?.substringBefore('/')
|
1393
1779
|
_groupURL = _groupURL?.removeSuffix('/')
|
1394
1780
|
const headline = $('.maincontent .group_summary > h1').text()?.trim()
|
1395
1781
|
|
1396
1782
|
let summary = $('.maincontent .group_summary .formatted_group_summary').html()?.replaceAll(/[\t\n\r]/gi, '')
|
1397
|
-
for(let i = 1; i < SteamImageCDN.length; i++) {
|
1783
|
+
for (let i = 1; i < SteamImageCDN.length; i++) {
|
1398
1784
|
summary = summary.replaceAll(SteamImageCDN[i], SteamImageCDN[0])
|
1399
1785
|
}
|
1400
1786
|
|
1401
1787
|
const avatarHash = SteamUser.GetAvatarHashFromURL($('.grouppage_logo img[src]').attr('src') || $('.grouppage_resp_logo img[src]').attr('src'))
|
1402
|
-
let memberCount = [...$('.group_paging')]
|
1403
|
-
|
1404
|
-
.
|
1405
|
-
?.substringBeforeLast('Members')
|
1406
|
-
?.trim()
|
1407
|
-
if(memberCount) {
|
1408
|
-
if(memberCount.includes('of')) {
|
1788
|
+
let memberCount = [...$('.group_paging')].map(g => $(g).text()?.trim()).find(text => text?.endsWith('Members'))?.substringBeforeLast('Members')?.trim()
|
1789
|
+
if (memberCount) {
|
1790
|
+
if (memberCount.includes('of')) {
|
1409
1791
|
memberCount = memberCount.substringAfterLast('of')
|
1410
1792
|
}
|
1411
1793
|
memberCount = parseInt(memberCount.trim().replaceAll(',', ''))
|
@@ -1431,7 +1813,7 @@ class SteamUser {
|
|
1431
1813
|
}))
|
1432
1814
|
const foundedStr = groupstat.find(({ label }) => label?.toLowerCase() === 'Founded'.toLowerCase())?.data
|
1433
1815
|
let founded
|
1434
|
-
if((founded = moment(foundedStr, 'DD MMMM, YYYY')).isValid()) {
|
1816
|
+
if ((founded = moment(foundedStr, 'DD MMMM, YYYY')).isValid()) {
|
1435
1817
|
founded = founded.valueOf()
|
1436
1818
|
} else {
|
1437
1819
|
founded = null
|
@@ -1450,8 +1832,7 @@ class SteamUser {
|
|
1450
1832
|
|
1451
1833
|
const rank_icon = el.find('> .rank_icon[title]').attr('title')?.trim()
|
1452
1834
|
// const rank_icon_src = el.find('> .rank_icon img').attr('src')?.toLowerCase()?.substringBetweenOrNull(`/images/skin_1/`, `.`)
|
1453
|
-
const rank = rank_icon && (Object.entries(EGroupRank)
|
1454
|
-
.find(([key, ranks]) => ranks.some(rank => rank.toLowerCase() === rank_icon.toLowerCase())))?.[0]
|
1835
|
+
const rank = rank_icon && (Object.entries(EGroupRank).find(([key, ranks]) => ranks.some(rank => rank.toLowerCase() === rank_icon.toLowerCase())))?.[0]
|
1455
1836
|
|
1456
1837
|
members.push({
|
1457
1838
|
link,
|
@@ -1470,20 +1851,20 @@ class SteamUser {
|
|
1470
1851
|
const text = el.text()?.trim()
|
1471
1852
|
const _page = parseInt(el.attr('href').substringAfter('p=')) || -1
|
1472
1853
|
|
1473
|
-
if(_page) {
|
1854
|
+
if (_page) {
|
1474
1855
|
totalPages = Math.max(totalPages, _page)
|
1475
1856
|
}
|
1476
1857
|
|
1477
|
-
if(text === '>') {
|
1858
|
+
if (text === '>') {
|
1478
1859
|
const _nextPageLink = el.attr('href')?.replace(`#members`, `/members`)
|
1479
1860
|
const _nextPage = parseInt(_nextPageLink.substringAfter('p='))
|
1480
|
-
if(!isNaN(_nextPage)) {
|
1861
|
+
if (!isNaN(_nextPage)) {
|
1481
1862
|
nextPage = _nextPage
|
1482
1863
|
nextPageLink = _nextPageLink
|
1483
1864
|
}
|
1484
|
-
} else if(text === '<') {
|
1865
|
+
} else if (text === '<') {
|
1485
1866
|
const _prevPage = parseInt(el.attr('href').substringAfter('p='))
|
1486
|
-
if(!isNaN(_prevPage)) {
|
1867
|
+
if (!isNaN(_prevPage)) {
|
1487
1868
|
prevPage = _prevPage
|
1488
1869
|
}
|
1489
1870
|
}
|
@@ -1517,7 +1898,7 @@ class SteamUser {
|
|
1517
1898
|
}
|
1518
1899
|
}
|
1519
1900
|
|
1520
|
-
async getGroupOverview({
|
1901
|
+
async getGroupOverview ({
|
1521
1902
|
groupURL,
|
1522
1903
|
gid,
|
1523
1904
|
page = 1,
|
@@ -1534,7 +1915,7 @@ class SteamUser {
|
|
1534
1915
|
})
|
1535
1916
|
}
|
1536
1917
|
|
1537
|
-
static async getGroupOverview({
|
1918
|
+
static async getGroupOverview ({
|
1538
1919
|
groupURL,
|
1539
1920
|
gid,
|
1540
1921
|
page = 1,
|
@@ -1559,7 +1940,7 @@ class SteamUser {
|
|
1559
1940
|
return SteamUser._parseGroupInfo(result?.data)
|
1560
1941
|
}
|
1561
1942
|
|
1562
|
-
async getGroupMembers({
|
1943
|
+
async getGroupMembers ({
|
1563
1944
|
groupURL,
|
1564
1945
|
gid,
|
1565
1946
|
page = 1,
|
@@ -1578,7 +1959,7 @@ class SteamUser {
|
|
1578
1959
|
})
|
1579
1960
|
}
|
1580
1961
|
|
1581
|
-
static async getGroupMembers({
|
1962
|
+
static async getGroupMembers ({
|
1582
1963
|
groupURL,
|
1583
1964
|
gid,
|
1584
1965
|
page = 1,
|
@@ -1594,7 +1975,7 @@ class SteamUser {
|
|
1594
1975
|
page,
|
1595
1976
|
content_only,
|
1596
1977
|
searchKey,
|
1597
|
-
pathname: 'members'
|
1978
|
+
pathname: 'members',
|
1598
1979
|
})
|
1599
1980
|
|
1600
1981
|
const result = await request({
|
@@ -1605,7 +1986,7 @@ class SteamUser {
|
|
1605
1986
|
return SteamUser._parseGroupInfo(result?.data)
|
1606
1987
|
}
|
1607
1988
|
|
1608
|
-
async getGroupMembersFull({
|
1989
|
+
async getGroupMembersFull ({
|
1609
1990
|
groupURL,
|
1610
1991
|
gid,
|
1611
1992
|
cookie,
|
@@ -1625,7 +2006,7 @@ class SteamUser {
|
|
1625
2006
|
})
|
1626
2007
|
}
|
1627
2008
|
|
1628
|
-
static async getGroupMembersFull({
|
2009
|
+
static async getGroupMembersFull ({
|
1629
2010
|
groupURL,
|
1630
2011
|
gid,
|
1631
2012
|
cookie,
|
@@ -1639,45 +2020,45 @@ class SteamUser {
|
|
1639
2020
|
group = await SteamUser.getGroupMembers({
|
1640
2021
|
...(group?.nextPageLink ? { link: group.nextPageLink } : {
|
1641
2022
|
gid: gid,
|
1642
|
-
groupURL: groupURL
|
2023
|
+
groupURL: groupURL,
|
1643
2024
|
}),
|
1644
2025
|
cookie,
|
1645
2026
|
content_only,
|
1646
2027
|
searchKey,
|
1647
2028
|
})
|
1648
|
-
if(Array.isArray(group?.members)) {
|
2029
|
+
if (Array.isArray(group?.members)) {
|
1649
2030
|
typeof cbOnMembers === 'function' && cbOnMembers(group.members)
|
1650
2031
|
typeof cbOnMember === 'function' && group.members.forEach(cbOnMember)
|
1651
2032
|
}
|
1652
|
-
} while(group?.nextPageLink)
|
2033
|
+
} while (group?.nextPageLink)
|
1653
2034
|
}
|
1654
2035
|
|
1655
|
-
static async getGroupInfoXML({
|
2036
|
+
static async getGroupInfoXML ({
|
1656
2037
|
groupURL,
|
1657
2038
|
gid,
|
1658
2039
|
page = 1,
|
1659
2040
|
link,
|
1660
2041
|
}) {
|
1661
|
-
if(!link) {
|
2042
|
+
if (!link) {
|
1662
2043
|
link = gid ? `/gid/${gid}/memberslistxml/?xml=1&p=${page}` : `/groups/${groupURL}/memberslistxml/?xml=1&p=${page}`
|
1663
2044
|
}
|
1664
2045
|
const resultXml = await request({
|
1665
2046
|
baseURL: SteamcommunityURL,
|
1666
2047
|
url: link,
|
1667
2048
|
})
|
1668
|
-
if(!resultXml?.data) {
|
2049
|
+
if (!resultXml?.data) {
|
1669
2050
|
return
|
1670
2051
|
}
|
1671
|
-
if(resultXml.status === 503) {
|
2052
|
+
if (resultXml.status === 503) {
|
1672
2053
|
console.log('Service Unavailable')
|
1673
2054
|
return
|
1674
2055
|
}
|
1675
|
-
if(resultXml.status === 429) {
|
2056
|
+
if (resultXml.status === 429) {
|
1676
2057
|
console.log('Too Many Requests')
|
1677
2058
|
return
|
1678
2059
|
}
|
1679
2060
|
const result = getJSObjectFronXML(resultXml.data)?.memberList
|
1680
|
-
if(!result) {
|
2061
|
+
if (!result) {
|
1681
2062
|
return
|
1682
2063
|
}
|
1683
2064
|
return {
|
@@ -1700,7 +2081,7 @@ class SteamUser {
|
|
1700
2081
|
}
|
1701
2082
|
}
|
1702
2083
|
|
1703
|
-
static async getGroupInfoXMLFull({
|
2084
|
+
static async getGroupInfoXMLFull ({
|
1704
2085
|
groupURL,
|
1705
2086
|
gid,
|
1706
2087
|
cbOnMembers,
|
@@ -1715,14 +2096,14 @@ class SteamUser {
|
|
1715
2096
|
groupURL: groupURL,
|
1716
2097
|
}),
|
1717
2098
|
})
|
1718
|
-
if(group && !groupInfo) {
|
2099
|
+
if (group && !groupInfo) {
|
1719
2100
|
groupInfo = group
|
1720
2101
|
}
|
1721
|
-
if(Array.isArray(group?.members)) {
|
2102
|
+
if (Array.isArray(group?.members)) {
|
1722
2103
|
members = members.concat(group?.members)
|
1723
2104
|
typeof cbOnMembers === 'function' && cbOnMembers(group.members)//list of steam id
|
1724
2105
|
}
|
1725
|
-
} while(group?.nextPageLink)
|
2106
|
+
} while (group?.nextPageLink)
|
1726
2107
|
return {
|
1727
2108
|
...groupInfo,
|
1728
2109
|
nextPageLink: undefined,
|
@@ -1730,11 +2111,11 @@ class SteamUser {
|
|
1730
2111
|
}
|
1731
2112
|
}
|
1732
2113
|
|
1733
|
-
async _parseFriendList(result) {
|
2114
|
+
async _parseFriendList (result) {
|
1734
2115
|
const $ = cheerio.load(result?.data || result || '')
|
1735
2116
|
const results = []
|
1736
2117
|
const friendList = $(`.persona[data-miniprofile]`)
|
1737
|
-
if(!friendList || !friendList.length) {
|
2118
|
+
if (!friendList || !friendList.length) {
|
1738
2119
|
return []
|
1739
2120
|
}
|
1740
2121
|
|
@@ -1748,19 +2129,14 @@ class SteamUser {
|
|
1748
2129
|
|
1749
2130
|
const isNickname = !!friendBlockContent.find('.player_nickname_hint').length
|
1750
2131
|
|
1751
|
-
const game = friendBlockContent.find(`.friend_game_link, .linkFriend_in-game`)
|
1752
|
-
.text()
|
1753
|
-
.replaceAll(/\s+/g, ' ')
|
1754
|
-
.trim()
|
1755
|
-
.removePrefix('In-Game')
|
1756
|
-
.trim()
|
2132
|
+
const game = friendBlockContent.find(`.friend_game_link, .linkFriend_in-game`).text().replaceAll(/\s+/g, ' ').trim().removePrefix('In-Game').trim()
|
1757
2133
|
friendBlockContent.find(`.friend_small_text, .friendSmallText`).remove()
|
1758
2134
|
|
1759
2135
|
const lastOnline = friendBlockContent.find(`.friend_last_online_text`).text().replaceAll(/\s+/g, ' ').trim()
|
1760
2136
|
friendBlockContent.find(`.friend_last_online_text`).remove()
|
1761
2137
|
|
1762
2138
|
let username = friendBlockContent.text().trim()
|
1763
|
-
if(username === '[deleted]') {
|
2139
|
+
if (username === '[deleted]') {
|
1764
2140
|
return
|
1765
2141
|
}
|
1766
2142
|
|
@@ -1769,11 +2145,11 @@ class SteamUser {
|
|
1769
2145
|
let score = ''
|
1770
2146
|
|
1771
2147
|
let onlineStatus = ''
|
1772
|
-
if(el.hasClass('in-game')) {
|
2148
|
+
if (el.hasClass('in-game')) {
|
1773
2149
|
onlineStatus = 'ingame'
|
1774
|
-
} else if(el.hasClass('online')) {
|
2150
|
+
} else if (el.hasClass('online')) {
|
1775
2151
|
onlineStatus = 'online'
|
1776
|
-
} else if(el.hasClass('offline')) {
|
2152
|
+
} else if (el.hasClass('offline')) {
|
1777
2153
|
onlineStatus = 'offline'
|
1778
2154
|
}
|
1779
2155
|
|
@@ -1796,15 +2172,15 @@ class SteamUser {
|
|
1796
2172
|
return results
|
1797
2173
|
}
|
1798
2174
|
|
1799
|
-
async getFollowingPlayersList(steamID = this.getSteamidUser()) {
|
2175
|
+
async getFollowingPlayersList (steamID = this.getSteamidUser()) {
|
1800
2176
|
return (await this._parseFriendList((await this._httpRequest(`${this.getSteamUserProfileURL(steamID)}/following/`)).data))
|
1801
2177
|
}
|
1802
2178
|
|
1803
|
-
async getFriendsList(steamID = this.getSteamidUser()) {
|
2179
|
+
async getFriendsList (steamID = this.getSteamidUser()) {
|
1804
2180
|
return (await this._parseFriendList((await this._httpRequest(`${this.getSteamUserProfileURL(steamID)}/friends/`)).data))
|
1805
2181
|
}
|
1806
2182
|
|
1807
|
-
async getMyFriendsList() {
|
2183
|
+
async getMyFriendsList () {
|
1808
2184
|
return await this.getFriendsList()
|
1809
2185
|
}
|
1810
2186
|
|
@@ -1821,38 +2197,38 @@ class SteamUser {
|
|
1821
2197
|
}
|
1822
2198
|
}
|
1823
2199
|
|
1824
|
-
async getMyFollowingPlayersList() {
|
2200
|
+
async getMyFollowingPlayersList () {
|
1825
2201
|
const steamID = this.getSteamidUser()
|
1826
2202
|
return await this.getFollowingPlayersList(steamID)
|
1827
2203
|
}
|
1828
2204
|
|
1829
|
-
async getMatchHistory_initial(matchHistoryType) {
|
1830
|
-
if(!matchHistoryType) {
|
2205
|
+
async getMatchHistory_initial (matchHistoryType) {
|
2206
|
+
if (!matchHistoryType) {
|
1831
2207
|
return
|
1832
2208
|
}
|
1833
2209
|
let result = await this._httpRequest(`${this.getMySteamUserProfileURL()}/gcpd/${AppID_CSGO}/?tab=${matchHistoryType}`)
|
1834
|
-
if(result?.data) {
|
2210
|
+
if (result?.data) {
|
1835
2211
|
const matches = this._parseMatchHistory(result?.data)
|
1836
2212
|
const continue_token = result.data.substringBetweenOrNull('var g_sGcContinueToken =', ';').trim().removeSurrounding('\'').trim()
|
1837
2213
|
const continue_text = result.data.substringBetweenOrNull('load_more_button_continue_text" class="returnLink">', '</div>')
|
1838
2214
|
return {
|
1839
2215
|
continue_token,
|
1840
2216
|
continue_text,
|
1841
|
-
matches
|
2217
|
+
matches,
|
1842
2218
|
}
|
1843
2219
|
} else {
|
1844
2220
|
return {
|
1845
2221
|
continue_token: '',
|
1846
2222
|
continue_text: '',
|
1847
|
-
matches: []
|
2223
|
+
matches: [],
|
1848
2224
|
}
|
1849
2225
|
}
|
1850
2226
|
}
|
1851
2227
|
|
1852
|
-
async getClientJsToken(retry = null) {
|
2228
|
+
async getClientJsToken (retry = null) {
|
1853
2229
|
let result = (await this._httpRequest('chat/clientjstoken'))?.data
|
1854
|
-
if(!result?.steamid) {
|
1855
|
-
if(retry !== null && retry !== undefined && retry >= 0) {
|
2230
|
+
if (!result?.steamid) {
|
2231
|
+
if (retry !== null && retry !== undefined && retry >= 0) {
|
1856
2232
|
await sleep(2000)
|
1857
2233
|
return await this.getClientJsToken(retry - 1)
|
1858
2234
|
} else {
|
@@ -1865,27 +2241,28 @@ class SteamUser {
|
|
1865
2241
|
steamid: '76561199040402348',
|
1866
2242
|
accountid: 1080136620,
|
1867
2243
|
account_name: 'henry22230',
|
1868
|
-
token: '1o7xYpbcmTsAAAAAAAAAAAAAAAAAAAAAAwCf6fVEGxM9H7Tnk5oW5QPI'
|
2244
|
+
token: '1o7xYpbcmTsAAAAAAAAAAAAAAAAAAAAAAwCf6fVEGxM9H7Tnk5oW5QPI',
|
1869
2245
|
}
|
1870
2246
|
|
1871
2247
|
return Object.assign(result, {
|
1872
2248
|
steamID: new SteamID(result.steamid),
|
1873
2249
|
accountName: result.account_name,
|
1874
|
-
webLogonToken: result.token
|
2250
|
+
webLogonToken: result.token,
|
1875
2251
|
})
|
1876
2252
|
}
|
1877
2253
|
|
1878
2254
|
getClientLogonToken = this.getClientJsToken
|
1879
2255
|
|
1880
|
-
async _getHistoryMatches(matchHistoryType, token) {
|
2256
|
+
async _getHistoryMatches (matchHistoryType, token) {
|
1881
2257
|
const _self = this
|
1882
2258
|
// console_log(`fetchIt ${token} ${matchHistoryType}`)
|
1883
2259
|
let result,
|
1884
2260
|
i = MAX_RETRY
|
1885
|
-
while(result?.data?.success !== true && i--) {
|
1886
|
-
result = await _self._httpRequest(
|
2261
|
+
while (result?.data?.success !== true && i--) {
|
2262
|
+
result = await _self._httpRequest(
|
2263
|
+
`${this.getMySteamUserProfileURL()}/gcpd/${AppID_CSGO}?ajax=1&tab=${matchHistoryType}&continue_token=${token}&sessionid=${_self._sessionid}`)
|
1887
2264
|
}
|
1888
|
-
if(!result.data) {
|
2265
|
+
if (!result.data) {
|
1889
2266
|
return null
|
1890
2267
|
}
|
1891
2268
|
const {
|
@@ -1904,19 +2281,17 @@ class SteamUser {
|
|
1904
2281
|
}
|
1905
2282
|
}
|
1906
2283
|
|
1907
|
-
_parseMatchHistory(html) {
|
2284
|
+
_parseMatchHistory (html) {
|
1908
2285
|
return SteamUser._parseMatchHistory(html, this._miniprofile_user)
|
1909
2286
|
}
|
1910
2287
|
|
1911
|
-
static _parseMatchHistory(html, myMiniProfile) {
|
2288
|
+
static _parseMatchHistory (html, myMiniProfile) {
|
1912
2289
|
const matches = []
|
1913
|
-
if(!html) {
|
2290
|
+
if (!html) {
|
1914
2291
|
return matches
|
1915
2292
|
}
|
1916
2293
|
|
1917
|
-
const $ = cheerio.load(html
|
1918
|
-
.replaceAll(/[\t\n\r]/gi, '')
|
1919
|
-
.trim())
|
2294
|
+
const $ = cheerio.load(html.replaceAll(/[\t\n\r]/gi, '').trim())
|
1920
2295
|
|
1921
2296
|
$('table.csgo_scoreboard_inner_right').each(function () {
|
1922
2297
|
const table = $(this)
|
@@ -1928,19 +2303,19 @@ class SteamUser {
|
|
1928
2303
|
tdEl = $(tdEl)
|
1929
2304
|
const text = tdEl.text().trim()
|
1930
2305
|
|
1931
|
-
if(text.startsWith('Competitive ')) {
|
2306
|
+
if (text.startsWith('Competitive ')) {
|
1932
2307
|
matchInfo.map = text.substringAfter('Competitive ')
|
1933
|
-
} else if(text.endsWith(' GMT')) {
|
2308
|
+
} else if (text.endsWith(' GMT')) {
|
1934
2309
|
matchInfo.time = text
|
1935
|
-
} else if(text.startsWith('Wait Time: ')) {
|
2310
|
+
} else if (text.startsWith('Wait Time: ')) {
|
1936
2311
|
matchInfo.waitTime = text.substringAfter('Wait Time: ')
|
1937
|
-
} else if(text.startsWith('Match Duration: ')) {
|
2312
|
+
} else if (text.startsWith('Match Duration: ')) {
|
1938
2313
|
matchInfo.duration = text.substringAfter('Match Duration: ')
|
1939
|
-
} else if(text === 'Download GOTV Replay') {
|
2314
|
+
} else if (text === 'Download GOTV Replay') {
|
1940
2315
|
matchInfo.GOTV_Replay = tdEl.find('a').attr('href')
|
1941
|
-
} else if(text.startsWith('Viewers: ')) {
|
2316
|
+
} else if (text.startsWith('Viewers: ')) {
|
1942
2317
|
matchInfo.viewers = parseInt(text.substringAfter('Viewers: '))
|
1943
|
-
} else if(text.startsWith('Ranked: Yes')) {
|
2318
|
+
} else if (text.startsWith('Ranked: Yes')) {
|
1944
2319
|
matchInfo.ranked = true
|
1945
2320
|
} else {
|
1946
2321
|
console_log(text)
|
@@ -1950,7 +2325,7 @@ class SteamUser {
|
|
1950
2325
|
|
1951
2326
|
const historyTable = table2json($, table, function ($, el, isHeader) {
|
1952
2327
|
el = $(el)
|
1953
|
-
if(!isHeader && el.attr('class') === 'inner_name') {
|
2328
|
+
if (!isHeader && el.attr('class') === 'inner_name') {
|
1954
2329
|
const link = el.find('a.linkTitle').attr('href')
|
1955
2330
|
return {
|
1956
2331
|
avatarHash: SteamUser.GetAvatarHashFromURL(el.find('.playerAvatar a > img[src]').attr('src')),
|
@@ -1963,7 +2338,7 @@ class SteamUser {
|
|
1963
2338
|
return el.text().trim()
|
1964
2339
|
})
|
1965
2340
|
|
1966
|
-
if(historyTable.length !== 11) {
|
2341
|
+
if (historyTable.length !== 11) {
|
1967
2342
|
return
|
1968
2343
|
}
|
1969
2344
|
//historyTable should be array of 11 elements
|
@@ -1973,8 +2348,8 @@ class SteamUser {
|
|
1973
2348
|
const winningTeam = ctScore > tScore ? 'ct' : (ctScore < tScore ? 't' : null)
|
1974
2349
|
const players = []
|
1975
2350
|
|
1976
|
-
for(let i = 0; i < 11; i++) {
|
1977
|
-
if(i === 5) {
|
2351
|
+
for (let i = 0; i < 11; i++) {
|
2352
|
+
if (i === 5) {
|
1978
2353
|
continue
|
1979
2354
|
}
|
1980
2355
|
const player = historyTable[i]
|
@@ -1984,19 +2359,19 @@ class SteamUser {
|
|
1984
2359
|
player.isLose = !player.isWin && !player.isTie
|
1985
2360
|
player.MatchWinLose = player.isWin ? MatchWinLose.Win : (player.isTie ? MatchWinLose.Tie : MatchWinLose.Lose)
|
1986
2361
|
|
1987
|
-
for(const key of ['Ping', 'K', 'A', 'D', 'Score']) {
|
1988
|
-
if(!isNaN(parseInt(player[key]))) {
|
2362
|
+
for (const key of ['Ping', 'K', 'A', 'D', 'Score']) {
|
2363
|
+
if (!isNaN(parseInt(player[key]))) {
|
1989
2364
|
player[key] = parseInt(player[key])
|
1990
2365
|
}
|
1991
2366
|
}
|
1992
2367
|
|
1993
2368
|
const MVP = player['★']
|
1994
2369
|
delete player['★']
|
1995
|
-
if(MVP === '') {
|
2370
|
+
if (MVP === '') {
|
1996
2371
|
player.MVP = 0
|
1997
|
-
} else if(MVP === '★') {
|
2372
|
+
} else if (MVP === '★') {
|
1998
2373
|
player.MVP = 1
|
1999
|
-
} else if(MVP.startsWith('★')) {
|
2374
|
+
} else if (MVP.startsWith('★')) {
|
2000
2375
|
player.MVP = parseInt(MVP.replaceAll('★', ''))
|
2001
2376
|
} else {
|
2002
2377
|
//error
|
@@ -2037,7 +2412,7 @@ class SteamUser {
|
|
2037
2412
|
return matches
|
2038
2413
|
}
|
2039
2414
|
|
2040
|
-
async getFullHistoryMatches({
|
2415
|
+
async getFullHistoryMatches ({
|
2041
2416
|
matchHistoryTypes = [],
|
2042
2417
|
cbOnMatch = null,
|
2043
2418
|
cbOnMatches = null,
|
@@ -2050,45 +2425,45 @@ class SteamUser {
|
|
2050
2425
|
continue_text,
|
2051
2426
|
matchHistoryType,
|
2052
2427
|
}) {
|
2053
|
-
if(maxPage === null) {
|
2428
|
+
if (maxPage === null) {
|
2054
2429
|
return false
|
2055
2430
|
} else {
|
2056
2431
|
return currentPage > maxPage
|
2057
2432
|
}
|
2058
|
-
}
|
2433
|
+
},
|
2059
2434
|
}) {
|
2060
2435
|
|
2061
|
-
if(!Array.isArray(matchHistoryTypes)) {
|
2436
|
+
if (!Array.isArray(matchHistoryTypes)) {
|
2062
2437
|
matchHistoryTypes = [matchHistoryTypes]
|
2063
2438
|
}
|
2064
2439
|
|
2065
2440
|
const results = {}
|
2066
|
-
if(maxPage === null && Started_playing_CS_GO === null) {
|
2441
|
+
if (maxPage === null && Started_playing_CS_GO === null) {
|
2067
2442
|
Started_playing_CS_GO = (await this.getPersonalGameDataAccountInformation())?.Started_playing_CS_GO
|
2068
2443
|
}
|
2069
|
-
if(!Started_playing_CS_GO || !(Started_playing_CS_GO = moment(Started_playing_CS_GO.replace('GMT', '+00'), `YYYY-MM-DD HH:mm:ss Z`)).isValid()) {
|
2444
|
+
if (!Started_playing_CS_GO || !(Started_playing_CS_GO = moment(Started_playing_CS_GO.replace('GMT', '+00'), `YYYY-MM-DD HH:mm:ss Z`)).isValid()) {
|
2070
2445
|
Started_playing_CS_GO = null
|
2071
2446
|
}
|
2072
|
-
for(const matchHistoryType of matchHistoryTypes) {
|
2447
|
+
for (const matchHistoryType of matchHistoryTypes) {
|
2073
2448
|
results[matchHistoryType] = await this._getFullHistoryMatches({
|
2074
2449
|
matchHistoryType,
|
2075
2450
|
cbOnMatch,
|
2076
2451
|
cbOnMatches,
|
2077
2452
|
maxPage,
|
2078
2453
|
Started_playing_CS_GO,
|
2079
|
-
shouldStop
|
2454
|
+
shouldStop,
|
2080
2455
|
})
|
2081
2456
|
}
|
2082
2457
|
return results
|
2083
2458
|
}
|
2084
2459
|
|
2085
|
-
async _getFullHistoryMatches({
|
2460
|
+
async _getFullHistoryMatches ({
|
2086
2461
|
matchHistoryType = '',
|
2087
2462
|
cbOnMatch,
|
2088
2463
|
cbOnMatches,
|
2089
2464
|
maxPage,
|
2090
2465
|
Started_playing_CS_GO,
|
2091
|
-
shouldStop
|
2466
|
+
shouldStop,
|
2092
2467
|
}) {
|
2093
2468
|
|
2094
2469
|
let result = null,
|
@@ -2106,30 +2481,30 @@ class SteamUser {
|
|
2106
2481
|
matchHistoryType,
|
2107
2482
|
})
|
2108
2483
|
|
2109
|
-
if(result.continue_text && Started_playing_CS_GO && moment(result.continue_text, 'YYYY-MM-DD').isBefore(Started_playing_CS_GO)) {
|
2484
|
+
if (result.continue_text && Started_playing_CS_GO && moment(result.continue_text, 'YYYY-MM-DD').isBefore(Started_playing_CS_GO)) {
|
2110
2485
|
stop = true
|
2111
2486
|
}
|
2112
2487
|
|
2113
|
-
if(!result.continue_token) {
|
2488
|
+
if (!result.continue_token) {
|
2114
2489
|
stop = true
|
2115
2490
|
}
|
2116
2491
|
|
2117
2492
|
Array.isArray(result.matches) && result.matches.length && typeof cbOnMatches === 'function' && await cbOnMatches(result.matches)
|
2118
2493
|
|
2119
|
-
for(const match of result.matches) {
|
2120
|
-
if(match.players.length) {
|
2494
|
+
for (const match of result.matches) {
|
2495
|
+
if (match.players.length) {
|
2121
2496
|
matches.push(match)
|
2122
2497
|
typeof cbOnMatch === 'function' && await cbOnMatch(match)
|
2123
2498
|
}
|
2124
2499
|
}
|
2125
|
-
} while(!stop)
|
2500
|
+
} while (!stop)
|
2126
2501
|
|
2127
2502
|
return matches
|
2128
2503
|
}
|
2129
2504
|
|
2130
2505
|
//{ success: 1 } means success
|
2131
2506
|
//{ success: 2 }
|
2132
|
-
async followUser(steamID) {
|
2507
|
+
async followUser (steamID) {
|
2133
2508
|
const { data } = await this._httpRequest({
|
2134
2509
|
url: `${this.getSteamUserProfileURL(steamID)}/followuser/`,
|
2135
2510
|
method: 'POST',
|
@@ -2139,7 +2514,7 @@ class SteamUser {
|
|
2139
2514
|
}
|
2140
2515
|
|
2141
2516
|
//from profile
|
2142
|
-
async unfollowUser(steamID) {
|
2517
|
+
async unfollowUser (steamID) {
|
2143
2518
|
const { data } = await this._httpRequest({
|
2144
2519
|
url: `${this.getSteamUserProfileURL(steamID)}/unfollowuser/`,
|
2145
2520
|
method: 'POST',
|
@@ -2149,7 +2524,7 @@ class SteamUser {
|
|
2149
2524
|
}
|
2150
2525
|
|
2151
2526
|
//from following manager
|
2152
|
-
async unfollowUsers(steamIDs) {
|
2527
|
+
async unfollowUsers (steamIDs) {
|
2153
2528
|
const formData = new URLSearchParams()
|
2154
2529
|
formData.append('steamid', this.getSteamidUser())
|
2155
2530
|
formData.append('ajax', '1')
|
@@ -2168,13 +2543,13 @@ class SteamUser {
|
|
2168
2543
|
}
|
2169
2544
|
|
2170
2545
|
//from following manager
|
2171
|
-
async unfollowAllFollowUsers() {
|
2546
|
+
async unfollowAllFollowUsers () {
|
2172
2547
|
const friends = await this.getMyFollowingPlayersList()
|
2173
2548
|
return await this.unfollowUsers(friends.map(r => r.steamId))
|
2174
2549
|
}
|
2175
2550
|
|
2176
2551
|
//true, false boolean
|
2177
|
-
async blockCommunicationUser(steamID) {
|
2552
|
+
async blockCommunicationUser (steamID) {
|
2178
2553
|
const { data } = await this._httpRequest({
|
2179
2554
|
url: `actions/BlockUserAjax`,
|
2180
2555
|
data: {
|
@@ -2188,7 +2563,7 @@ class SteamUser {
|
|
2188
2563
|
}
|
2189
2564
|
|
2190
2565
|
//true, false boolean
|
2191
|
-
async unblockCommunicationUser(steamID) {
|
2566
|
+
async unblockCommunicationUser (steamID) {
|
2192
2567
|
const { data } = await this._httpRequest({
|
2193
2568
|
url: `actions/BlockUserAjax`,
|
2194
2569
|
data: {
|
@@ -2202,7 +2577,7 @@ class SteamUser {
|
|
2202
2577
|
}
|
2203
2578
|
|
2204
2579
|
//{ invited: [ '76561199277912057' ], success: 1 }
|
2205
|
-
async addFriendUser(steamID) {
|
2580
|
+
async addFriendUser (steamID) {
|
2206
2581
|
const { data } = await this._httpRequest({
|
2207
2582
|
url: `actions/AddFriendAjax`,
|
2208
2583
|
data: {
|
@@ -2216,18 +2591,18 @@ class SteamUser {
|
|
2216
2591
|
}
|
2217
2592
|
|
2218
2593
|
//true, false boolean
|
2219
|
-
async removeFriend(steamID) {
|
2594
|
+
async removeFriend (steamID) {
|
2220
2595
|
const { data } = await this._httpRequest({
|
2221
2596
|
url: `actions/RemoveFriendAjax`,
|
2222
2597
|
data: {
|
2223
|
-
steamid: steamID
|
2598
|
+
steamid: steamID,
|
2224
2599
|
},
|
2225
2600
|
method: 'POST',
|
2226
2601
|
})
|
2227
2602
|
return data
|
2228
2603
|
}
|
2229
2604
|
|
2230
|
-
async acceptFriendRequest(steamID) {
|
2605
|
+
async acceptFriendRequest (steamID) {
|
2231
2606
|
const { data } = await this._httpRequest({
|
2232
2607
|
url: `${this.getMySteamUserProfileURL()}/friends/action`,
|
2233
2608
|
data: {
|
@@ -2248,16 +2623,16 @@ class SteamUser {
|
|
2248
2623
|
cGroupsPending: 0,
|
2249
2624
|
cFriends: 183,
|
2250
2625
|
cGroups: 1,
|
2251
|
-
success: 1
|
2252
|
-
}
|
2626
|
+
success: 1,
|
2627
|
+
},
|
2253
2628
|
}
|
2254
2629
|
}
|
2255
2630
|
|
2256
|
-
async cancelAddFriendUser(steamID) {
|
2631
|
+
async cancelAddFriendUser (steamID) {
|
2257
2632
|
return await this.removeFriend(steamID)
|
2258
2633
|
}
|
2259
2634
|
|
2260
|
-
async ignoreFriendRequest(steamID) {
|
2635
|
+
async ignoreFriendRequest (steamID) {
|
2261
2636
|
const { data } = await this._httpRequestAjax({
|
2262
2637
|
url: `actions/IgnoreFriendInviteAjax`,
|
2263
2638
|
data: {
|
@@ -2269,7 +2644,7 @@ class SteamUser {
|
|
2269
2644
|
}
|
2270
2645
|
|
2271
2646
|
//{"success":1,"nickname":"new nickname"}
|
2272
|
-
async setNickname(steamID, nickname) {
|
2647
|
+
async setNickname (steamID, nickname) {
|
2273
2648
|
const { data } = await this._httpRequestAjax({
|
2274
2649
|
url: `${this.getSteamUserProfileURL(steamID)}/ajaxsetnickname/`,
|
2275
2650
|
data: {
|
@@ -2281,62 +2656,63 @@ class SteamUser {
|
|
2281
2656
|
}
|
2282
2657
|
|
2283
2658
|
//{ success: 1, nickname: '' }
|
2284
|
-
async removeNickname(steamID) {
|
2659
|
+
async removeNickname (steamID) {
|
2285
2660
|
return await this.setNickname(steamID, '')
|
2286
2661
|
}
|
2287
2662
|
|
2288
|
-
async getNameHistory(steamID = this.getSteamidUser()) {
|
2663
|
+
async getNameHistory (steamID = this.getSteamidUser()) {
|
2289
2664
|
const { data } = await this._httpRequestAjax({
|
2290
2665
|
url: `${this.getSteamUserProfileURL(steamID)}/ajaxaliases/`,
|
2291
2666
|
method: 'POST',
|
2292
2667
|
})
|
2293
2668
|
return data
|
2294
|
-
const resultExample = [
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
|
2300
|
-
|
2669
|
+
const resultExample = [
|
2670
|
+
{
|
2671
|
+
newname: 'Natri',
|
2672
|
+
timechanged: '9 Aug @ 6:26am',
|
2673
|
+
}, {
|
2674
|
+
newname: 'Natri 1',
|
2675
|
+
timechanged: '9 Aug @ 6:26am',
|
2676
|
+
}]
|
2301
2677
|
}
|
2302
2678
|
|
2303
2679
|
getPreviousAliases = this.getNameHistory
|
2304
2680
|
|
2305
|
-
async clearPreviousAliases() {
|
2681
|
+
async clearPreviousAliases () {
|
2306
2682
|
const { data } = await this._httpRequestAjax({
|
2307
2683
|
url: `${this.getMySteamUserProfileURL()}/ajaxclearaliashistory/`,
|
2308
2684
|
method: 'POST',
|
2309
2685
|
headers: {
|
2310
|
-
'Content-Type': 'multipart/form-data'
|
2311
|
-
}
|
2686
|
+
'Content-Type': 'multipart/form-data',
|
2687
|
+
},
|
2312
2688
|
})
|
2313
2689
|
return data
|
2314
2690
|
}
|
2315
2691
|
|
2316
|
-
async setupProfile() {
|
2692
|
+
async setupProfile () {
|
2317
2693
|
const profile = await this._httpRequest(`/edit?welcomed=1`)
|
2318
|
-
if(!profile.data) {
|
2694
|
+
if (!profile.data) {
|
2319
2695
|
return false
|
2320
2696
|
}
|
2321
2697
|
const $ = profile._$()
|
2322
2698
|
return $('title').text() == 'Steam Community :: Edit Profile'
|
2323
2699
|
}
|
2324
2700
|
|
2325
|
-
async editMyProfile({
|
2701
|
+
async editMyProfile ({
|
2326
2702
|
personaName = null,
|
2327
2703
|
realName = null,
|
2328
2704
|
customURL = null,
|
2329
2705
|
country = null,
|
2330
2706
|
summary = null,
|
2331
|
-
hide_profile_awards = null
|
2707
|
+
hide_profile_awards = null,
|
2332
2708
|
}) {
|
2333
2709
|
const existProfile = await this._httpRequest(`/my/edit/info`)
|
2334
|
-
if(!existProfile.data) {
|
2710
|
+
if (!existProfile.data) {
|
2335
2711
|
return
|
2336
2712
|
}
|
2337
2713
|
const $ = existProfile._$()
|
2338
2714
|
const profileEdit = $('#profile_edit_config').data('profile-edit')
|
2339
|
-
if(!profileEdit) {
|
2715
|
+
if (!profileEdit) {
|
2340
2716
|
return
|
2341
2717
|
}
|
2342
2718
|
|
@@ -2368,23 +2744,38 @@ class SteamUser {
|
|
2368
2744
|
return data
|
2369
2745
|
const successExample = {
|
2370
2746
|
success: 1,
|
2371
|
-
errmsg: ''
|
2747
|
+
errmsg: '',
|
2372
2748
|
}
|
2373
2749
|
const errorExample = {
|
2374
2750
|
success: 2,
|
2375
|
-
errmsg: 'The profile URL specified is already in use<br />Bad location specified.<br />'
|
2751
|
+
errmsg: 'The profile URL specified is already in use<br />Bad location specified.<br />',
|
2376
2752
|
}
|
2377
2753
|
}
|
2378
2754
|
|
2379
|
-
|
2755
|
+
async setPersonaName (name) {
|
2756
|
+
const result = await this._httpRequestAjax({
|
2757
|
+
url: `${this.getMySteamUserProfileURL()}/ajaxsetpersonaname/`,
|
2758
|
+
method: 'POST',
|
2759
|
+
data: {
|
2760
|
+
persona: name,
|
2761
|
+
},
|
2762
|
+
headers: {
|
2763
|
+
'Content-Type': 'multipart/form-data',
|
2764
|
+
},
|
2765
|
+
})
|
2766
|
+
return result
|
2767
|
+
const successResult = { success: true, message: '' }
|
2768
|
+
}
|
2769
|
+
|
2770
|
+
static _formatPrivacySettings2String (privacySettings) {//number to string
|
2380
2771
|
const Privacy = privacySettings?.data?.Privacy || privacySettings?.Privacy
|
2381
|
-
if(!Privacy) {
|
2772
|
+
if (!Privacy) {
|
2382
2773
|
return
|
2383
2774
|
}
|
2384
2775
|
|
2385
2776
|
const _Privacy = Object.entries(Privacy.PrivacySettings).reduce((previousValue, [field, setting]) => ({
|
2386
2777
|
...previousValue,
|
2387
|
-
[field]: Object.entries(SteamUser._EPrivacyState).find(([, value]) => value == setting)[0]
|
2778
|
+
[field]: Object.entries(SteamUser._EPrivacyState).find(([, value]) => value == setting)[0],
|
2388
2779
|
}), {})
|
2389
2780
|
|
2390
2781
|
_Privacy.eCommentPermission = Object.entries(SteamUser._ECommentPrivacyState).find(([, value]) => value == Privacy.eCommentPermission)[0]
|
@@ -2396,18 +2787,18 @@ class SteamUser {
|
|
2396
2787
|
gameDetails: _Privacy.PrivacyOwnedGames,
|
2397
2788
|
playtime: _Privacy.PrivacyPlaytime,
|
2398
2789
|
friendsList: _Privacy.PrivacyFriendsList,
|
2399
|
-
comment: _Privacy.eCommentPermission
|
2790
|
+
comment: _Privacy.eCommentPermission,
|
2400
2791
|
}
|
2401
2792
|
}
|
2402
2793
|
|
2403
|
-
static _formatPrivacySettings2Value(privacySettings) {//string to number
|
2794
|
+
static _formatPrivacySettings2Value (privacySettings) {//string to number
|
2404
2795
|
const _Privacy = Object.entries(privacySettings).reduce((previousValue, [key, value]) => {
|
2405
2796
|
const mapping = (key === 'comment' ? SteamUser._ECommentPrivacyState : SteamUser._EPrivacyState)
|
2406
2797
|
//value: string or number
|
2407
2798
|
let newValue
|
2408
|
-
if(Object.hasOwn(mapping, value)) {
|
2799
|
+
if (Object.hasOwn(mapping, value)) {
|
2409
2800
|
newValue = mapping[value]
|
2410
|
-
} else if(!isNaN(parseInt(value))) {
|
2801
|
+
} else if (!isNaN(parseInt(value))) {
|
2411
2802
|
newValue = value
|
2412
2803
|
} else {
|
2413
2804
|
throw new Error(`Invalid privacySettings value: ${value}`)
|
@@ -2415,7 +2806,7 @@ class SteamUser {
|
|
2415
2806
|
|
2416
2807
|
return {
|
2417
2808
|
...previousValue,
|
2418
|
-
[key]: newValue
|
2809
|
+
[key]: newValue,
|
2419
2810
|
}
|
2420
2811
|
}, {})
|
2421
2812
|
|
@@ -2432,12 +2823,12 @@ class SteamUser {
|
|
2432
2823
|
}
|
2433
2824
|
}
|
2434
2825
|
|
2435
|
-
async getPrivacySettings() {
|
2826
|
+
async getPrivacySettings () {
|
2436
2827
|
const result = await this._httpRequest({
|
2437
2828
|
url: `${this.getMySteamUserProfileURL()}/edit/settings`,
|
2438
2829
|
})
|
2439
2830
|
|
2440
|
-
if(!result.data) {
|
2831
|
+
if (!result.data) {
|
2441
2832
|
return
|
2442
2833
|
}
|
2443
2834
|
|
@@ -2460,49 +2851,51 @@ class SteamUser {
|
|
2460
2851
|
locState: '',
|
2461
2852
|
locStateCode: '',
|
2462
2853
|
locCity: '',
|
2463
|
-
locCityCode: ''
|
2854
|
+
locCityCode: '',
|
2464
2855
|
},
|
2465
2856
|
ActiveTheme: {
|
2466
2857
|
theme_id: '',
|
2467
|
-
title: '#ProfileTheme_Default'
|
2858
|
+
title: '#ProfileTheme_Default',
|
2468
2859
|
},
|
2469
2860
|
ProfilePreferences: {
|
2470
|
-
hide_profile_awards: 0
|
2861
|
+
hide_profile_awards: 0,
|
2471
2862
|
},
|
2472
|
-
rgAvailableThemes: [
|
2473
|
-
|
2474
|
-
|
2475
|
-
|
2476
|
-
|
2477
|
-
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2485
|
-
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
|
2499
|
-
|
2500
|
-
|
2501
|
-
|
2502
|
-
|
2503
|
-
|
2504
|
-
|
2505
|
-
|
2863
|
+
rgAvailableThemes: [
|
2864
|
+
{
|
2865
|
+
theme_id: '',
|
2866
|
+
title: '#ProfileTheme_Default',
|
2867
|
+
}, {
|
2868
|
+
theme_id: 'Summer',
|
2869
|
+
title: '#ProfileTheme_Summer',
|
2870
|
+
}, {
|
2871
|
+
theme_id: 'Midnight',
|
2872
|
+
title: '#ProfileTheme_Midnight',
|
2873
|
+
}, {
|
2874
|
+
theme_id: 'Steel',
|
2875
|
+
title: '#ProfileTheme_Steel',
|
2876
|
+
}, {
|
2877
|
+
theme_id: 'Cosmic',
|
2878
|
+
title: '#ProfileTheme_Cosmic',
|
2879
|
+
}, {
|
2880
|
+
theme_id: 'DarkMode',
|
2881
|
+
title: '#ProfileTheme_DarkMode',
|
2882
|
+
}],
|
2883
|
+
rgGoldenProfileData: [
|
2884
|
+
{
|
2885
|
+
appid: 1017190,
|
2886
|
+
css_url: 'https://community.cloudflare.steamstatic.com/public/css/promo/lny2019/goldenprofile.css?v=MNHyDjqMV1IZ&l=english&_cdn=cloudflare',
|
2887
|
+
frame_url: null,
|
2888
|
+
miniprofile_background: null,
|
2889
|
+
miniprofile_movie: null,
|
2890
|
+
}, {
|
2891
|
+
appid: 1263950,
|
2892
|
+
css_url: 'https://community.cloudflare.steamstatic.com/public/css/promo/rewardsseason1/goldenprofile.css?v=.xVjuuVRtFd6T&_cdn=cloudflare',
|
2893
|
+
frame_url: 'https://cdn.cloudflare.steamstatic.com/steamcommunity/public/assets/rewardsseason1/goldenprofile/presige_frame_anim.png?v=2',
|
2894
|
+
miniprofile_background: 'https://cdn.cloudflare.steamstatic.com/steamcommunity/public/assets/rewardsseason1/goldenprofile/gp_mini_profile_still.png?v=2',
|
2895
|
+
miniprofile_movie: {
|
2896
|
+
'video/webm': 'https://cdn.cloudflare.steamstatic.com/steamcommunity/public/assets/rewardsseason1/goldenprofile/summer2020_golden_mini_profile_background.webm?v=2',
|
2897
|
+
},
|
2898
|
+
}],
|
2506
2899
|
Privacy: {
|
2507
2900
|
PrivacySettings: {
|
2508
2901
|
PrivacyProfile: 'Public',//Your community profile includes your profile summary, friends list, badges, Steam Level, showcases, comments, and group membership.
|
@@ -2510,22 +2903,22 @@ class SteamUser {
|
|
2510
2903
|
PrivacyInventoryGifts: 'Public',//Always keep Steam Gifts private even if users can see my inventory.
|
2511
2904
|
PrivacyOwnedGames: 'Public',//Game details
|
2512
2905
|
PrivacyPlaytime: 'Public',//Always keep my total playtime private even if users can see my game details.
|
2513
|
-
PrivacyFriendsList: 'Public'
|
2906
|
+
PrivacyFriendsList: 'Public',//This controls who can see your list of friends on your Steam Community profile.
|
2514
2907
|
},
|
2515
|
-
eCommentPermission: 'Public'
|
2908
|
+
eCommentPermission: 'Public',
|
2516
2909
|
},
|
2517
|
-
webapi_token: '38a169cea9b4402fe1a3db093a0f0e1b'
|
2910
|
+
webapi_token: '38a169cea9b4402fe1a3db093a0f0e1b',
|
2518
2911
|
}
|
2519
2912
|
}
|
2520
2913
|
|
2521
|
-
async updatePrivacySettings(privacySettings) {
|
2914
|
+
async updatePrivacySettings (privacySettings) {
|
2522
2915
|
let existingSettings = {}
|
2523
2916
|
//get missing setting
|
2524
|
-
if(Object.keys(PrivacySettings).some(key => !Object.hasOwn(privacySettings, key))) {
|
2917
|
+
if (Object.keys(PrivacySettings).some(key => !Object.hasOwn(privacySettings, key))) {
|
2525
2918
|
existingSettings = await this.getPrivacySettings()
|
2526
|
-
if(existingSettings) {
|
2919
|
+
if (existingSettings) {
|
2527
2920
|
const isEqual = _.isEqual(_.pick(existingSettings, Object.keys(privacySettings)), privacySettings)
|
2528
|
-
if(isEqual) {
|
2921
|
+
if (isEqual) {
|
2529
2922
|
//nothing to update
|
2530
2923
|
return
|
2531
2924
|
}
|
@@ -2545,21 +2938,21 @@ class SteamUser {
|
|
2545
2938
|
method: 'POST',
|
2546
2939
|
data: {
|
2547
2940
|
Privacy: JSON.stringify(privacyValue.PrivacySettings),
|
2548
|
-
eCommentPermission: privacyValue.eCommentPermission
|
2941
|
+
eCommentPermission: privacyValue.eCommentPermission,
|
2549
2942
|
},
|
2550
2943
|
headers: {
|
2551
|
-
'Content-Type': 'multipart/form-data'
|
2552
|
-
}
|
2944
|
+
'Content-Type': 'multipart/form-data',
|
2945
|
+
},
|
2553
2946
|
})
|
2554
2947
|
|
2555
|
-
if(!data || data === 'null') {
|
2948
|
+
if (!data || data === 'null') {
|
2556
2949
|
return
|
2557
2950
|
}
|
2558
2951
|
|
2559
2952
|
return SteamUser._formatPrivacySettings2String(data)
|
2560
2953
|
}
|
2561
2954
|
|
2562
|
-
async publicPrivacySettings() {
|
2955
|
+
async publicPrivacySettings () {
|
2563
2956
|
return await this.updatePrivacySettings({
|
2564
2957
|
profile: EPrivacyState.Public,
|
2565
2958
|
inventory: EPrivacyState.Public,
|
@@ -2567,11 +2960,11 @@ class SteamUser {
|
|
2567
2960
|
gameDetails: EPrivacyState.Public,
|
2568
2961
|
playtime: EPrivacyState.Public,
|
2569
2962
|
friendsList: EPrivacyState.Public,
|
2570
|
-
comment: EPrivacyState.Public
|
2963
|
+
comment: EPrivacyState.Public,
|
2571
2964
|
})
|
2572
2965
|
}
|
2573
2966
|
|
2574
|
-
async privatePrivacySettings() {
|
2967
|
+
async privatePrivacySettings () {
|
2575
2968
|
return await this.updatePrivacySettings({
|
2576
2969
|
profile: EPrivacyState.Private,
|
2577
2970
|
inventory: EPrivacyState.Private,
|
@@ -2579,11 +2972,11 @@ class SteamUser {
|
|
2579
2972
|
gameDetails: EPrivacyState.Private,
|
2580
2973
|
playtime: EPrivacyState.Private,
|
2581
2974
|
friendsList: EPrivacyState.Private,
|
2582
|
-
comment: EPrivacyState.Private
|
2975
|
+
comment: EPrivacyState.Private,
|
2583
2976
|
})
|
2584
2977
|
}
|
2585
2978
|
|
2586
|
-
async postComment(steamID, message) {
|
2979
|
+
async postComment (steamID, message) {
|
2587
2980
|
const { data } = await this._httpRequestAjax({
|
2588
2981
|
url: `comment/Profile/post/${steamID}/-1/`,
|
2589
2982
|
method: 'POST',
|
@@ -2591,9 +2984,9 @@ class SteamUser {
|
|
2591
2984
|
comment: message,
|
2592
2985
|
count: 6,
|
2593
2986
|
feature2: -1,
|
2594
|
-
}
|
2987
|
+
},
|
2595
2988
|
})
|
2596
|
-
if(!data?.comments_html) {
|
2989
|
+
if (!data?.comments_html) {
|
2597
2990
|
return
|
2598
2991
|
}
|
2599
2992
|
|
@@ -2603,7 +2996,7 @@ class SteamUser {
|
|
2603
2996
|
|
2604
2997
|
const errorExample = {
|
2605
2998
|
success: false,
|
2606
|
-
error: 'You\'ve been posting too frequently, and can\'t make another post right now'
|
2999
|
+
error: 'You\'ve been posting too frequently, and can\'t make another post right now',
|
2607
3000
|
}
|
2608
3001
|
const successExample = {
|
2609
3002
|
success: true,
|
@@ -2615,18 +3008,19 @@ class SteamUser {
|
|
2615
3008
|
has_upvoted: 0,
|
2616
3009
|
comments_html: '\t\t\r\n\t\r\n\t<div data-panel="{"flow-children":"row","type":"PanelGroup"}" class="commentthread_comment responsive_body_text " id="comment_3455968685021221554" style="">\r\n\t\t\t\t<div class="commentthread_comment_avatar playerAvatar online">\r\n\t\t\t\t\t\t<a href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t\t\t\t\t<img src="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg" srcset="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg 1x, https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64_medium.jpg 2x">\t\t\t\t\t\t\t</a>\r\n\t\t</div>\r\n\t\t<div class="commentthread_comment_content">\r\n\t\t\t<div data-panel="{"flow-children":"row"}" class="commentthread_comment_author">\r\n\t\t\t\t<a class="hoverunderline commentthread_author_link" href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t<bdi>Natri</bdi></a>\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t<span class="commentthread_comment_timestamp" title="9 August, 2022 @ 6:36:13 am +07" data-timestamp="1660001773">\r\n\t\t\t\t\tJust now \r\n\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<div class="commentthread_comment_actions" >\r\n\t\t\t\t\t<a class="actionlink" data-tooltip-text="Delete" href="javascript:CCommentThread.DeleteComment( \'Profile_76561199277912057\', \'3455968685021221554\' );"><img src="https://community.cloudflare.steamstatic.com/public/images/skin_1/notification_icon_trash_bright.png?v=1" ></a>\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class="commentthread_comment_text" id="comment_content_3455968685021221554">\r\n\t\t\t\tddddddd\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\r\n\t\r\n\t<div data-panel="{"flow-children":"row","type":"PanelGroup"}" class="commentthread_comment responsive_body_text " id="comment_3455968685021217640" style="">\r\n\t\t\t\t<div class="commentthread_comment_avatar playerAvatar online">\r\n\t\t\t\t\t\t<a href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t\t\t\t\t<img src="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg" srcset="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg 1x, https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64_medium.jpg 2x">\t\t\t\t\t\t\t</a>\r\n\t\t</div>\r\n\t\t<div class="commentthread_comment_content">\r\n\t\t\t<div data-panel="{"flow-children":"row"}" class="commentthread_comment_author">\r\n\t\t\t\t<a class="hoverunderline commentthread_author_link" href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t<bdi>Natri</bdi></a>\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t<span class="commentthread_comment_timestamp" title="9 August, 2022 @ 6:34:41 am +07" data-timestamp="1660001681">\r\n\t\t\t\t\tJust now \r\n\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<div class="commentthread_comment_actions" >\r\n\t\t\t\t\t<a class="actionlink" data-tooltip-text="Delete" href="javascript:CCommentThread.DeleteComment( \'Profile_76561199277912057\', \'3455968685021217640\' );"><img src="https://community.cloudflare.steamstatic.com/public/images/skin_1/notification_icon_trash_bright.png?v=1" ></a>\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class="commentthread_comment_text" id="comment_content_3455968685021217640">\r\n\t\t\t\tddddddd\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\r\n\t\r\n\t<div data-panel="{"flow-children":"row","type":"PanelGroup"}" class="commentthread_comment responsive_body_text " id="comment_3455968685021214294" style="">\r\n\t\t\t\t<div class="commentthread_comment_avatar playerAvatar online">\r\n\t\t\t\t\t\t<a href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t\t\t\t\t<img src="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg" srcset="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg 1x, https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64_medium.jpg 2x">\t\t\t\t\t\t\t</a>\r\n\t\t</div>\r\n\t\t<div class="commentthread_comment_content">\r\n\t\t\t<div data-panel="{"flow-children":"row"}" class="commentthread_comment_author">\r\n\t\t\t\t<a class="hoverunderline commentthread_author_link" href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t<bdi>Natri</bdi></a>\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t<span class="commentthread_comment_timestamp" title="9 August, 2022 @ 6:33:22 am +07" data-timestamp="1660001602">\r\n\t\t\t\t\t2 minutes ago \r\n\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<div class="commentthread_comment_actions" >\r\n\t\t\t\t\t<a class="actionlink" data-tooltip-text="Delete" href="javascript:CCommentThread.DeleteComment( \'Profile_76561199277912057\', \'3455968685021214294\' );"><img src="https://community.cloudflare.steamstatic.com/public/images/skin_1/notification_icon_trash_bright.png?v=1" ></a>\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class="commentthread_comment_text" id="comment_content_3455968685021214294">\r\n\t\t\t\tddddddd\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\r\n\t\r\n\t<div data-panel="{"flow-children":"row","type":"PanelGroup"}" class="commentthread_comment responsive_body_text " id="comment_3455968685021213633" style="">\r\n\t\t\t\t<div class="commentthread_comment_avatar playerAvatar online">\r\n\t\t\t\t\t\t<a href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t\t\t\t\t<img src="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg" srcset="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg 1x, https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64_medium.jpg 2x">\t\t\t\t\t\t\t</a>\r\n\t\t</div>\r\n\t\t<div class="commentthread_comment_content">\r\n\t\t\t<div data-panel="{"flow-children":"row"}" class="commentthread_comment_author">\r\n\t\t\t\t<a class="hoverunderline commentthread_author_link" href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t<bdi>Natri</bdi></a>\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t<span class="commentthread_comment_timestamp" title="9 August, 2022 @ 6:33:06 am +07" data-timestamp="1660001586">\r\n\t\t\t\t\t3 minutes ago \r\n\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<div class="commentthread_comment_actions" >\r\n\t\t\t\t\t<a class="actionlink" data-tooltip-text="Delete" href="javascript:CCommentThread.DeleteComment( \'Profile_76561199277912057\', \'3455968685021213633\' );"><img src="https://community.cloudflare.steamstatic.com/public/images/skin_1/notification_icon_trash_bright.png?v=1" ></a>\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class="commentthread_comment_text" id="comment_content_3455968685021213633">\r\n\t\t\t\tddddddd\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\r\n\t\r\n\t<div data-panel="{"flow-children":"row","type":"PanelGroup"}" class="commentthread_comment responsive_body_text " id="comment_3455968685021212374" style="">\r\n\t\t\t\t<div class="commentthread_comment_avatar playerAvatar online">\r\n\t\t\t\t\t\t<a href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t\t\t\t\t<img src="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg" srcset="https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg 1x, https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64_medium.jpg 2x">\t\t\t\t\t\t\t</a>\r\n\t\t</div>\r\n\t\t<div class="commentthread_comment_content">\r\n\t\t\t<div data-panel="{"flow-children":"row"}" class="commentthread_comment_author">\r\n\t\t\t\t<a class="hoverunderline commentthread_author_link" href="https://steamcommunity.com/id/natri99" data-miniprofile="1080136620">\r\n\t\t\t\t\t<bdi>Natri</bdi></a>\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t<span class="commentthread_comment_timestamp" title="9 August, 2022 @ 6:32:37 am +07" data-timestamp="1660001557">\r\n\t\t\t\t\t3 minutes ago \r\n\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<div class="commentthread_comment_actions" >\r\n\t\t\t\t\t<a class="actionlink" data-tooltip-text="Delete" href="javascript:CCommentThread.DeleteComment( \'Profile_76561199277912057\', \'3455968685021212374\' );"><img src="https://community.cloudflare.steamstatic.com/public/images/skin_1/notification_icon_trash_bright.png?v=1" ></a>\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class="commentthread_comment_text" id="comment_content_3455968685021212374">\r\n\t\t\t\tddddddd\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n',
|
2617
3010
|
timelastpost: 1660001773,
|
2618
|
-
comments: [
|
2619
|
-
|
2620
|
-
|
2621
|
-
|
2622
|
-
|
2623
|
-
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
|
2628
|
-
|
2629
|
-
|
3011
|
+
comments: [
|
3012
|
+
{
|
3013
|
+
id: '3455968685021221554',
|
3014
|
+
content: 'ddddddd',
|
3015
|
+
timestamp: 1660001773,
|
3016
|
+
author: {
|
3017
|
+
steamID: '76561199040402348',
|
3018
|
+
profileURL: 'https://steamcommunity.com/id/natri99',
|
3019
|
+
miniprofile: 1080136620,
|
3020
|
+
name: 'Natri',
|
3021
|
+
avatar: 'https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg',
|
3022
|
+
},
|
3023
|
+
}],
|
2630
3024
|
comment: {
|
2631
3025
|
id: '3455968685021221554',
|
2632
3026
|
content: 'ddddddd',
|
@@ -2636,13 +3030,13 @@ class SteamUser {
|
|
2636
3030
|
profileURL: 'https://steamcommunity.com/id/natri99',
|
2637
3031
|
miniprofile: 1080136620,
|
2638
3032
|
name: 'Natri',
|
2639
|
-
avatar: 'https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg'
|
2640
|
-
}
|
2641
|
-
}
|
3033
|
+
avatar: 'https://avatars.cloudflare.steamstatic.com/834966fea6a0a8a3b7011db7f96d38b51ee0ba64.jpg',
|
3034
|
+
},
|
3035
|
+
},
|
2642
3036
|
}
|
2643
3037
|
}
|
2644
3038
|
|
2645
|
-
async deleteComment(steamID, gidcomment) {
|
3039
|
+
async deleteComment (steamID, gidcomment) {
|
2646
3040
|
const { data } = await this._httpRequestAjax({
|
2647
3041
|
url: `comment/Profile/delete/${steamID}/-1/`,
|
2648
3042
|
method: 'POST',
|
@@ -2651,7 +3045,7 @@ class SteamUser {
|
|
2651
3045
|
start: 0,
|
2652
3046
|
count: 6,
|
2653
3047
|
feature2: -1,
|
2654
|
-
}
|
3048
|
+
},
|
2655
3049
|
})
|
2656
3050
|
return data
|
2657
3051
|
const successExample = {
|
@@ -2663,35 +3057,32 @@ class SteamUser {
|
|
2663
3057
|
upvotes: 0,
|
2664
3058
|
has_upvoted: 0,
|
2665
3059
|
comments_html: '',
|
2666
|
-
timelastpost: 0
|
3060
|
+
timelastpost: 0,
|
2667
3061
|
}
|
2668
3062
|
}
|
2669
3063
|
|
2670
|
-
_formatCommentModel(comment) {
|
2671
|
-
if(comment?.comments_html) {
|
2672
|
-
comment.commentID = comment.comments_html?.substringAfter('javascript:CCommentThread.DeleteComment')
|
2673
|
-
|
2674
|
-
?.substringBefore('\' );')
|
2675
|
-
comment.steamID = comment.comments_html?.substringAfter('javascript:CCommentThread.DeleteComment( \'Profile_')
|
2676
|
-
?.substringBefore('\', \'')
|
3064
|
+
_formatCommentModel (comment) {
|
3065
|
+
if (comment?.comments_html) {
|
3066
|
+
comment.commentID = comment.comments_html?.substringAfter('javascript:CCommentThread.DeleteComment')?.substringAfter('\', \'')?.substringBefore('\' );')
|
3067
|
+
comment.steamID = comment.comments_html?.substringAfter('javascript:CCommentThread.DeleteComment( \'Profile_')?.substringBefore('\', \'')
|
2677
3068
|
}
|
2678
3069
|
return comment
|
2679
3070
|
}
|
2680
3071
|
|
2681
|
-
_formatPlayingTime(hrs) {
|
2682
|
-
if(typeof hrs !== 'string') {
|
3072
|
+
_formatPlayingTime (hrs) {
|
3073
|
+
if (typeof hrs !== 'string') {
|
2683
3074
|
return hrs
|
2684
3075
|
}
|
2685
3076
|
hrs = hrs.trim()
|
2686
|
-
if(hrs.endsWith('hrs')) {
|
3077
|
+
if (hrs.endsWith('hrs')) {
|
2687
3078
|
return parseFloat(hrs.substringBefore('hrs'))
|
2688
3079
|
}
|
2689
3080
|
return hrs
|
2690
3081
|
}
|
2691
3082
|
|
2692
3083
|
//sorted: false, ASC, DESC
|
2693
|
-
async getFriendsThatPlay(appID, sorted = false) {
|
2694
|
-
if(!appID) {
|
3084
|
+
async getFriendsThatPlay (appID, sorted = false) {
|
3085
|
+
if (!appID) {
|
2695
3086
|
return
|
2696
3087
|
}
|
2697
3088
|
const _self = this
|
@@ -2703,7 +3094,7 @@ class SteamUser {
|
|
2703
3094
|
FriendsPreviously: [],//Friends who have played Counter-Strike: Global Offensive previously _
|
2704
3095
|
FriendsAddedLibrary: [],//Friends who have Counter-Strike: Global Offensive in their library _
|
2705
3096
|
}
|
2706
|
-
if(!result.data) {
|
3097
|
+
if (!result.data) {
|
2707
3098
|
return data
|
2708
3099
|
}
|
2709
3100
|
const $ = result._$()
|
@@ -2711,29 +3102,29 @@ class SteamUser {
|
|
2711
3102
|
|
2712
3103
|
$('#memberList').children(function () {
|
2713
3104
|
const el = $(this)
|
2714
|
-
if(el.hasClass('mainSectionHeader')) {
|
3105
|
+
if (el.hasClass('mainSectionHeader')) {
|
2715
3106
|
const title = el.text()?.trim() || ''
|
2716
|
-
if(title.startsWith('Your own playtime')) {
|
3107
|
+
if (title.startsWith('Your own playtime')) {
|
2717
3108
|
currentList = data.YourOwnPlaytime
|
2718
|
-
} else if(title.startsWith('Friends currently playing')) {
|
3109
|
+
} else if (title.startsWith('Friends currently playing')) {
|
2719
3110
|
currentList = data.FriendsCurrentlyPlaying
|
2720
|
-
} else if(title.startsWith('Friends who have played') && title.includes('in the last 2 weeks')) {
|
3111
|
+
} else if (title.startsWith('Friends who have played') && title.includes('in the last 2 weeks')) {
|
2721
3112
|
currentList = data.FriendsTwoWeeks
|
2722
|
-
} else if(title.startsWith('Friends who have played') && title.includes('previously')) {
|
3113
|
+
} else if (title.startsWith('Friends who have played') && title.includes('previously')) {
|
2723
3114
|
currentList = data.FriendsPreviously
|
2724
|
-
} else if(title.startsWith('Friends who have') && !title.startsWith('Friends who have played') && title.includes('in their library')) {
|
3115
|
+
} else if (title.startsWith('Friends who have') && !title.startsWith('Friends who have played') && title.includes('in their library')) {
|
2725
3116
|
currentList = data.FriendsAddedLibrary
|
2726
3117
|
}
|
2727
|
-
} else if(el.hasClass('profile_friends')) {
|
3118
|
+
} else if (el.hasClass('profile_friends')) {
|
2728
3119
|
el.find('.friendBlock.persona').each(function () {
|
2729
3120
|
const friendBlock = $(this)
|
2730
3121
|
const miniprofile = parseInt(friendBlock.attr('data-miniprofile'))
|
2731
3122
|
let onlineStatus = ''
|
2732
|
-
if(friendBlock.hasClass('in-game')) {
|
3123
|
+
if (friendBlock.hasClass('in-game')) {
|
2733
3124
|
onlineStatus = 'ingame'
|
2734
|
-
} else if(friendBlock.hasClass('online')) {
|
3125
|
+
} else if (friendBlock.hasClass('online')) {
|
2735
3126
|
onlineStatus = 'online'
|
2736
|
-
} else if(friendBlock.hasClass('offline')) {
|
3127
|
+
} else if (friendBlock.hasClass('offline')) {
|
2737
3128
|
onlineStatus = 'offline'
|
2738
3129
|
}
|
2739
3130
|
const friendBlockContent = friendBlock.find('.friendBlockContent')
|
@@ -2744,8 +3135,8 @@ class SteamUser {
|
|
2744
3135
|
last2Week: '',
|
2745
3136
|
total: '',
|
2746
3137
|
}
|
2747
|
-
if(friendSmallText) {
|
2748
|
-
if(friendSmallText.includes('/')) {
|
3138
|
+
if (friendSmallText) {
|
3139
|
+
if (friendSmallText.includes('/')) {
|
2749
3140
|
playingTime.last2Week = _self._formatPlayingTime(friendSmallText.substringBeforeOrNull('/')?.trim())
|
2750
3141
|
playingTime.total = _self._formatPlayingTime(friendSmallText.substringAfterOrNull('/')?.trim())
|
2751
3142
|
} else {
|
@@ -2767,23 +3158,23 @@ class SteamUser {
|
|
2767
3158
|
|
2768
3159
|
})
|
2769
3160
|
|
2770
|
-
if(sorted) {
|
3161
|
+
if (sorted) {
|
2771
3162
|
const order = sorted === 'ASC' ? 1 : -1
|
2772
|
-
for(let key in data) {
|
3163
|
+
for (let key in data) {
|
2773
3164
|
data[key].sort(function (player1, player2) {
|
2774
3165
|
const player1_last2Week = player1.playingTime?.last2Week || 0
|
2775
3166
|
const player2_last2Week = player2.playingTime?.last2Week || 0
|
2776
3167
|
|
2777
|
-
if(player1_last2Week > player2_last2Week) {
|
3168
|
+
if (player1_last2Week > player2_last2Week) {
|
2778
3169
|
return order
|
2779
|
-
} else if(player1_last2Week < player2_last2Week) {
|
3170
|
+
} else if (player1_last2Week < player2_last2Week) {
|
2780
3171
|
return -order
|
2781
3172
|
} else {
|
2782
3173
|
const player1_total = player1.playingTime?.total || 0
|
2783
3174
|
const player2_total = player2.playingTime?.total || 0
|
2784
|
-
if(player1_total > player2_total) {
|
3175
|
+
if (player1_total > player2_total) {
|
2785
3176
|
return order
|
2786
|
-
} else if(player1_total < player2_total) {
|
3177
|
+
} else if (player1_total < player2_total) {
|
2787
3178
|
return -order
|
2788
3179
|
} else {
|
2789
3180
|
return 0
|
@@ -2796,68 +3187,65 @@ class SteamUser {
|
|
2796
3187
|
return data
|
2797
3188
|
}
|
2798
3189
|
|
2799
|
-
async getOwnedAppsDetail() {
|
3190
|
+
async getOwnedAppsDetail () {
|
2800
3191
|
const response = await this._httpRequest(`${this.getMySteamUserProfileURL()}/games/?tab=all`)
|
2801
3192
|
|
2802
|
-
let rgGames = response
|
2803
|
-
|
2804
|
-
?.substringBetweenOrNull('var rgGames = ', 'var rgChangingGames = []')
|
2805
|
-
?.trim()
|
2806
|
-
?.removeSuffix(';')
|
2807
|
-
?.trim()
|
2808
|
-
if(!rgGames) {
|
3193
|
+
let rgGames = response?.data?.substringBetweenOrNull('var rgGames = ', 'var rgChangingGames = []')?.trim()?.removeSuffix(';')?.trim()
|
3194
|
+
if (!rgGames) {
|
2809
3195
|
return
|
2810
3196
|
}
|
2811
3197
|
|
2812
3198
|
rgGames = JSON_parse(rgGames)
|
2813
3199
|
return rgGames
|
2814
|
-
const resultExample = [
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
3200
|
+
const resultExample = [
|
3201
|
+
{
|
3202
|
+
appid: 730,
|
3203
|
+
name: 'Counter-Strike: Global Offensive',
|
3204
|
+
friendly_name: 'CSGO',
|
3205
|
+
has_adult_content: 1,
|
3206
|
+
is_visible_in_steam_china: 1,
|
3207
|
+
app_type: 1,
|
3208
|
+
logo: 'https://cdn.cloudflare.steamstatic.com/steam/apps/730/capsule_184x69.jpg',
|
3209
|
+
friendlyURL: 'CSGO',
|
3210
|
+
availStatLinks: {
|
3211
|
+
achievements: true,
|
3212
|
+
global_achievements: true,
|
3213
|
+
stats: false,
|
3214
|
+
gcpd: true,
|
3215
|
+
leaderboards: false,
|
3216
|
+
global_leaderboards: false,
|
3217
|
+
},
|
3218
|
+
hours: '41.3',
|
3219
|
+
hours_forever: '4,297',
|
3220
|
+
last_played: 1659900692,
|
3221
|
+
}]
|
2835
3222
|
}
|
2836
3223
|
|
2837
|
-
async GetOwnedApps() {
|
3224
|
+
async GetOwnedApps () {
|
2838
3225
|
let response = await this._httpRequest(`/actions/GetOwnedApps/?sessionid=${this.getSessionid()}`)
|
2839
3226
|
return response?.data
|
2840
|
-
const resultExample = [
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
3227
|
+
const resultExample = [
|
3228
|
+
{
|
3229
|
+
appid: 730,
|
3230
|
+
name: 'Counter-Strike: Global Offensive',
|
3231
|
+
icon: 'https:\/\/cdn.akamai.steamstatic.com\/steamcommunity\/public\/images\/apps\/730\/69f7ebe2735c366c65c0b33dae00e12dc40edbe4.jpg',
|
3232
|
+
logo: 'https:\/\/cdn.akamai.steamstatic.com\/steam\/apps\/730\/capsule_184x69.jpg',
|
3233
|
+
}]
|
2846
3234
|
}
|
2847
3235
|
|
2848
|
-
async getOwnedAppsID() {
|
3236
|
+
async getOwnedAppsID () {
|
2849
3237
|
let response = await this.getDynamicStoreUserData()
|
2850
3238
|
return response?.rgOwnedApps
|
2851
|
-
const resultExample = [730, 223750
|
3239
|
+
const resultExample = [730, 223750]
|
2852
3240
|
}
|
2853
3241
|
|
2854
|
-
async getDynamicStoreUserData() {
|
3242
|
+
async getDynamicStoreUserData () {
|
2855
3243
|
let response = await this._httpRequest(`https://store.steampowered.com/dynamicstore/userdata/?id=${this._miniprofile_user}`)
|
2856
3244
|
return response?.data
|
2857
3245
|
const responseExample = {
|
2858
3246
|
rgWishlist: [],
|
2859
|
-
rgOwnedPackages: [303386, 347132
|
2860
|
-
rgOwnedApps: [730, 107600
|
3247
|
+
rgOwnedPackages: [303386, 347132],
|
3248
|
+
rgOwnedApps: [730, 107600],
|
2861
3249
|
rgFollowedApps: [],
|
2862
3250
|
rgMasterSubApps: [],
|
2863
3251
|
rgPackagesInCart: [],
|
@@ -2874,18 +3262,18 @@ class SteamUser {
|
|
2874
3262
|
rgExcludedTags: [],
|
2875
3263
|
rgExcludedContentDescriptorIDs: [3, 4],
|
2876
3264
|
rgAutoGrantApps: [],
|
2877
|
-
rgRecommendedApps: [1782210, 1273710
|
3265
|
+
rgRecommendedApps: [1782210, 1273710],
|
2878
3266
|
rgPreferredPlatforms: [],
|
2879
3267
|
rgPrimaryLanguage: 0,
|
2880
3268
|
rgSecondaryLanguages: [],
|
2881
3269
|
bAllowAppImpressions: true,
|
2882
3270
|
nCartLineItemCount: 0,
|
2883
3271
|
nRemainingCartDiscount: 0,
|
2884
|
-
nTotalCartDiscount: 0
|
3272
|
+
nTotalCartDiscount: 0,
|
2885
3273
|
}
|
2886
3274
|
}
|
2887
3275
|
|
2888
|
-
async getListGroupInvitable(userSteamID) {
|
3276
|
+
async getListGroupInvitable (userSteamID) {
|
2889
3277
|
const result = await this._httpRequestAjax(`${this.getSteamUserProfileURL(userSteamID)}/ajaxgroupinvite?new_profile=1`)
|
2890
3278
|
const $ = result._$()
|
2891
3279
|
const groupList = []
|
@@ -2903,28 +3291,29 @@ class SteamUser {
|
|
2903
3291
|
})
|
2904
3292
|
})
|
2905
3293
|
return groupList
|
2906
|
-
const resultExample = [
|
2907
|
-
|
2908
|
-
|
2909
|
-
|
2910
|
-
|
2911
|
-
|
3294
|
+
const resultExample = [
|
3295
|
+
{
|
3296
|
+
id: NatriGroupSteamID,
|
3297
|
+
avatarHash: '71213b7e643da6216b1f8d8a381fc09b7c1932ef',
|
3298
|
+
avatar: 'https://avatars.cloudflare.steamstatic.com/71213b7e643da6216b1f8d8a381fc09b7c1932ef.jpg',
|
3299
|
+
name: '♔⌒Natri',
|
3300
|
+
}]
|
2912
3301
|
}
|
2913
3302
|
|
2914
|
-
async inviteUserToGroup(userSteamIDs = [], groupSteamID) {
|
3303
|
+
async inviteUserToGroup (userSteamIDs = [], groupSteamID) {
|
2915
3304
|
const params = {
|
2916
3305
|
json: 1,
|
2917
3306
|
type: 'groupInvite',
|
2918
3307
|
group: groupSteamID,
|
2919
3308
|
invitee: userSteamIDs,
|
2920
3309
|
}
|
2921
|
-
if(userSteamIDs instanceof Array && userSteamIDs.length === 1) {
|
3310
|
+
if (userSteamIDs instanceof Array && userSteamIDs.length === 1) {
|
2922
3311
|
userSteamIDs = userSteamIDs[0]
|
2923
3312
|
}
|
2924
3313
|
|
2925
|
-
if(typeof userSteamIDs === 'string') {
|
3314
|
+
if (typeof userSteamIDs === 'string') {
|
2926
3315
|
params.invitee = userSteamIDs
|
2927
|
-
} else if(userSteamIDs instanceof Array) {
|
3316
|
+
} else if (userSteamIDs instanceof Array) {
|
2928
3317
|
params.invitee_list = JSON_stringify(userSteamIDs)
|
2929
3318
|
} else {
|
2930
3319
|
//error
|
@@ -2940,27 +3329,27 @@ class SteamUser {
|
|
2940
3329
|
rgAccounts: {
|
2941
3330
|
1317646329: {
|
2942
3331
|
persona: '<a href="https://steamcommunity.com/profiles/76561199277912057" data-miniprofile="1317646329">Natri</a>',
|
2943
|
-
strError: 'This user has already been invited or is currently a member.'
|
2944
|
-
}
|
2945
|
-
}
|
3332
|
+
strError: 'This user has already been invited or is currently a member.',
|
3333
|
+
},
|
3334
|
+
},
|
2946
3335
|
}
|
2947
3336
|
const successExample = {
|
2948
3337
|
results: 'OK',
|
2949
|
-
groupId: NatriGroupSteamID
|
3338
|
+
groupId: NatriGroupSteamID,
|
2950
3339
|
}
|
2951
3340
|
}
|
2952
3341
|
|
2953
|
-
async inviteAllFriendToGroup(groupSteamID) {
|
3342
|
+
async inviteAllFriendToGroup (groupSteamID) {
|
2954
3343
|
const friendList = await this.getMyFriendsList()
|
2955
|
-
for(const { steamId } of friendList) {
|
3344
|
+
for (const { steamId } of friendList) {
|
2956
3345
|
const groupInvitableList = await this.getListGroupInvitable(steamId)
|
2957
|
-
if(groupInvitableList.some(g => g.id == groupSteamID)) {
|
3346
|
+
if (groupInvitableList.some(g => g.id == groupSteamID)) {
|
2958
3347
|
await this.inviteUserToGroup(steamId, groupSteamID)
|
2959
3348
|
}
|
2960
3349
|
}
|
2961
3350
|
}
|
2962
3351
|
|
2963
|
-
async _respondToGroupInvite(groupSteamID, accept) {
|
3352
|
+
async _respondToGroupInvite (groupSteamID, accept) {
|
2964
3353
|
const { data } = await this._httpRequestAjax({
|
2965
3354
|
url: `${this.getMySteamUserProfileURL()}/friends/action`,
|
2966
3355
|
data: {
|
@@ -2983,8 +3372,8 @@ class SteamUser {
|
|
2983
3372
|
cGroupsPending: 0,
|
2984
3373
|
cFriends: 183,
|
2985
3374
|
cGroups: 1,
|
2986
|
-
success: 1
|
2987
|
-
}
|
3375
|
+
success: 1,
|
3376
|
+
},
|
2988
3377
|
}
|
2989
3378
|
|
2990
3379
|
const successExample = {
|
@@ -2996,20 +3385,20 @@ class SteamUser {
|
|
2996
3385
|
cGroupsPending: 0,
|
2997
3386
|
cFriends: 1,
|
2998
3387
|
cGroups: 1,
|
2999
|
-
success: 1
|
3000
|
-
}
|
3388
|
+
success: 1,
|
3389
|
+
},
|
3001
3390
|
}
|
3002
3391
|
}
|
3003
3392
|
|
3004
|
-
async acceptInviteUserToGroup(groupSteamID) {
|
3393
|
+
async acceptInviteUserToGroup (groupSteamID) {
|
3005
3394
|
return this._respondToGroupInvite(groupSteamID, true)
|
3006
3395
|
}
|
3007
3396
|
|
3008
|
-
async ignoreInviteUserToGroup(groupSteamID) {
|
3397
|
+
async ignoreInviteUserToGroup (groupSteamID) {
|
3009
3398
|
return this._respondToGroupInvite(groupSteamID, false)
|
3010
3399
|
}
|
3011
3400
|
|
3012
|
-
async leaveGroup(groupSteamID) {
|
3401
|
+
async leaveGroup (groupSteamID) {
|
3013
3402
|
const { data } = await this._httpRequestAjax({
|
3014
3403
|
url: `${this.getMySteamUserProfileURL()}/friends/action`,
|
3015
3404
|
data: {
|
@@ -3032,12 +3421,12 @@ class SteamUser {
|
|
3032
3421
|
cGroupsPending: 0,
|
3033
3422
|
cFriends: 1,
|
3034
3423
|
cGroups: 0,
|
3035
|
-
success: 1
|
3036
|
-
}
|
3424
|
+
success: 1,
|
3425
|
+
},
|
3037
3426
|
}
|
3038
3427
|
}
|
3039
3428
|
|
3040
|
-
async joinGroup(groupSteamID) {
|
3429
|
+
async joinGroup (groupSteamID) {
|
3041
3430
|
const result = await this._httpRequest({
|
3042
3431
|
url: `/gid/${groupSteamID}/friends/action`,
|
3043
3432
|
data: {
|
@@ -3045,26 +3434,26 @@ class SteamUser {
|
|
3045
3434
|
},
|
3046
3435
|
method: 'POST',
|
3047
3436
|
})
|
3048
|
-
if(!result?.data) {
|
3437
|
+
if (!result?.data) {
|
3049
3438
|
return {
|
3050
|
-
success: false
|
3439
|
+
success: false,
|
3051
3440
|
}
|
3052
3441
|
}
|
3053
3442
|
|
3054
|
-
if(result.data.includes('You are already a member of this group.')) {
|
3443
|
+
if (result.data.includes('You are already a member of this group.')) {
|
3055
3444
|
return {
|
3056
3445
|
success: false,
|
3057
|
-
error: 'You are already a member of this group.'
|
3446
|
+
error: 'You are already a member of this group.',
|
3058
3447
|
}
|
3059
3448
|
}
|
3060
3449
|
|
3061
3450
|
const $ = result._$()
|
3062
3451
|
return {
|
3063
|
-
success: !!($('form#leave_group_form').length)
|
3452
|
+
success: !!($('form#leave_group_form').length),
|
3064
3453
|
}
|
3065
3454
|
}
|
3066
3455
|
|
3067
|
-
async getFriendsInCommon(steamID) {
|
3456
|
+
async getFriendsInCommon (steamID) {
|
3068
3457
|
const accountid = SteamUser.steamID642Miniprofile(steamID)
|
3069
3458
|
const result = await this._httpRequest({
|
3070
3459
|
url: `actions/PlayerList/?type=friendsincommon&target=${accountid}`,
|
@@ -3072,7 +3461,7 @@ class SteamUser {
|
|
3072
3461
|
return this._parseFriendList(result?.data)
|
3073
3462
|
}
|
3074
3463
|
|
3075
|
-
async getFriendsInGroup(groupID) {
|
3464
|
+
async getFriendsInGroup (groupID) {
|
3076
3465
|
const accountid = SteamUser.steamID642Miniprofile(groupID)
|
3077
3466
|
const result = await this._httpRequest({
|
3078
3467
|
url: `actions/PlayerList/?type=friendsingroup&target=${accountid}`,
|
@@ -3080,19 +3469,19 @@ class SteamUser {
|
|
3080
3469
|
return this._parseFriendList(result?.data)
|
3081
3470
|
}
|
3082
3471
|
|
3083
|
-
_parseSteamWebAPIKey($) {
|
3084
|
-
if($('form[action*="/dev/registerkey"]').length) {
|
3472
|
+
_parseSteamWebAPIKey ($) {
|
3473
|
+
if ($('form[action*="/dev/registerkey"]').length) {
|
3085
3474
|
return {
|
3086
3475
|
success: false,
|
3087
|
-
error: 'registerkey'
|
3476
|
+
error: 'registerkey',
|
3088
3477
|
}
|
3089
3478
|
}
|
3090
3479
|
|
3091
3480
|
let key = null
|
3092
3481
|
$('#bodyContents_ex > p').each(function () {
|
3093
|
-
if(!key) {
|
3482
|
+
if (!key) {
|
3094
3483
|
const text = $(this).text()?.trim()
|
3095
|
-
if(text.startsWith('Key:')) {
|
3484
|
+
if (text.startsWith('Key:')) {
|
3096
3485
|
key = text.substringAfter('Key:').trim()
|
3097
3486
|
}
|
3098
3487
|
}
|
@@ -3104,21 +3493,21 @@ class SteamUser {
|
|
3104
3493
|
}
|
3105
3494
|
}
|
3106
3495
|
|
3107
|
-
async getSteamWebAPIKey(domain = 'localhost') {
|
3496
|
+
async getSteamWebAPIKey (domain = 'localhost') {
|
3108
3497
|
const _self = this
|
3109
3498
|
const result = await this._httpRequest({
|
3110
3499
|
url: `dev/apikey`,
|
3111
3500
|
})
|
3112
3501
|
|
3113
|
-
if(result?.data?.includes('You will be granted access to Steam Web API keys when you have games in your Steam account.')) {
|
3502
|
+
if (result?.data?.includes('You will be granted access to Steam Web API keys when you have games in your Steam account.')) {
|
3114
3503
|
return {
|
3115
3504
|
success: false,
|
3116
|
-
error: 'dontHaveGames'
|
3505
|
+
error: 'dontHaveGames',
|
3117
3506
|
}
|
3118
3507
|
}
|
3119
3508
|
|
3120
3509
|
const parseResult = _self._parseSteamWebAPIKey(result._$())
|
3121
|
-
if(parseResult.error === 'registerkey') {
|
3510
|
+
if (parseResult.error === 'registerkey') {
|
3122
3511
|
const result2 = await this._httpRequest({
|
3123
3512
|
url: `dev/registerkey`,
|
3124
3513
|
data: {
|
@@ -3137,12 +3526,12 @@ class SteamUser {
|
|
3137
3526
|
}
|
3138
3527
|
}
|
3139
3528
|
|
3140
|
-
async revokeSteamWebAPIKey() {
|
3529
|
+
async revokeSteamWebAPIKey () {
|
3141
3530
|
const _self = this
|
3142
3531
|
const result = await this._httpRequest({
|
3143
3532
|
url: `dev/revokekey`,
|
3144
3533
|
data: {
|
3145
|
-
Revoke: 'Revoke My Steam Web API Key'
|
3534
|
+
Revoke: 'Revoke My Steam Web API Key',
|
3146
3535
|
},
|
3147
3536
|
headers: {
|
3148
3537
|
'Content-Type': 'multipart/form-data',
|
@@ -3154,7 +3543,7 @@ class SteamUser {
|
|
3154
3543
|
return parseResult
|
3155
3544
|
}
|
3156
3545
|
|
3157
|
-
_parsePlayerListFromblotter_daily_rollup_line($, contentEl) {
|
3546
|
+
_parsePlayerListFromblotter_daily_rollup_line ($, contentEl) {
|
3158
3547
|
const players = []
|
3159
3548
|
contentEl.find('a[data-miniprofile]').each((index, el) => {
|
3160
3549
|
el = $(el)
|
@@ -3167,19 +3556,19 @@ class SteamUser {
|
|
3167
3556
|
name,
|
3168
3557
|
nickname,
|
3169
3558
|
miniprofile,
|
3170
|
-
steamID: SteamUser.miniprofile2SteamID64(miniprofile)
|
3559
|
+
steamID: SteamUser.miniprofile2SteamID64(miniprofile),
|
3171
3560
|
})
|
3172
3561
|
})
|
3173
3562
|
return players
|
3174
3563
|
}
|
3175
3564
|
|
3176
|
-
_parseAppIDFromLink(link) {
|
3565
|
+
_parseAppIDFromLink (link) {
|
3177
3566
|
const prefixs = ['steamcommunity.com/app/', 'store.steampowered.com/app/', 'store.steampowered.com/sub/']
|
3178
|
-
for(let i = 0; i < prefixs.length; i++) {
|
3567
|
+
for (let i = 0; i < prefixs.length; i++) {
|
3179
3568
|
const prefix = prefixs[i]
|
3180
|
-
if(link.includes(prefix)) {
|
3569
|
+
if (link.includes(prefix)) {
|
3181
3570
|
link = link.substringAfter(prefix)
|
3182
|
-
if(link.includes('/')) {
|
3571
|
+
if (link.includes('/')) {
|
3183
3572
|
link = link.substringBefore('/')
|
3184
3573
|
}
|
3185
3574
|
return parseInt(link)
|
@@ -3189,7 +3578,7 @@ class SteamUser {
|
|
3189
3578
|
return -1
|
3190
3579
|
}
|
3191
3580
|
|
3192
|
-
_parseAppListFromBlotter($, contentEl) {
|
3581
|
+
_parseAppListFromBlotter ($, contentEl) {
|
3193
3582
|
const _self = this
|
3194
3583
|
|
3195
3584
|
let apps = []
|
@@ -3208,7 +3597,7 @@ class SteamUser {
|
|
3208
3597
|
return apps
|
3209
3598
|
}
|
3210
3599
|
|
3211
|
-
_parseAchievedblotter_daily_rollup_line($, contentEl) {
|
3600
|
+
_parseAchievedblotter_daily_rollup_line ($, contentEl) {
|
3212
3601
|
const achieved = []
|
3213
3602
|
contentEl.find('> img[title]').each((index, imgEl) => {
|
3214
3603
|
imgEl = $(imgEl)
|
@@ -3216,18 +3605,18 @@ class SteamUser {
|
|
3216
3605
|
const title = imgEl.attr('title')
|
3217
3606
|
achieved.push({
|
3218
3607
|
img,
|
3219
|
-
title
|
3608
|
+
title,
|
3220
3609
|
})
|
3221
3610
|
})
|
3222
3611
|
return achieved
|
3223
3612
|
}
|
3224
3613
|
|
3225
|
-
_parseGroupListFromblotter_daily_rollup_line($, contentEl) {
|
3614
|
+
_parseGroupListFromblotter_daily_rollup_line ($, contentEl) {
|
3226
3615
|
const groups = []
|
3227
3616
|
contentEl.find('a[href*="steamcommunity.com/groups/"]').each((index, appEl) => {
|
3228
3617
|
appEl = $(appEl)
|
3229
3618
|
const link = appEl.attr('href')
|
3230
|
-
if(link) {
|
3619
|
+
if (link) {
|
3231
3620
|
groups.push({
|
3232
3621
|
name: appEl.text()?.trim(),
|
3233
3622
|
link: link,
|
@@ -3238,12 +3627,13 @@ class SteamUser {
|
|
3238
3627
|
return groups
|
3239
3628
|
}
|
3240
3629
|
|
3241
|
-
_parseBlotterDailyRollup($, blotterBlockEl) {
|
3630
|
+
_parseBlotterDailyRollup ($, blotterBlockEl) {
|
3242
3631
|
const _self = this
|
3243
3632
|
const activity = []
|
3244
3633
|
blotterBlockEl.find('.blotter_daily_rollup_line').each(function () {
|
3245
3634
|
const blotter_daily_rollup_line = $(this)
|
3246
|
-
const miniprofile = parseInt(
|
3635
|
+
const miniprofile = parseInt(
|
3636
|
+
blotter_daily_rollup_line.find('.blotter_rollup_avatar .blotter_small_friend_block_container img[data-miniprofile]').attr('data-miniprofile'))
|
3247
3637
|
const steamID = SteamUser.miniprofile2SteamID64(miniprofile)
|
3248
3638
|
const contentEl = $(blotter_daily_rollup_line.find(' > span')[0])
|
3249
3639
|
const contentText = contentEl.text()?.trim()
|
@@ -3253,42 +3643,42 @@ class SteamUser {
|
|
3253
3643
|
const groups = () => _self._parseGroupListFromblotter_daily_rollup_line($, contentEl)
|
3254
3644
|
const achieved = () => _self._parseAchievedblotter_daily_rollup_line($, blotter_daily_rollup_line)
|
3255
3645
|
|
3256
|
-
if(contentText.includes('and') && contentText.includes(' are now friends.')) {
|
3646
|
+
if (contentText.includes('and') && contentText.includes(' are now friends.')) {
|
3257
3647
|
activity.push({
|
3258
3648
|
type: EActivityType.newFriend,
|
3259
3649
|
players: players(),
|
3260
3650
|
})
|
3261
|
-
} else if(contentText.includes(' is now friends with ')) {
|
3651
|
+
} else if (contentText.includes(' is now friends with ')) {
|
3262
3652
|
activity.push({
|
3263
3653
|
type: EActivityType.newFriend,
|
3264
3654
|
players: players(),
|
3265
3655
|
})
|
3266
|
-
} else if(contentText.includes(' played ') && contentText.includes('for the first time.')) {
|
3656
|
+
} else if (contentText.includes(' played ') && contentText.includes('for the first time.')) {
|
3267
3657
|
activity.push({
|
3268
3658
|
type: EActivityType.playedFirstTime,
|
3269
3659
|
players: players(),
|
3270
3660
|
apps: apps(),
|
3271
3661
|
})
|
3272
|
-
} else if(contentText.includes(' achieved ')) {
|
3662
|
+
} else if (contentText.includes(' achieved ')) {
|
3273
3663
|
activity.push({
|
3274
3664
|
type: EActivityType.achieved,
|
3275
3665
|
players: players(),
|
3276
3666
|
apps: apps(),
|
3277
3667
|
achieved: achieved(),
|
3278
3668
|
})
|
3279
|
-
} else if(contentText.includes(' has added ') && contentText.includes('to their wishlist.')) {
|
3669
|
+
} else if (contentText.includes(' has added ') && contentText.includes('to their wishlist.')) {
|
3280
3670
|
activity.push({
|
3281
3671
|
type: EActivityType.added2wishlist,
|
3282
3672
|
players: players(),
|
3283
3673
|
apps: apps(),
|
3284
3674
|
})
|
3285
|
-
} else if(contentText.includes(' is now following ')) {
|
3675
|
+
} else if (contentText.includes(' is now following ')) {
|
3286
3676
|
activity.push({
|
3287
3677
|
type: EActivityType.following,
|
3288
3678
|
players: players(),
|
3289
3679
|
apps: apps(),
|
3290
3680
|
})
|
3291
|
-
} else if(contentText.includes(' has joined ')) {
|
3681
|
+
} else if (contentText.includes(' has joined ')) {
|
3292
3682
|
activity.push({
|
3293
3683
|
type: EActivityType.joined,
|
3294
3684
|
players: players(),
|
@@ -3301,7 +3691,7 @@ class SteamUser {
|
|
3301
3691
|
return activity
|
3302
3692
|
}
|
3303
3693
|
|
3304
|
-
_parseBlotterGamepurchase($, blotterBlockEl) {
|
3694
|
+
_parseBlotterGamepurchase ($, blotterBlockEl) {
|
3305
3695
|
const _self = this
|
3306
3696
|
const activity = []
|
3307
3697
|
const authorAvatarEl = blotterBlockEl.find('.blotter_author_block .blotter_avatar_holder .playerAvatar img')
|
@@ -3316,15 +3706,18 @@ class SteamUser {
|
|
3316
3706
|
const name = authorEl.text()?.trim()
|
3317
3707
|
|
3318
3708
|
const apps = []
|
3319
|
-
const appppp = [
|
3709
|
+
const appppp = [
|
3710
|
+
..._self._parseAppListFromBlotter($, blotterBlockEl.find('.blotter_author_block')),
|
3711
|
+
..._self._parseAppListFromBlotter($, blotterBlockEl.find('.blotter_gamepurchase_content')),
|
3712
|
+
..._self._parseAppListFromBlotter($, blotterBlockEl.find('.blotter_gamepurchase_details'))]
|
3320
3713
|
|
3321
3714
|
appppp.forEach(app => {
|
3322
3715
|
const index = apps.findIndex(_app => _app.id === app.id)
|
3323
|
-
if(index === -1) {
|
3716
|
+
if (index === -1) {
|
3324
3717
|
apps.push(app)
|
3325
3718
|
} else {
|
3326
|
-
for(let key in apps[index]) {
|
3327
|
-
if(!apps[index][key] && app[key]) {
|
3719
|
+
for (let key in apps[index]) {
|
3720
|
+
if (!apps[index][key] && app[key]) {
|
3328
3721
|
apps[index][key] = app[key]
|
3329
3722
|
}
|
3330
3723
|
}
|
@@ -3349,19 +3742,17 @@ class SteamUser {
|
|
3349
3742
|
return activity
|
3350
3743
|
}
|
3351
3744
|
|
3352
|
-
async getFriendActivity(start_or_url) {//start or next_request
|
3745
|
+
async getFriendActivity (start_or_url) {//start or next_request
|
3353
3746
|
start_or_url = start_or_url || Math.round((new Date()).getTime() / 1000)
|
3354
3747
|
const _self = this
|
3355
3748
|
const activity = []
|
3356
3749
|
let next_request_timestart = null,
|
3357
3750
|
next_request = null
|
3358
3751
|
const { data } = await this._httpRequestAjax(typeof start_or_url === 'string' ? start_or_url : `my/ajaxgetusernews/?start=${start_or_url}`)//use my, not profiles/76561197977736539 getMySteamUserProfileURL
|
3359
|
-
if(data?.success) {
|
3752
|
+
if (data?.success) {
|
3360
3753
|
next_request = data.next_request || null
|
3361
3754
|
next_request_timestart = parseInt(next_request.substringAfterLast('?start=')) || null
|
3362
|
-
const $ = cheerio.load(data.blotter_html
|
3363
|
-
.replaceAll(/[\t\n\r]/gi, '')
|
3364
|
-
.trim())
|
3755
|
+
const $ = cheerio.load(data.blotter_html.replaceAll(/[\t\n\r]/gi, '').trim())
|
3365
3756
|
$('.blotter_day').each(function () {
|
3366
3757
|
const blotter_day = $(this)
|
3367
3758
|
const timestamp = parseInt(blotter_day.attr('id').substringAfter('blotter_day_'))
|
@@ -3370,25 +3761,25 @@ class SteamUser {
|
|
3370
3761
|
let _activity = []
|
3371
3762
|
|
3372
3763
|
const activityType = {
|
3373
|
-
daily_rollup(blotterBlockEl) {
|
3764
|
+
daily_rollup (blotterBlockEl) {
|
3374
3765
|
return _self._parseBlotterDailyRollup($, blotterBlockEl)
|
3375
3766
|
},
|
3376
|
-
gamepurchase(blotterBlockEl) {
|
3767
|
+
gamepurchase (blotterBlockEl) {
|
3377
3768
|
return _self._parseBlotterGamepurchase($, blotterBlockEl)
|
3378
3769
|
},
|
3379
|
-
workshopitempublished() {
|
3770
|
+
workshopitempublished () {
|
3380
3771
|
|
3381
3772
|
},
|
3382
|
-
recommendation() {
|
3773
|
+
recommendation () {
|
3383
3774
|
|
3384
3775
|
},
|
3385
|
-
userstatus() {
|
3776
|
+
userstatus () {
|
3386
3777
|
|
3387
3778
|
},
|
3388
|
-
screenshot() {//screenshot_fullscreen
|
3779
|
+
screenshot () {//screenshot_fullscreen
|
3389
3780
|
|
3390
3781
|
},
|
3391
|
-
videopublished() {
|
3782
|
+
videopublished () {
|
3392
3783
|
|
3393
3784
|
},
|
3394
3785
|
}
|
@@ -3397,24 +3788,28 @@ class SteamUser {
|
|
3397
3788
|
blotterBlockEl = $(blotterBlockEl)
|
3398
3789
|
let type = []
|
3399
3790
|
blotterBlockEl.children().each(function () {
|
3400
|
-
const classList = $(this).attr('class')
|
3401
|
-
|
3402
|
-
?.trim()
|
3403
|
-
if(classList) {
|
3791
|
+
const classList = $(this).attr('class')?.replaceAll('blotter_entry', '')?.trim()
|
3792
|
+
if (classList) {
|
3404
3793
|
type = type.concat(classList.split(' ').map(_class => _class?.removePrefix('blotter_')))
|
3405
3794
|
}
|
3406
3795
|
})
|
3407
3796
|
|
3408
3797
|
let excute
|
3409
|
-
if((excute = type.find(_class => Object.hasOwn(activityType, _class)))) {
|
3798
|
+
if ((excute = type.find(_class => Object.hasOwn(activityType, _class)))) {
|
3410
3799
|
const __activity = activityType[excute](blotterBlockEl)
|
3411
|
-
if(__activity instanceof Array) {
|
3800
|
+
if (__activity instanceof Array) {
|
3412
3801
|
__activity.forEach(___activity => {
|
3413
|
-
if(!___activity.type) {
|
3802
|
+
if (!___activity.type) {
|
3414
3803
|
___activity.type = excute
|
3415
3804
|
}
|
3416
3805
|
|
3417
|
-
const activityID = [
|
3806
|
+
const activityID = [
|
3807
|
+
___activity.type,
|
3808
|
+
___activity.author?.steamID,
|
3809
|
+
(___activity.apps?.map?.(app => app.id) || []).sort().join('|'),
|
3810
|
+
(___activity.players?.map?.(p => p.steamID) || []).sort().join('|'),
|
3811
|
+
(___activity.achieved?.map?.(p => p.title.replaceAll(/\s/gi, '').toLowerCase()) || []).sort().join('|'),
|
3812
|
+
(___activity.groups?.map?.(p => p.URL) || []).sort().join('|')].filter(Boolean)
|
3418
3813
|
_activity.push(___activity)
|
3419
3814
|
})
|
3420
3815
|
}
|
@@ -3441,9 +3836,9 @@ class SteamUser {
|
|
3441
3836
|
}
|
3442
3837
|
}
|
3443
3838
|
|
3444
|
-
async getFriendActivityFull({
|
3839
|
+
async getFriendActivityFull ({
|
3445
3840
|
cbOnActivity,
|
3446
|
-
cbOnActivities
|
3841
|
+
cbOnActivities,
|
3447
3842
|
}) {
|
3448
3843
|
const iscbOnActivity = typeof cbOnActivity === 'function'
|
3449
3844
|
const iscbOnActivities = typeof cbOnActivities === 'function'
|
@@ -3451,25 +3846,26 @@ class SteamUser {
|
|
3451
3846
|
do {
|
3452
3847
|
const activities = await this.getFriendActivity(next_request)
|
3453
3848
|
next_request = activities.next_request
|
3454
|
-
if(activities.activity instanceof Array) {
|
3849
|
+
if (activities.activity instanceof Array) {
|
3455
3850
|
iscbOnActivities && cbOnActivities?.(activities.activity)
|
3456
3851
|
iscbOnActivity && activities.activity.forEach(function (a) {
|
3457
3852
|
cbOnActivity?.(a)
|
3458
3853
|
})
|
3459
3854
|
}
|
3460
|
-
} while(next_request)
|
3855
|
+
} while (next_request)
|
3461
3856
|
}
|
3462
3857
|
|
3463
|
-
async searchSteamUserByName(text, page = 1) {
|
3464
|
-
const { data } = await this._httpRequestAjax(`search/SearchCommunityAjax?text=${encodeURIComponent(
|
3465
|
-
|
3858
|
+
async searchSteamUserByName (text, page = 1) {
|
3859
|
+
const { data } = await this._httpRequestAjax(`search/SearchCommunityAjax?text=${encodeURIComponent(
|
3860
|
+
text)}&filter=users&sessionid=${this._sessionid}&steamid_user=${this.getSteamidUser()}&page=${page}`)
|
3861
|
+
if (data?.success === 1) {
|
3466
3862
|
let {
|
3467
3863
|
html,
|
3468
3864
|
search_filter,
|
3469
3865
|
search_page,
|
3470
3866
|
search_result_count,
|
3471
3867
|
search_text,
|
3472
|
-
success
|
3868
|
+
success,
|
3473
3869
|
} = data
|
3474
3870
|
search_page = parseInt(search_page)
|
3475
3871
|
const $ = cheerio.load(html.replaceAll(/[\t\n\r]/gi, '').trim())
|
@@ -3496,9 +3892,9 @@ class SteamUser {
|
|
3496
3892
|
$('.community_searchresults_paging a').each(function (index, pagingEl) {
|
3497
3893
|
pagingEl = $(pagingEl)
|
3498
3894
|
const onclick = pagingEl.attr('onclick')
|
3499
|
-
if(onclick.includes('CommunitySearch.PrevPage()')) {
|
3895
|
+
if (onclick.includes('CommunitySearch.PrevPage()')) {
|
3500
3896
|
prevPage = page - 1
|
3501
|
-
} else if(onclick.includes('CommunitySearch.NextPage()')) {
|
3897
|
+
} else if (onclick.includes('CommunitySearch.NextPage()')) {
|
3502
3898
|
nextPage = page + 1
|
3503
3899
|
}
|
3504
3900
|
})
|
@@ -3516,20 +3912,20 @@ class SteamUser {
|
|
3516
3912
|
}
|
3517
3913
|
|
3518
3914
|
return {
|
3519
|
-
success: 0
|
3915
|
+
success: 0,
|
3520
3916
|
}
|
3521
3917
|
}
|
3522
3918
|
|
3523
|
-
async getMyGroupsList() {
|
3919
|
+
async getMyGroupsList () {
|
3524
3920
|
const steamID = this.getSteamidUser()
|
3525
3921
|
return await this.getUserGroupsList(steamID)
|
3526
3922
|
}
|
3527
3923
|
|
3528
|
-
async getUserGroupsList(steamID = this.getSteamidUser()) {
|
3924
|
+
async getUserGroupsList (steamID = this.getSteamidUser()) {
|
3529
3925
|
return await SteamUser.getUserGroupsList(steamID, this.getCookies())
|
3530
3926
|
}
|
3531
3927
|
|
3532
|
-
static async getUserGroupsList(steamID, cookie) {
|
3928
|
+
static async getUserGroupsList (steamID, cookie) {
|
3533
3929
|
const { data } = (await request({
|
3534
3930
|
baseURL: SteamcommunityURL,
|
3535
3931
|
url: `https://steamcommunity.com/profiles/${steamID}/groups/`,
|
@@ -3538,8 +3934,8 @@ class SteamUser {
|
|
3538
3934
|
return SteamUser._parseUserGroupList(data?.replaceAll(/[\t\n\r]/gi, ''))
|
3539
3935
|
}
|
3540
3936
|
|
3541
|
-
static _parseUserGroupList(html) {
|
3542
|
-
if(!html) {
|
3937
|
+
static _parseUserGroupList (html) {
|
3938
|
+
if (!html) {
|
3543
3939
|
return
|
3544
3940
|
}
|
3545
3941
|
const $ = cheerio.load(html)
|
@@ -3573,9 +3969,9 @@ class SteamUser {
|
|
3573
3969
|
return groups
|
3574
3970
|
}
|
3575
3971
|
|
3576
|
-
async getNotifications() {
|
3972
|
+
async getNotifications () {
|
3577
3973
|
const { data } = await this._httpRequest(`/actions/GetNotificationCounts`)
|
3578
|
-
if(!data) {
|
3974
|
+
if (!data) {
|
3579
3975
|
return
|
3580
3976
|
}
|
3581
3977
|
|
@@ -3590,8 +3986,8 @@ class SteamUser {
|
|
3590
3986
|
8: 0,
|
3591
3987
|
9: 0,
|
3592
3988
|
10: 0,
|
3593
|
-
11: 0
|
3594
|
-
}
|
3989
|
+
11: 0,
|
3990
|
+
},
|
3595
3991
|
}
|
3596
3992
|
const mapping1 = {
|
3597
3993
|
1: 'Trade offers',
|
@@ -3603,7 +3999,7 @@ class SteamUser {
|
|
3603
3999
|
8: 'Gifts',
|
3604
4000
|
9: 'Chat messages',
|
3605
4001
|
10: 'Replies from Steam Support',
|
3606
|
-
11: 'Account warning or alert'
|
4002
|
+
11: 'Account warning or alert',
|
3607
4003
|
}
|
3608
4004
|
const mapping = {
|
3609
4005
|
1: 'trades',
|
@@ -3615,10 +4011,10 @@ class SteamUser {
|
|
3615
4011
|
8: 'gifts',
|
3616
4012
|
9: 'chat',
|
3617
4013
|
10: 'helpRequestReplies',
|
3618
|
-
11: 'accountAlerts'
|
4014
|
+
11: 'accountAlerts',
|
3619
4015
|
}
|
3620
4016
|
|
3621
|
-
if(data?.notifications) {
|
4017
|
+
if (data?.notifications) {
|
3622
4018
|
Object.keys(data.notifications).forEach(key => {
|
3623
4019
|
const value = data.notifications[key]
|
3624
4020
|
delete data.notifications[key]
|
@@ -3638,23 +4034,23 @@ class SteamUser {
|
|
3638
4034
|
gifts: 0,
|
3639
4035
|
chat: 0,
|
3640
4036
|
helpRequestReplies: 0,
|
3641
|
-
accountAlerts: 0
|
3642
|
-
}
|
4037
|
+
accountAlerts: 0,
|
4038
|
+
},
|
3643
4039
|
}
|
3644
4040
|
}
|
3645
4041
|
|
3646
|
-
async addFreeLicense(appID) {
|
4042
|
+
async addFreeLicense (appID) {
|
3647
4043
|
const { data } = await this._httpRequestAjax({
|
3648
4044
|
url: `https://store.steampowered.com/checkout/addfreelicense/${appID}`,
|
3649
4045
|
data: {
|
3650
|
-
ajax: true
|
4046
|
+
ajax: true,
|
3651
4047
|
},
|
3652
4048
|
method: 'POST',
|
3653
4049
|
})
|
3654
4050
|
return Array.isArray(data) && !data.length
|
3655
4051
|
}
|
3656
4052
|
|
3657
|
-
async addSubFreeLicense(subid) {
|
4053
|
+
async addSubFreeLicense (subid) {
|
3658
4054
|
const { data } = await this._httpRequestAjax({
|
3659
4055
|
url: `https://store.steampowered.com/checkout/addfreelicense/`,
|
3660
4056
|
data: {
|
@@ -3666,7 +4062,7 @@ class SteamUser {
|
|
3666
4062
|
method: 'POST',
|
3667
4063
|
})
|
3668
4064
|
|
3669
|
-
if(data?.includes('There was a problem adding this product to your Steam account.')) {
|
4065
|
+
if (data?.includes('There was a problem adding this product to your Steam account.')) {
|
3670
4066
|
return false
|
3671
4067
|
}
|
3672
4068
|
|
@@ -3675,7 +4071,7 @@ class SteamUser {
|
|
3675
4071
|
|
3676
4072
|
requestFreeLicense = this.addFreeLicense
|
3677
4073
|
|
3678
|
-
async getCurrentSteamLogin() {
|
4074
|
+
async getCurrentSteamLogin () {
|
3679
4075
|
const result = await this._httpRequest({
|
3680
4076
|
url: `${this.getMySteamUserProfileURL()}/games/?tab=all`,
|
3681
4077
|
})
|
@@ -3684,35 +4080,91 @@ class SteamUser {
|
|
3684
4080
|
}
|
3685
4081
|
|
3686
4082
|
//not working
|
3687
|
-
async setLanguagePreferences() {
|
3688
|
-
const primary_language_list = [
|
4083
|
+
async setLanguagePreferences () {
|
4084
|
+
const primary_language_list = [
|
4085
|
+
'greek',
|
4086
|
+
'dutch',
|
4087
|
+
'norwegian',
|
4088
|
+
'danish',
|
4089
|
+
'german',
|
4090
|
+
'russian',
|
4091
|
+
'romanian',
|
4092
|
+
'vietnamese',
|
4093
|
+
'bulgarian',
|
4094
|
+
'swedish',
|
4095
|
+
'spanish',
|
4096
|
+
'latam',
|
4097
|
+
'english',
|
4098
|
+
'ukrainian',
|
4099
|
+
'italian',
|
4100
|
+
'japanese',
|
4101
|
+
'schinese',
|
4102
|
+
'tchinese',
|
4103
|
+
'czech',
|
4104
|
+
'thai',
|
4105
|
+
'turkish',
|
4106
|
+
'brazilian',
|
4107
|
+
'portuguese',
|
4108
|
+
'polish',
|
4109
|
+
'french',
|
4110
|
+
'finnish',
|
4111
|
+
'koreana',
|
4112
|
+
'hungarian']
|
3689
4113
|
const formData = new URLSearchParams()
|
3690
4114
|
formData.append('primary_language', 'koreana')
|
3691
4115
|
const { data } = await this._httpRequestAjax({
|
3692
4116
|
url: 'https://store.steampowered.com/account/savelanguagepreferences', // data: 'primary_language=english',
|
3693
4117
|
data: formData,
|
3694
4118
|
headers: {
|
3695
|
-
referer: 'https://store.steampowered.com/account/languagepreferences'
|
4119
|
+
referer: 'https://store.steampowered.com/account/languagepreferences',
|
3696
4120
|
},
|
3697
|
-
method: 'POST'
|
4121
|
+
method: 'POST',
|
3698
4122
|
})
|
3699
4123
|
return data
|
3700
4124
|
}
|
3701
4125
|
|
3702
|
-
async ChangeLanguage() {
|
3703
|
-
const primary_language_list = [
|
4126
|
+
async ChangeLanguage () {
|
4127
|
+
const primary_language_list = [
|
4128
|
+
'greek',
|
4129
|
+
'dutch',
|
4130
|
+
'norwegian',
|
4131
|
+
'danish',
|
4132
|
+
'german',
|
4133
|
+
'russian',
|
4134
|
+
'romanian',
|
4135
|
+
'vietnamese',
|
4136
|
+
'bulgarian',
|
4137
|
+
'swedish',
|
4138
|
+
'spanish',
|
4139
|
+
'latam',
|
4140
|
+
'english',
|
4141
|
+
'ukrainian',
|
4142
|
+
'italian',
|
4143
|
+
'japanese',
|
4144
|
+
'schinese',
|
4145
|
+
'tchinese',
|
4146
|
+
'czech',
|
4147
|
+
'thai',
|
4148
|
+
'turkish',
|
4149
|
+
'brazilian',
|
4150
|
+
'portuguese',
|
4151
|
+
'polish',
|
4152
|
+
'french',
|
4153
|
+
'finnish',
|
4154
|
+
'koreana',
|
4155
|
+
'hungarian']
|
3704
4156
|
const formData = new URLSearchParams()
|
3705
4157
|
formData.append('language', 'koreana')
|
3706
4158
|
const { data } = await this._httpRequestAjax({
|
3707
4159
|
url: 'https://steamcommunity.com/actions/SetLanguage/', // data: 'primary_language=english',
|
3708
4160
|
data: formData,
|
3709
|
-
method: 'POST'
|
4161
|
+
method: 'POST',
|
3710
4162
|
})
|
3711
4163
|
return data
|
3712
4164
|
}
|
3713
4165
|
|
3714
4166
|
//Personal Game Data
|
3715
|
-
async getCompetitiveCooldownLevel() {
|
4167
|
+
async getCompetitiveCooldownLevel () {
|
3716
4168
|
const result = await this._httpRequest({
|
3717
4169
|
url: `${this.getMySteamUserProfileURL()}/gcpd/730/?tab=matchmaking`,
|
3718
4170
|
})
|
@@ -3721,14 +4173,17 @@ class SteamUser {
|
|
3721
4173
|
const $table = $('table.generic_kv_table')
|
3722
4174
|
let cooldown_table = table2json($, getTableHasHeaders($, $table, ['Competitive Cooldown Expiration']))
|
3723
4175
|
let matchmaking_detail_table = table2json($, getTableHasHeaders($, $table, ['Matchmaking Mode', 'Wins', 'Skill Group']))
|
3724
|
-
let matchmaking_table = getTableHasHeaders($, $table, ['Matchmaking Mode', 'Last Match']).
|
4176
|
+
let matchmaking_table = getTableHasHeaders($, $table, ['Matchmaking Mode', 'Last Match']).
|
4177
|
+
map(t => table2json($, t)).
|
4178
|
+
filter(t => Object.keys(t[0]).length === 2)[0]
|
3725
4179
|
|
3726
4180
|
cooldown_table = cooldown_table.map(function (object) {
|
3727
4181
|
removeSpaceKeys(object)
|
3728
4182
|
return {
|
3729
4183
|
Acknowledged: object.Acknowledged,
|
3730
4184
|
Competitive_Cooldown_Expiration: object.Competitive_Cooldown_Expiration,
|
3731
|
-
Competitive_Cooldown_Level: isNaN(parseInt(object.Competitive_Cooldown_Level)) ? object.Competitive_Cooldown_Level : parseInt(
|
4185
|
+
Competitive_Cooldown_Level: isNaN(parseInt(object.Competitive_Cooldown_Level)) ? object.Competitive_Cooldown_Level : parseInt(
|
4186
|
+
object.Competitive_Cooldown_Level),
|
3732
4187
|
}
|
3733
4188
|
})
|
3734
4189
|
|
@@ -3758,57 +4213,59 @@ class SteamUser {
|
|
3758
4213
|
}
|
3759
4214
|
|
3760
4215
|
const resultExample = {
|
3761
|
-
cooldown_table: [
|
3762
|
-
|
3763
|
-
|
3764
|
-
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3768
|
-
|
3769
|
-
|
3770
|
-
|
3771
|
-
|
3772
|
-
|
3773
|
-
|
3774
|
-
|
3775
|
-
|
3776
|
-
|
3777
|
-
|
3778
|
-
|
3779
|
-
|
3780
|
-
|
3781
|
-
|
3782
|
-
|
3783
|
-
|
3784
|
-
|
3785
|
-
|
3786
|
-
|
3787
|
-
|
3788
|
-
|
3789
|
-
|
3790
|
-
|
3791
|
-
|
4216
|
+
cooldown_table: [
|
4217
|
+
{
|
4218
|
+
Acknowledged: 'No',
|
4219
|
+
Competitive_Cooldown_Expiration: '2022-09-10 01:40:36 GMT',
|
4220
|
+
Competitive_Cooldown_Level: 1,
|
4221
|
+
}],
|
4222
|
+
matchmaking_detail_table: [
|
4223
|
+
{
|
4224
|
+
Wins: 151,
|
4225
|
+
Ties: 20,
|
4226
|
+
Losses: 218,
|
4227
|
+
Matchmaking_Mode: 'Competitive',
|
4228
|
+
Skill_Group: 4,
|
4229
|
+
Last_Match: '2022-08-07 19:30:42 GMT',
|
4230
|
+
}, {
|
4231
|
+
Wins: 1,
|
4232
|
+
Ties: 0,
|
4233
|
+
Losses: 1,
|
4234
|
+
Matchmaking_Mode: 'Wingman',
|
4235
|
+
Skill_Group: '',
|
4236
|
+
Last_Match: '2020-05-29 14:03:30 GMT',
|
4237
|
+
}],
|
4238
|
+
matchmaking_table: [
|
4239
|
+
{
|
4240
|
+
Matchmaking_Mode: 'Competitive',
|
4241
|
+
Last_Match: '2022-09-10 01:13:09 GMT',
|
4242
|
+
}, {
|
4243
|
+
Matchmaking_Mode: 'Deathmatch',
|
4244
|
+
Last_Match: '2022-08-16 16:31:35 GMT',
|
4245
|
+
}],
|
4246
|
+
}
|
4247
|
+
}
|
4248
|
+
|
4249
|
+
async getPersonalGameDataAccountInformation () {
|
3792
4250
|
const result = await this._httpRequest({
|
3793
4251
|
url: `${this.getMySteamUserProfileURL()}/gcpd/730/?tab=accountmain`,
|
3794
4252
|
})
|
3795
|
-
if(!result?.data) {
|
4253
|
+
if (!result?.data) {
|
3796
4254
|
return
|
3797
4255
|
}
|
3798
4256
|
const $ = result._$()
|
3799
4257
|
|
3800
4258
|
const $table = $('table.generic_kv_table')
|
3801
|
-
const accountmain_table = table2json($, getTableHasHeaders($, $table, ['Recorded Activity', 'Activity Time']))
|
3802
|
-
|
4259
|
+
const accountmain_table = table2json($, getTableHasHeaders($, $table, ['Recorded Activity', 'Activity Time'])).
|
4260
|
+
reduce(function (previousValue, currentValue, currentIndex, array) {
|
3803
4261
|
return {
|
3804
4262
|
...previousValue,
|
3805
|
-
[currentValue['Recorded Activity']]: currentValue['Activity Time']
|
4263
|
+
[currentValue['Recorded Activity']]: currentValue['Activity Time'],
|
3806
4264
|
}
|
3807
4265
|
}, {})
|
3808
4266
|
|
3809
|
-
const extraInfo = [...($('.generic_kv_table .generic_kv_line'))]
|
3810
|
-
|
3811
|
-
.reduce(function (previousValue, currentValue, currentIndex, array) {
|
4267
|
+
const extraInfo = [...($('.generic_kv_table .generic_kv_line'))].map(lineEl => $(lineEl).text()?.trim()?.replaceAll('CS:GO', 'CSGO')).
|
4268
|
+
reduce(function (previousValue, currentValue, currentIndex, array) {
|
3812
4269
|
const key = currentValue.substringBefore(':')?.trim()
|
3813
4270
|
const value = currentValue.substringAfter(':')?.trim()
|
3814
4271
|
previousValue[key] = value
|
@@ -3829,17 +4286,19 @@ class SteamUser {
|
|
3829
4286
|
Last_known_IP_address: cleanDoc.Last_known_IP_address,//'42.1.70.156'
|
3830
4287
|
Earned_a_Service_Medal: cleanDoc.Earned_a_Service_Medal,//'No' Yes
|
3831
4288
|
CSGO_Profile_Rank: isNaN(parseInt(cleanDoc.CSGO_Profile_Rank)) ? cleanDoc.CSGO_Profile_Rank : parseInt(cleanDoc.CSGO_Profile_Rank),
|
3832
|
-
Experience_points_earned_towards_next_rank: isNaN(parseInt(cleanDoc.Experience_points_earned_towards_next_rank))
|
4289
|
+
Experience_points_earned_towards_next_rank: isNaN(parseInt(cleanDoc.Experience_points_earned_towards_next_rank))
|
4290
|
+
? cleanDoc.Experience_points_earned_towards_next_rank
|
4291
|
+
: parseInt(cleanDoc.Experience_points_earned_towards_next_rank),
|
3833
4292
|
Anti_addiction_online_time: cleanDoc.Anti_addiction_online_time,//'0:11:25'
|
3834
4293
|
}
|
3835
4294
|
}
|
3836
4295
|
|
3837
|
-
async resolveUsers(steamIDs = []) {
|
4296
|
+
async resolveUsers (steamIDs = []) {
|
3838
4297
|
return await SteamUser.resolveUsers(steamIDs, this.getCookies())
|
3839
4298
|
}
|
3840
4299
|
|
3841
|
-
static async resolveUsers(steamIDs = [], cookie) {//steamIDs max = 200
|
3842
|
-
if(typeof steamIDs === 'string') {
|
4300
|
+
static async resolveUsers (steamIDs = [], cookie) {//steamIDs max = 200
|
4301
|
+
if (typeof steamIDs === 'string') {
|
3843
4302
|
steamIDs = [steamIDs]
|
3844
4303
|
}
|
3845
4304
|
|
@@ -3854,7 +4313,7 @@ class SteamUser {
|
|
3854
4313
|
headers: { ...cookie && { cookie } },
|
3855
4314
|
})
|
3856
4315
|
|
3857
|
-
if(!Array.isArray(data)) {
|
4316
|
+
if (!Array.isArray(data)) {
|
3858
4317
|
return []
|
3859
4318
|
}
|
3860
4319
|
|
@@ -3876,15 +4335,15 @@ class SteamUser {
|
|
3876
4335
|
})
|
3877
4336
|
}
|
3878
4337
|
|
3879
|
-
static GetAvatarURLFromHash(hash, size) {
|
3880
|
-
if(!hash) {
|
4338
|
+
static GetAvatarURLFromHash (hash, size) {
|
4339
|
+
if (!hash) {
|
3881
4340
|
return
|
3882
4341
|
}
|
3883
4342
|
let strURL = 'https://avatars.akamai.steamstatic.com/' + hash
|
3884
4343
|
|
3885
|
-
if(size === 'full') {
|
4344
|
+
if (size === 'full') {
|
3886
4345
|
strURL += '_full.jpg'
|
3887
|
-
} else if(size === 'medium') {
|
4346
|
+
} else if (size === 'medium') {
|
3888
4347
|
strURL += '_medium.jpg'
|
3889
4348
|
} else {
|
3890
4349
|
strURL += '.jpg'
|
@@ -3893,35 +4352,35 @@ class SteamUser {
|
|
3893
4352
|
return strURL
|
3894
4353
|
}
|
3895
4354
|
|
3896
|
-
static GetAvatarHashFromURL(url) {
|
3897
|
-
if(!url) {
|
4355
|
+
static GetAvatarHashFromURL (url) {
|
4356
|
+
if (!url) {
|
3898
4357
|
return
|
3899
4358
|
}
|
3900
4359
|
const suffixes = ['_full.jpg', '_medium.jpg', '.jpg']
|
3901
4360
|
|
3902
|
-
for(const suffix of suffixes) {
|
3903
|
-
if(url.includes(suffix)) {
|
4361
|
+
for (const suffix of suffixes) {
|
4362
|
+
if (url.includes(suffix)) {
|
3904
4363
|
return url.split(suffix)[0].split('/').pop()
|
3905
4364
|
}
|
3906
4365
|
}
|
3907
4366
|
}
|
3908
4367
|
|
3909
|
-
static GetAvatarHashFromMultipleURL(urls = []) {
|
4368
|
+
static GetAvatarHashFromMultipleURL (urls = []) {
|
3910
4369
|
let avatarHash
|
3911
|
-
for(const avatar of urls) {
|
3912
|
-
if((avatarHash = SteamUser.GetAvatarHashFromURL(avatar))) {
|
4370
|
+
for (const avatar of urls) {
|
4371
|
+
if ((avatarHash = SteamUser.GetAvatarHashFromURL(avatar))) {
|
3913
4372
|
break
|
3914
4373
|
}
|
3915
4374
|
}
|
3916
4375
|
return avatarHash
|
3917
4376
|
}
|
3918
4377
|
|
3919
|
-
static createFriendCode(steamID) {
|
4378
|
+
static createFriendCode (steamID) {
|
3920
4379
|
const accountid = SteamUser.steamID642Miniprofile(steamID)
|
3921
4380
|
let acctIdHex = accountid.toString(16)
|
3922
4381
|
let friendCode = ''
|
3923
4382
|
|
3924
|
-
for(let i = 0; i < acctIdHex.length; i++) {
|
4383
|
+
for (let i = 0; i < acctIdHex.length; i++) {
|
3925
4384
|
let char = parseInt(acctIdHex[i], 16)
|
3926
4385
|
friendCode += FRIEND_CODE_REPLACEMENTS[char]
|
3927
4386
|
}
|
@@ -3930,11 +4389,11 @@ class SteamUser {
|
|
3930
4389
|
return friendCode.substring(0, dashPos) + '-' + friendCode.substring(dashPos)
|
3931
4390
|
}
|
3932
4391
|
|
3933
|
-
static parseFriendCode(friendCode) {
|
4392
|
+
static parseFriendCode (friendCode) {
|
3934
4393
|
friendCode = friendCode.replaceAll('-', '')
|
3935
4394
|
let acctIdHex = ''
|
3936
4395
|
|
3937
|
-
for(let i = 0; i < friendCode.length; i++) {
|
4396
|
+
for (let i = 0; i < friendCode.length; i++) {
|
3938
4397
|
let char = friendCode[i]
|
3939
4398
|
acctIdHex += FRIEND_CODE_REPLACEMENTS.indexOf(char).toString(16)
|
3940
4399
|
}
|
@@ -3942,19 +4401,19 @@ class SteamUser {
|
|
3942
4401
|
return new SteamID(`[U:1:${parseInt(acctIdHex, 16)}]`)
|
3943
4402
|
};
|
3944
4403
|
|
3945
|
-
static _formatString2Int(text) {
|
4404
|
+
static _formatString2Int (text) {
|
3946
4405
|
const count = parseInt(text?.replaceAll(',', '')?.trim())
|
3947
4406
|
return isNaN(count) ? null : count
|
3948
4407
|
}
|
3949
4408
|
|
3950
|
-
async testFullLanguage(cb) {
|
4409
|
+
async testFullLanguage (cb) {
|
3951
4410
|
const self = this
|
3952
4411
|
const initialLanguage = self.Steam_Language
|
3953
4412
|
const langs = Object.values(ELanguage)
|
3954
4413
|
_.pull(langs, [ELanguage.english])
|
3955
|
-
for(const lang of [ELanguage.english, ...langs]) {
|
4414
|
+
for (const lang of [ELanguage.english, ...langs]) {
|
3956
4415
|
self.setSteamLanguage(lang)
|
3957
|
-
if(cb.constructor.name === 'AsyncFunction') {
|
4416
|
+
if (cb.constructor.name === 'AsyncFunction') {
|
3958
4417
|
// 👇️ this runs
|
3959
4418
|
// console.log('✅ function is async')
|
3960
4419
|
await cb.call(self, lang)
|
@@ -3966,7 +4425,7 @@ class SteamUser {
|
|
3966
4425
|
self.setSteamLanguage(initialLanguage)
|
3967
4426
|
}
|
3968
4427
|
|
3969
|
-
async testNotYetSetupTextList(steamID) {//steamID that not setup
|
4428
|
+
async testNotYetSetupTextList (steamID) {//steamID that not setup
|
3970
4429
|
const notYetSetupTexts = []
|
3971
4430
|
await this.testFullLanguage(async function (lang) {
|
3972
4431
|
const sum = await this.getUserSummaryFromProfile(steamID)
|
@@ -3975,7 +4434,7 @@ class SteamUser {
|
|
3975
4434
|
return _.isEqual(NotYetSetupProfileTextList, notYetSetupTexts)
|
3976
4435
|
}
|
3977
4436
|
|
3978
|
-
async testPrivateText(steamID) {//steamID that private
|
4437
|
+
async testPrivateText (steamID) {//steamID that private
|
3979
4438
|
const privateTexts = []
|
3980
4439
|
await this.testFullLanguage(async function (lang) {
|
3981
4440
|
const sum = await this.getUserSummaryFromProfile(steamID)
|
@@ -3984,11 +4443,11 @@ class SteamUser {
|
|
3984
4443
|
return _.isEqual(PrivateProfileTextList, privateTexts)
|
3985
4444
|
}
|
3986
4445
|
|
3987
|
-
async testGameBan(steamID) {//steamID that private
|
4446
|
+
async testGameBan (steamID) {//steamID that private
|
3988
4447
|
const list = []
|
3989
4448
|
await this.testFullLanguage(async function (lang) {
|
3990
4449
|
const sum = await this.getUserSummaryFromProfile(steamID)
|
3991
|
-
if(sum.sectionText) {
|
4450
|
+
if (sum.sectionText) {
|
3992
4451
|
list.push(sum.sectionText.replace('1 ', '$1').replace('1162 ', '$2'))
|
3993
4452
|
// list.push(sum.gameBanFull.replace('1 ', '$1').replace('1162 ', '$2'))
|
3994
4453
|
}
|
@@ -3996,67 +4455,68 @@ class SteamUser {
|
|
3996
4455
|
return list
|
3997
4456
|
}
|
3998
4457
|
|
3999
|
-
async getSteamGuardStatus() {
|
4458
|
+
async getSteamGuardStatus () {
|
4000
4459
|
const result = await this._httpRequest({
|
4001
4460
|
url: `https://store.steampowered.com/twofactor/manage_action`,
|
4002
4461
|
})
|
4003
4462
|
const $ = cheerio.load(result?.data || '')
|
4004
4463
|
|
4005
|
-
if($('#steam_authenticator_form #steam_authenticator_check[checked]')?.length) {
|
4464
|
+
if ($('#steam_authenticator_form #steam_authenticator_check[checked]')?.length) {
|
4006
4465
|
return 'steam_authenticator'
|
4007
4466
|
}
|
4008
4467
|
|
4009
|
-
if($('#email_authenticator_form #email_authenticator_check[checked]')?.length) {
|
4468
|
+
if ($('#email_authenticator_form #email_authenticator_check[checked]')?.length) {
|
4010
4469
|
return 'email_authenticator'
|
4011
4470
|
}
|
4012
4471
|
|
4013
|
-
if($('#none_authenticator_form #none_authenticator_check[checked]')?.length) {
|
4472
|
+
if ($('#none_authenticator_form #none_authenticator_check[checked]')?.length) {
|
4014
4473
|
return 'none_authenticator'
|
4015
4474
|
}
|
4016
4475
|
}
|
4017
4476
|
|
4018
|
-
async turningSteamGuardOff() {
|
4477
|
+
async turningSteamGuardOff () {
|
4019
4478
|
const result = await this._httpRequest({
|
4020
4479
|
url: `https://store.steampowered.com/twofactor/manage_action`,
|
4021
4480
|
'headers': {
|
4022
4481
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4023
4482
|
'Referer': 'https://store.steampowered.com/twofactor/manage_action',
|
4024
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4483
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4025
4484
|
},
|
4026
4485
|
data: {
|
4027
4486
|
action: 'actuallynone',
|
4028
4487
|
},
|
4029
|
-
method: 'POST'
|
4488
|
+
method: 'POST',
|
4030
4489
|
})
|
4031
4490
|
const $ = cheerio.load(result?.data || '')
|
4032
|
-
return $('title').text() === `Steam Guard Mobile Authenticator` &&
|
4491
|
+
return $('title').text() === `Steam Guard Mobile Authenticator` &&
|
4492
|
+
!!result?.data?.includes?.(`Turning Steam Guard off requires confirmation. We've sent you an email with a link to confirm disabling Steam Guard.`)
|
4033
4493
|
}
|
4034
4494
|
|
4035
|
-
async turningEmailAuthenticatorCheckOn() {
|
4495
|
+
async turningEmailAuthenticatorCheckOn () {
|
4036
4496
|
const result = await this._httpRequest({
|
4037
4497
|
url: `https://store.steampowered.com/twofactor/manage_action`,
|
4038
4498
|
'headers': {
|
4039
4499
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4040
4500
|
'Referer': 'https://store.steampowered.com/twofactor/manage',
|
4041
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4501
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4042
4502
|
},
|
4043
4503
|
data: {
|
4044
4504
|
action: 'email',
|
4045
4505
|
email_authenticator_check: 'on',
|
4046
4506
|
},
|
4047
|
-
method: 'POST'
|
4507
|
+
method: 'POST',
|
4048
4508
|
})
|
4049
4509
|
const $ = cheerio.load(result?.data || '')
|
4050
4510
|
return $('title').text() === `Steam Guard Mobile Authenticator` && $('#email_authenticator_check')?.attr('checked') == 'checked'
|
4051
4511
|
}
|
4052
4512
|
|
4053
|
-
async getPhoneManage() {//Ends in 17
|
4513
|
+
async getPhoneManage () {//Ends in 17
|
4054
4514
|
const result = await this._httpRequest({
|
4055
4515
|
url: `https://store.steampowered.com/phone/manage`,
|
4056
4516
|
})
|
4057
4517
|
const $ = cheerio.load(result?.data || '')
|
4058
4518
|
const pageheader = $('h2.pageheader').text()
|
4059
|
-
switch(pageheader) {
|
4519
|
+
switch (pageheader) {
|
4060
4520
|
case 'Add a phone number to your account':
|
4061
4521
|
return 'none'
|
4062
4522
|
case 'Manage phone number':
|
@@ -4064,13 +4524,13 @@ class SteamUser {
|
|
4064
4524
|
}
|
4065
4525
|
}
|
4066
4526
|
|
4067
|
-
async addPhoneNumber(phone) {//+84 123456789
|
4527
|
+
async addPhoneNumber (phone) {//+84 123456789
|
4068
4528
|
const result = await this._httpRequest({
|
4069
4529
|
url: `https://store.steampowered.com/phone/add_ajaxop`,
|
4070
4530
|
'headers': {
|
4071
4531
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4072
4532
|
'Referer': 'https://store.steampowered.com/phone/add',
|
4073
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4533
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4074
4534
|
},
|
4075
4535
|
data: {
|
4076
4536
|
op: 'get_phone_number',
|
@@ -4080,7 +4540,7 @@ class SteamUser {
|
|
4080
4540
|
bisediting: '0',
|
4081
4541
|
token: '0',
|
4082
4542
|
},
|
4083
|
-
method: 'POST'
|
4543
|
+
method: 'POST',
|
4084
4544
|
})
|
4085
4545
|
return result?.data
|
4086
4546
|
const responseSuccessExample = {
|
@@ -4089,25 +4549,26 @@ class SteamUser {
|
|
4089
4549
|
'state': 'email_verification',
|
4090
4550
|
'errorText': '',
|
4091
4551
|
'token': '0',
|
4092
|
-
'phoneNumber': '+84123456789'
|
4552
|
+
'phoneNumber': '+84123456789',
|
4093
4553
|
}
|
4094
4554
|
}
|
4095
4555
|
|
4096
|
-
static async confirmEmailForAdd(confirmURL) {
|
4556
|
+
static async confirmEmailForAdd (confirmURL) {
|
4097
4557
|
const result = await axios.request({
|
4098
|
-
url: confirmURL
|
4558
|
+
url: confirmURL,
|
4099
4559
|
})
|
4100
4560
|
const $ = cheerio.load(result?.data || '')
|
4101
4561
|
//You may now close this window and continue the process of adding a phone number to your account.
|
4102
|
-
return !!($('title').text() === `Email Verification` && result?.data?.includes?.(`Email Confirmed`) &&
|
4562
|
+
return !!($('title').text() === `Email Verification` && result?.data?.includes?.(`Email Confirmed`) &&
|
4563
|
+
result?.data?.includes?.(`The phone can now be added to your account.`))
|
4103
4564
|
}
|
4104
4565
|
|
4105
|
-
async sendOtpConfirmPhoneForAdd() {
|
4566
|
+
async sendOtpConfirmPhoneForAdd () {
|
4106
4567
|
const retry_result = await this._httpRequest({
|
4107
4568
|
url: `https://store.steampowered.com/phone/add_ajaxop`,
|
4108
4569
|
'headers': {
|
4109
4570
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4110
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4571
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4111
4572
|
},
|
4112
4573
|
data: {
|
4113
4574
|
op: 'retry_email_verification',
|
@@ -4117,7 +4578,7 @@ class SteamUser {
|
|
4117
4578
|
bisediting: '0',
|
4118
4579
|
token: '0',
|
4119
4580
|
},
|
4120
|
-
method: 'POST'
|
4581
|
+
method: 'POST',
|
4121
4582
|
})
|
4122
4583
|
return retry_result?.data
|
4123
4584
|
const successExample = {
|
@@ -4127,14 +4588,14 @@ class SteamUser {
|
|
4127
4588
|
'errorText': '',
|
4128
4589
|
'token': '0',
|
4129
4590
|
'inputSize': '20',
|
4130
|
-
'maxLength': '5'
|
4591
|
+
'maxLength': '5',
|
4131
4592
|
}
|
4132
4593
|
|
4133
4594
|
const result = await this._httpRequest({
|
4134
4595
|
url: `https://store.steampowered.com/phone/add_ajaxop`,
|
4135
4596
|
'headers': {
|
4136
4597
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4137
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4598
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4138
4599
|
},
|
4139
4600
|
data: {
|
4140
4601
|
op: 'get_sms_code',
|
@@ -4144,14 +4605,14 @@ class SteamUser {
|
|
4144
4605
|
bisediting: '0',
|
4145
4606
|
token: '0',
|
4146
4607
|
},
|
4147
|
-
method: 'POST'
|
4608
|
+
method: 'POST',
|
4148
4609
|
})
|
4149
|
-
if(!result?.data?.success) {
|
4610
|
+
if (!result?.data?.success) {
|
4150
4611
|
const retry_result = await this._httpRequest({
|
4151
4612
|
url: `https://store.steampowered.com/phone/add_ajaxop`,
|
4152
4613
|
'headers': {
|
4153
4614
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4154
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4615
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4155
4616
|
},
|
4156
4617
|
data: {
|
4157
4618
|
op: 'retry_email_verification',
|
@@ -4161,7 +4622,7 @@ class SteamUser {
|
|
4161
4622
|
bisediting: '0',
|
4162
4623
|
token: '0',
|
4163
4624
|
},
|
4164
|
-
method: 'POST'
|
4625
|
+
method: 'POST',
|
4165
4626
|
})
|
4166
4627
|
return retry_result?.data
|
4167
4628
|
}
|
@@ -4169,12 +4630,12 @@ class SteamUser {
|
|
4169
4630
|
return result?.data
|
4170
4631
|
}
|
4171
4632
|
|
4172
|
-
async confirmPhoneCodeForAdd(code) {
|
4633
|
+
async confirmPhoneCodeForAdd (code) {
|
4173
4634
|
const result = await this._httpRequest({
|
4174
4635
|
url: `https://store.steampowered.com/phone/add_ajaxop`,
|
4175
4636
|
'headers': {
|
4176
4637
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4177
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4638
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4178
4639
|
},
|
4179
4640
|
data: {
|
4180
4641
|
op: 'get_sms_code',
|
@@ -4184,7 +4645,7 @@ class SteamUser {
|
|
4184
4645
|
bisediting: '0',
|
4185
4646
|
token: '0',
|
4186
4647
|
},
|
4187
|
-
method: 'POST'
|
4648
|
+
method: 'POST',
|
4188
4649
|
})
|
4189
4650
|
// if(!result?.data?.success){
|
4190
4651
|
// const retry_result = await this._httpRequest({
|
@@ -4215,27 +4676,27 @@ class SteamUser {
|
|
4215
4676
|
'vac_policy': 0,
|
4216
4677
|
'tos_policy': 2,
|
4217
4678
|
'showDone': true,
|
4218
|
-
'maxLength': '5'
|
4679
|
+
'maxLength': '5',
|
4219
4680
|
}
|
4220
4681
|
const responseErrorExample = {
|
4221
4682
|
success: false,
|
4222
4683
|
showResend: false,
|
4223
4684
|
state: false,
|
4224
4685
|
errorText: 'We ran into a problem performing that action. You may want to try again, or if the problem persists, contact Steam Support.',
|
4225
|
-
token: '0'
|
4686
|
+
token: '0',
|
4226
4687
|
}
|
4227
4688
|
}
|
4228
4689
|
|
4229
|
-
async removePhoneNumber() {
|
4690
|
+
async removePhoneNumber () {
|
4230
4691
|
const result = await this._httpRequest({
|
4231
4692
|
url: `https://help.steampowered.com/en/wizard/HelpRemovePhoneNumber?redir=store/account`,
|
4232
4693
|
})
|
4233
4694
|
let href = null
|
4234
4695
|
const $ = result._$()
|
4235
4696
|
$('a').each(function (index, el) {
|
4236
|
-
if(!href) {
|
4697
|
+
if (!href) {
|
4237
4698
|
const link = $(el).attr('href')
|
4238
|
-
if(link?.startsWith('https://help.steampowered.com/en/wizard/HelpWithLoginInfoEnterCode?s=')) {
|
4699
|
+
if (link?.startsWith('https://help.steampowered.com/en/wizard/HelpWithLoginInfoEnterCode?s=')) {
|
4239
4700
|
href = link
|
4240
4701
|
}
|
4241
4702
|
}
|
@@ -4243,17 +4704,17 @@ class SteamUser {
|
|
4243
4704
|
let s = null
|
4244
4705
|
try {
|
4245
4706
|
s = url.parse(href).query.split('&').map(q => q.split('=')).find(q => q[0] === 's')[1]
|
4246
|
-
} catch(e) {
|
4707
|
+
} catch (e) {
|
4247
4708
|
}
|
4248
|
-
if(!s) return {
|
4249
|
-
success: false
|
4709
|
+
if (!s) return {
|
4710
|
+
success: false,
|
4250
4711
|
}
|
4251
4712
|
|
4252
4713
|
const sendAccountRecoveryCodeResult = await this._httpRequest({
|
4253
4714
|
url: `https://help.steampowered.com/en/wizard/AjaxSendAccountRecoveryCode`,
|
4254
4715
|
'headers': {
|
4255
4716
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4256
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4717
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4257
4718
|
},
|
4258
4719
|
data: {
|
4259
4720
|
wizard_ajax: '1',
|
@@ -4262,7 +4723,7 @@ class SteamUser {
|
|
4262
4723
|
method: 4,
|
4263
4724
|
link: '',
|
4264
4725
|
},
|
4265
|
-
method: 'POST'
|
4726
|
+
method: 'POST',
|
4266
4727
|
})
|
4267
4728
|
|
4268
4729
|
return {
|
@@ -4271,11 +4732,11 @@ class SteamUser {
|
|
4271
4732
|
}
|
4272
4733
|
}
|
4273
4734
|
|
4274
|
-
async removePhoneNumberConfirmOptCode(s, code) {
|
4275
|
-
if(!s) {
|
4735
|
+
async removePhoneNumberConfirmOptCode (s, code) {
|
4736
|
+
if (!s) {
|
4276
4737
|
console.log('[removePhoneNumberConfirmOptCode] Missing s param')
|
4277
4738
|
return {
|
4278
|
-
success: false
|
4739
|
+
success: false,
|
4279
4740
|
}
|
4280
4741
|
}
|
4281
4742
|
const params = {
|
@@ -4287,17 +4748,17 @@ class SteamUser {
|
|
4287
4748
|
issueid: 403,
|
4288
4749
|
sessionid: this.getSessionid(),
|
4289
4750
|
wizard_ajax: 1,
|
4290
|
-
gamepad: 0
|
4751
|
+
gamepad: 0,
|
4291
4752
|
}
|
4292
4753
|
|
4293
4754
|
const result = await this._httpRequest({
|
4294
4755
|
url: `https://help.steampowered.com/en/wizard/AjaxVerifyAccountRecoveryCode?` + Object.keys(params).map(k => `${k}=${params[k]}`).join('&'),
|
4295
4756
|
})
|
4296
4757
|
|
4297
|
-
if(result.data.errorMsg) {
|
4758
|
+
if (result.data.errorMsg) {
|
4298
4759
|
return {
|
4299
4760
|
...result.data,
|
4300
|
-
success: false
|
4761
|
+
success: false,
|
4301
4762
|
}
|
4302
4763
|
}
|
4303
4764
|
|
@@ -4305,23 +4766,23 @@ class SteamUser {
|
|
4305
4766
|
url: `https://help.steampowered.com/en/wizard/AjaxAccountRecoveryResetPhoneNumber/`,
|
4306
4767
|
'headers': {
|
4307
4768
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
4308
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
4769
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
4309
4770
|
},
|
4310
4771
|
data: {
|
4311
4772
|
s,
|
4312
|
-
account: this.getMiniProfileUser()
|
4773
|
+
account: this.getMiniProfileUser(),
|
4313
4774
|
},
|
4314
|
-
method: 'POST'
|
4775
|
+
method: 'POST',
|
4315
4776
|
})
|
4316
4777
|
|
4317
4778
|
return {
|
4318
4779
|
...accountRecoveryResetPhoneNumberResult.data,
|
4319
|
-
success: accountRecoveryResetPhoneNumberResult.data.errorMsg === ''
|
4780
|
+
success: accountRecoveryResetPhoneNumberResult.data.errorMsg === '',
|
4320
4781
|
}
|
4321
4782
|
}
|
4322
4783
|
|
4323
|
-
static parseGameBanType(gameBanFull) {
|
4324
|
-
if(Array.isArray(gameBanFull) && !gameBanFull.length) {
|
4784
|
+
static parseGameBanType (gameBanFull) {
|
4785
|
+
if (Array.isArray(gameBanFull) && !gameBanFull.length) {
|
4325
4786
|
return {
|
4326
4787
|
isVACBan: 0,
|
4327
4788
|
isGameBan: 0,
|
@@ -4333,37 +4794,33 @@ class SteamUser {
|
|
4333
4794
|
const isTradeBan = gameBanFull.some(txt => ECurrentlyTradeBanned.includes(txt)) ? 1 : 0
|
4334
4795
|
|
4335
4796
|
let isVACBan = 0
|
4336
|
-
if(gameBanFull.some(txt => E1VACBanOnRecord.includes(txt))) {
|
4797
|
+
if (gameBanFull.some(txt => E1VACBanOnRecord.includes(txt))) {
|
4337
4798
|
isVACBan = 1
|
4338
|
-
} else if(gameBanFull.some(txt => EMultipleVACBansOnRecord.includes(txt))) {
|
4799
|
+
} else if (gameBanFull.some(txt => EMultipleVACBansOnRecord.includes(txt))) {
|
4339
4800
|
isVACBan = 'Multiple'
|
4340
4801
|
}
|
4341
4802
|
|
4342
4803
|
let isGameBan = 0
|
4343
|
-
if(gameBanFull.some(txt => E1GameBanOnRecord.includes(txt))) {
|
4804
|
+
if (gameBanFull.some(txt => E1GameBanOnRecord.includes(txt))) {
|
4344
4805
|
isGameBan = 1
|
4345
|
-
} else if(gameBanFull.some(txt => EMultipleGameBansOnRecord.includes(txt))) {
|
4806
|
+
} else if (gameBanFull.some(txt => EMultipleGameBansOnRecord.includes(txt))) {
|
4346
4807
|
isGameBan = 'Multiple'
|
4347
4808
|
}
|
4348
4809
|
|
4349
|
-
let daysSinceLastBan = gameBanFull
|
4350
|
-
.map(
|
4351
|
-
|
4352
|
-
.map(s => [...gameBanPart.matchAll(new RegExp(s, 'gi'))])
|
4353
|
-
.filter(s => s.length)
|
4354
|
-
})
|
4355
|
-
.filter(s => s.length)
|
4810
|
+
let daysSinceLastBan = gameBanFull.map(function (gameBanPart) {
|
4811
|
+
return Object.values(EdaySinceLastBanRegExp).map(s => [...gameBanPart.matchAll(new RegExp(s, 'gi'))]).filter(s => s.length)
|
4812
|
+
}).filter(s => s.length)
|
4356
4813
|
|
4357
|
-
if(Array.isArray(daysSinceLastBan?.[0]?.[0]?.[0])) {
|
4814
|
+
if (Array.isArray(daysSinceLastBan?.[0]?.[0]?.[0])) {
|
4358
4815
|
daysSinceLastBan = parseInt(daysSinceLastBan[0][0][0][1])
|
4359
|
-
if(isNaN(daysSinceLastBan)) {
|
4816
|
+
if (isNaN(daysSinceLastBan)) {
|
4360
4817
|
//error
|
4361
4818
|
}
|
4362
4819
|
} else {
|
4363
4820
|
daysSinceLastBan = null
|
4364
4821
|
}
|
4365
4822
|
|
4366
|
-
if(!isTradeBan && !isVACBan && !isGameBan) {
|
4823
|
+
if (!isTradeBan && !isVACBan && !isGameBan) {
|
4367
4824
|
console.error('parseGameBanType Error', gameBanFull)
|
4368
4825
|
}
|
4369
4826
|
|
@@ -4371,11 +4828,11 @@ class SteamUser {
|
|
4371
4828
|
isVACBan,
|
4372
4829
|
isGameBan,
|
4373
4830
|
isTradeBan,
|
4374
|
-
daysSinceLastBan
|
4831
|
+
daysSinceLastBan,
|
4375
4832
|
}
|
4376
4833
|
}
|
4377
4834
|
|
4378
|
-
async getAccountEmail() {
|
4835
|
+
async getAccountEmail () {
|
4379
4836
|
const result = await this._httpRequest('https://store.steampowered.com/account/')
|
4380
4837
|
if (!result.data) {
|
4381
4838
|
return
|