Steam User Manager: Скрипт для летней распродажи 2023 (получение карточек и стикеров)

DemeIIIus

Опытный
Дней с нами
3.663
Розыгрыши
0
Сообщения
179
Репутация
38
Реакции
151
Расширение:

Ссылка на тему с описанием расширения:

Запускать с popup окна расширения в консоли (F12)
которое откроется после клика на логотип в окне расширения

Скрипт для получения карточек и стикеров:
Код:
let sha1 = (login, cb) => window.crypto.subtle.digest({name: "SHA-1"}, new Uint8Array(login.match(/.{1}/g).map(s => s.charCodeAt()))).then(result => cb([...new Uint8Array(result)].map(n => n.toString(16)).join(''))),
chrome_id = `${chrome.runtime.id}_id`;

chrome.runtime.sendMessage('getAccs', accs => {
    let explore = (ids, cb) => {
        if(ids.length){
            let id = ids.shift(),
            acc = accs.find(acc => acc.id == id);
            console.log(acc.login);
            console.log(`${accs.length - ids.length} of ${accs.length}`);
            req('get', 'https://store.steampowered.com/explore/', null, {[chrome_id]: id}).done(data => {
                let rgApps = {n: -1},
                access_token = data.match(/webapi_token":"([a-f\d]{32})/)?.[1],
                sessionid = data.match(/var g_sessionID = "([a-f0-9]{24})";/)?.[1];
                if(sessionid && access_token){
                    let clear_queue = queue => {
                        if(queue){
                            rgApps.queue.push(queue);
                        }else{
                            rgApps.n++;
                        }
                        while(rgApps.queue.length){
                            let queue = rgApps.queue.shift();
                            req('post', 'https://store.steampowered.com/app/10', {
                                sessionid, appid_to_clear_from_queue: queue
                            }, {[chrome_id]: id}).done(() => {
                                clear_queue();
                            }).fail(() => {
                                setTimeout(() => clear_queue(queue), Math.floor(Math.random() * 5000));
                            });
                        }
                        if(rgApps.n == rgApps.m){
                            req('post', `https://api.steampowered.com/ISaleItemRewardsService/ClaimItem/v1?access_token=${access_token}`, {input_json: '{"language":"english"}'}, {[chrome_id]: id}).always(() => {
                                setTimeout(() => explore(ids, cb), Math.floor(Math.random() * 3000));
                            });
                        }
                    };
                    req('post', 'https://store.steampowered.com/explore/generatenewdiscoveryqueue', {sessionid}, {[chrome_id]: id}).done(data => {
                        if(data && Array.isArray(data.queue)){
                            rgApps.queue = data.queue;
                            rgApps.m = rgApps.queue.length;
                            clear_queue();
                        }else{
                            if(acc.err++ < 5){
                                setTimeout(() => explore(ids.concat(id), cb), Math.floor(Math.random() * 5000));
                            }else{
                                setTimeout(() => explore(ids, cb), Math.floor(Math.random() * 5000));
                            }
                        }
                    }).fail(() => {
                        if(acc.err++ < 5){
                            setTimeout(() => explore(ids.concat(id), cb), Math.floor(Math.random() * 5000));
                        }else{
                            setTimeout(() => explore(ids, cb), Math.floor(Math.random() * 5000));
                        }
                    });
                }else{
                    console.log('not authorized');
                    if(acc.err++ < 3){
                        ajaxrefresh(id, 'https://store.steampowered.com/explore/', success => {
                            console.log('refresh token:', success);
                            if(success){
                                setTimeout(() => explore([id, ...ids], cb), Math.floor(Math.random() * 5000));
                            }else{
                                if(acc.secret.shared){
                                    chrome.runtime.sendMessage({type: 're_auth', id: acc.AccountID});
                                    chrome.extension.onMessage.addListener(function re_auth(message){
                                        if(message.type == 'auth'){
                                            console.log('re_auth:', message.data.success);
                                            chrome.extension.onMessage.removeListener(re_auth);
                                            if(message.data.success){
                                                setTimeout(() => explore([id, ...ids], cb), Math.floor(Math.random() * 5000));
                                            }else{
                                                setTimeout(() => explore(ids, cb), Math.floor(Math.random() * 3000));
                                            }
                                        }
                                    });
                                }else{
                                    setTimeout(() => explore(ids, cb), Math.floor(Math.random() * 3000));
                                }
                            }
                        });
                    }else{
                        setTimeout(() => explore(ids, cb), Math.floor(Math.random() * 5000));
                    }
                }
            }).fail(() => {
                if(acc.err++ < 5){
                    setTimeout(() => explore(ids.concat(id), cb), Math.floor(Math.random() * 5000));
                }else{
                    setTimeout(() => explore(ids, cb), Math.floor(Math.random() * 5000));
                }
            });
        }else{
            cb();
        }
    };
    let ids = [];
    for(let acc of accs){
        sha1(acc.login, id => {
            ids.push(id);
            acc.AccountID = acc.id;
            acc.id = id;
            acc.err = 0;
            if(accs.length == ids.length){
                explore(ids, () => console.log(true));
            }
        })
    }
});

