-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrefresh.js
More file actions
27 lines (21 loc) · 777 Bytes
/
refresh.js
File metadata and controls
27 lines (21 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { refreshCookie } = require('./alexa-functions');
const fs = require('fs');
const logger = require('./logger');
// Load your existing cookie data
const cookieData = {
// Your existing cookie data here
};
async function refreshAndSave() {
try {
// Refresh the cookie
const newCookieData = await refreshCookie(cookieData);
// Save the new cookie data to a file
fs.writeFileSync('cookie-data.json', JSON.stringify(newCookieData, null, 2));
logger.log('Cookie refreshed and saved successfully!');
logger.log('You can now use this new cookie data for Alexa operations');
} catch (err) {
logger.error('Error refreshing cookie:', err);
}
}
// Run the refresh
refreshAndSave();