Initial commit: Torrent search and download application
This commit is contained in:
commit
e38be704ff
4313 changed files with 791544 additions and 0 deletions
50
get_rutracker_cookie.js
Normal file
50
get_rutracker_cookie.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
const puppeteer = require('puppeteer');
|
||||
|
||||
async function getRuTrackerCookie() {
|
||||
const browser = await puppeteer.launch({
|
||||
headless: false, // Показываем браузер для ввода капчи
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
|
||||
try {
|
||||
// Переходим на страницу входа
|
||||
await page.goto('https://rutracker.org/forum/login.php');
|
||||
|
||||
// Ждем загрузки формы
|
||||
await page.waitForSelector('input[name="login_username"]');
|
||||
|
||||
// Вводим логин
|
||||
await page.type('input[name="login_username"]', 'vrubelroman');
|
||||
|
||||
// Вводим пароль
|
||||
await page.type('input[name="login_password"]', 'nlTEk');
|
||||
|
||||
// Нажимаем кнопку входа
|
||||
await page.click('input[name="login"]');
|
||||
|
||||
// Ждем перенаправления
|
||||
await page.waitForNavigation();
|
||||
|
||||
// Получаем cookies
|
||||
const cookies = await page.cookies();
|
||||
const bbSession = cookies.find(cookie => cookie.name === 'bb_session');
|
||||
|
||||
if (bbSession) {
|
||||
console.log('bb_session cookie:', bbSession.value);
|
||||
console.log('Domain:', bbSession.domain);
|
||||
console.log('Path:', bbSession.path);
|
||||
} else {
|
||||
console.log('Cookie bb_session не найден');
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('Ошибка:', error);
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
|
||||
getRuTrackerCookie();
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue