From 04a3acb5e986523a02823356e66ec5ba8b90f820 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Tue, 4 Apr 2023 10:30:16 +0200 Subject: [PATCH] try to save cookies --- src/workers/CommandorPage.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 3547d7f..14a0d36 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -382,6 +382,13 @@ class CommandorPage { } else { if (content.includes(MESSAGE_URL_VALIDATION_FR) || content.includes(MESSAGE_URL_VALIDATION_EN)) { log("successful"); + // save cookies + try { + let cookies = await this.context.cookies() + await fs.writeFileSync(this.contact.mail + '.txt', cookies.join('\n')); + } catch (e) { + console.log(e) + } await this.push_message_to_queue(PublishType.SUCCESS); } else if (content.includes(EMPTY_RESPONSE_ERROR)) { log("EMPTY_RESPONSE_ERROR error received, will quit")