scripter-x 1.0.16 → 1.0.17
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/package.json +1 -1
- package/src/flipkart.js +1 -1
- package/src/util.js +4 -2
- package/src/worker.js +3 -0
package/package.json
CHANGED
package/src/flipkart.js
CHANGED
|
@@ -159,7 +159,7 @@ export class FlipkartLogin {
|
|
|
159
159
|
},
|
|
160
160
|
});
|
|
161
161
|
const text = await res.text();
|
|
162
|
-
const count = (text.match(/
|
|
162
|
+
const count = (text.match(/OD\d{15,}/g) || []).length;
|
|
163
163
|
return count === 0; // no orders ⇒ coupon available
|
|
164
164
|
}
|
|
165
165
|
|
package/src/util.js
CHANGED
|
@@ -84,11 +84,13 @@ export async function saveSessions(api, cid, { campaignName, out } = {}) {
|
|
|
84
84
|
const minutesUsed = []; // coupon_eligible=false → already placed a Minutes order
|
|
85
85
|
const unchecked = []; // coupon_eligible absent → check wasn't done for this account
|
|
86
86
|
|
|
87
|
+
let hasChecked = false;
|
|
87
88
|
for (const a of accounts) {
|
|
88
89
|
const sess = a.session;
|
|
89
90
|
if (!sess) continue;
|
|
90
91
|
const eligible = a.coupon_eligible;
|
|
91
|
-
if (
|
|
92
|
+
if (eligible !== undefined && eligible !== null) {
|
|
93
|
+
hasChecked = true;
|
|
92
94
|
(eligible ? minutesFree : minutesUsed).push(sess);
|
|
93
95
|
} else {
|
|
94
96
|
unchecked.push(sess);
|
|
@@ -96,7 +98,7 @@ export async function saveSessions(api, cid, { campaignName, out } = {}) {
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
const results = [];
|
|
99
|
-
if (checkMinutes && (minutesFree.length || minutesUsed.length)) {
|
|
101
|
+
if (hasChecked || (checkMinutes && (minutesFree.length || minutesUsed.length))) {
|
|
100
102
|
const destFree = write('-minutes-free', minutesFree);
|
|
101
103
|
if (destFree) results.push({ label: '🟢 minutes-free (₹100 coupon)', path: destFree, count: minutesFree.length });
|
|
102
104
|
|
package/src/worker.js
CHANGED
|
@@ -242,6 +242,9 @@ export class Worker {
|
|
|
242
242
|
|
|
243
243
|
this._emit(slot, { phase: 'saving', detail: 'saving session' });
|
|
244
244
|
this.log(`SUCCESS ${number.mobile} — session extracted (₹${number.cost})${res.email_linked ? ` + email ${res.linked_email}` : ''}`);
|
|
245
|
+
res.status = 'success';
|
|
246
|
+
res.cost = number.cost;
|
|
247
|
+
res.session = session;
|
|
245
248
|
const doneDetail = res.email_linked ? `extracted + ${res.linked_email}` : 'extracted';
|
|
246
249
|
this._emit(slot, { phase: 'done', detail: doneDetail });
|
|
247
250
|
releaseOnce(true, doneDetail); // success still releases the number (OTP already consumed)
|