function settoken(id, url, params, cb){
    req('post', url, params , {[`${chrome.runtime.id}_id`]: id}).always(data => {
        cb(data?.result == 1);
    });
};

function ajaxrefresh(id, redir, cb)    {
    req('post', 'https://login.steampowered.com/jwt/ajaxrefresh', {
        redir
    }, {[`${chrome.runtime.id}_id`]: id}).always(data => {
        if(data?.success){
            settoken(id, data.login_url, {auth: data.auth, nonce: data.nonce, steamID: data.steamID}, cb);
        }else{
            cb(false);
        }
    });
};
 
Последнее редактирование:
Спасибо тебе добрый человек, что каждый год ты обновляешь скрипты. Побольше бы таких людей как ты. Которые еще и без хайда это выкладывают. Удачи тебе и побольше денег.
---------Двойное сообщение соединено: ---------

Вот кст еще если кому надо будет.
Вроде тоже норм прога там и инвенты и всякое такое. Но плохо то что кодер не сразу обновляет свои скрипты. Я вот сам фиксил помню 1 но сюда не выкладывал(забыл). Выложу ща крч если кому интересно это скрипт на голосование стим. Хз будет он работать или не будет в некст году. Тогда работал.
Хз как тут у вас на форуме js файл прикрепить напишу крч так в сообщение.
Код:
module.exports = function(steamClient, RequestCommunity, RequestStore, SessionID, options, callback){
vote(RequestStore, SessionID, 61, 892970, 0, function () {
vote(RequestStore, SessionID, 62, 752480, 0, function () {
vote(RequestStore, SessionID, 63, 105600, 0, function () {
vote(RequestStore, SessionID, 64, 1426210, 0, function () {
vote(RequestStore, SessionID, 65, 1551360, 0, function () {
vote(RequestStore, SessionID, 66, 1282730, 0, function () {
vote(RequestStore, SessionID, 67, 1517290, 0, function () {
vote(RequestStore, SessionID, 68, 1088850, 0, function () {
vote(RequestStore, SessionID, 69, 1091500, 0, function () {
vote(RequestStore, SessionID, 70, 1248130, 0, function () {
callback();
})
})
})
})
})
})
})
})
})
})
};
function vote(RequestStore, SessionID, voteid, appid, developerid, callback) {
RequestStore.post({
url: 'https://store.steampowered.com/salevote',
form:{
sessionid: SessionID,
voteid: voteid,
appid: appid,
developerid: developerid
},
headers: {
'Origin': 'https://store.steampowered.com',
'Accept': '*/*',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer': 'https://store.steampowered.com/steamawards/2019/'

}
}, function (error, response, body) {
callback();
})
}
Вот крч кому надо забирайте. Я его немного подредачил что бы он работал. Мб и на гитхабе уже есть рабочий не смотрел честно. Твой скрипт спас меня от рутины, да и я с ноута сейчас доступа к пк нету. А фиксить тот скрипт того кодера я уже не стал)
 
Последнее редактирование:
  • Like
Реакции: DemeIIIus