Fix link Acc

This commit is contained in:
2025-11-29 14:31:35 +01:00
parent 7ca720f8c0
commit 9a547bdbab
5 changed files with 48 additions and 11 deletions

View File

@@ -134,7 +134,7 @@ npm start
npm run creator
# Quick mode with referral
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=CODE
npm run creator -- -y backup@gmail.com "https://rewards.bing.com/welcome?rh=CODE&ref=..."
```
### **Troubleshooting** (Issues)
@@ -228,7 +228,7 @@ Automatically create new Microsoft accounts with advanced security features:
npm run creator
# With auto-accept and recovery email (copy-paste URL directly from Microsoft)
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=YOUR_CODE
npm run creator -- -y backup@gmail.com "https://rewards.bing.com/welcome?rh=YOUR_CODE"
```
**✨ Features:**

View File

@@ -246,7 +246,7 @@ npm run dashboard-dev
npm run creator
# With auto-accept and recovery email (copy-paste URL directly from Microsoft)
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=YOUR_CODE
npm run creator -- -y backup@gmail.com "https://rewards.bing.com/welcome?rh=YOUR_CODE"
```
**When to use:**

View File

@@ -106,7 +106,7 @@ Explore advanced features and customization options:| **[NTFY Alerts](ntfy.md)**
**Quick command:**
```bash
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=YOUR_CODE
npm run creator -- -y backup@gmail.com "https://rewards.bing.com/welcome?rh=YOUR_CODE"
```
---

View File

@@ -36,7 +36,7 @@ npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE
npm run creator -- -y https://rewards.bing.com/welcome?rh=YOUR_CODE
# With specific recovery email (full automation) - RECOMMENDED ORDER
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=YOUR_CODE
npm run creator -- -y backup@gmail.com "https://rewards.bing.com/welcome?rh=YOUR_CODE"
# Minimal - just recovery email without referral
npm run creator -- -y myrecovery@gmail.com
@@ -87,7 +87,7 @@ npm run creator -- -y
npm run creator -- -y https://rewards.bing.com/welcome?rh=B395E9D7
# Full automation with specific recovery email (no prompts)
npm run creator -- -y backup@gmail.com https://rewards.bing.com/welcome?rh=B395E9D7
npm run creator -- -y backup@gmail.com "https://rewards.bing.com/welcome?rh=B395E9D7"
# Just with recovery email, no referral
npm run creator -- -y myrecovery@example.com

View File

@@ -3,6 +3,22 @@ import { MicrosoftRewardsBot } from '../index'
import { log } from '../util/notifications/Logger'
import { AccountCreator } from './AccountCreator'
import * as readline from 'readline'
async function askForUrl(): Promise<string> {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
return new Promise((resolve) => {
rl.question(' 👉 Please paste the FULL URL here: ', (answer) => {
rl.close()
resolve(answer.trim())
})
})
}
async function main(): Promise<void> {
// Parse command line args
const args = process.argv.slice(2)
@@ -21,17 +37,37 @@ async function main(): Promise<void> {
} else if (arg.includes('@')) {
// Auto-detect email addresses
recoveryEmail = arg
} else if (arg.startsWith('ref=') || arg.startsWith('form=') || arg.startsWith('CREA=')) {
} else if (referralUrl && (arg.includes('=') || arg.startsWith('&'))) {
// SMART FIX: Detect leftover URL fragments from CMD/PowerShell & splitting
// When user forgets quotes, CMD splits at & and passes fragments as separate args
// We silently ignore these fragments (only the rh= code matters anyway)
// Example: "https://...?rh=CODE&ref=X&form=Y" becomes ["https://...?rh=CODE", "ref=X", "form=Y"]
continue // Ignore these - they're optional tracking parameters
// We append these fragments back to the URL to preserve the full link
// Example: "https://...?rh=CODE&ref=X" becomes ["https://...?rh=CODE", "ref=X"]
const fragment = arg.startsWith('&') ? arg.substring(1) : arg
referralUrl += '&' + fragment
log(false, 'CREATOR-CLI', `🔗 Re-attached URL fragment: &${fragment}`, 'log', 'gray')
}
}
// AUTO-FIX: Ensure referral URL has &new=1 parameter (REQUIRED for referral to work)
if (referralUrl) {
// WARNING: Check for truncated URL (common issue with PowerShell/CMD)
if (referralUrl.includes('rh=') && !referralUrl.includes('ref=')) {
log(false, 'CREATOR-CLI', '', 'log')
log(false, 'CREATOR-CLI', '⚠️ POSSIBLE URL TRUNCATION DETECTED', 'warn', 'yellow')
log(false, 'CREATOR-CLI', ' The referral URL seems to be missing parameters (ref=, form=, etc.)', 'warn', 'yellow')
log(false, 'CREATOR-CLI', ' This usually happens because the "&" character cuts off the command.', 'warn', 'yellow')
// INTERACTIVE FIX: Ask user to paste the full URL
log(false, 'CREATOR-CLI', ' 🛑 AUTOMATIC PAUSE: To prevent failure, please provide the full URL.', 'warn', 'yellow')
const newUrl = await askForUrl()
if (newUrl && newUrl.startsWith('http')) {
referralUrl = newUrl
log(false, 'CREATOR-CLI', '✅ URL updated successfully!', 'log', 'green')
} else {
log(false, 'CREATOR-CLI', '⚠️ Invalid URL provided, continuing with truncated URL...', 'warn', 'yellow')
}
}
// Remove any existing &new=1 to avoid duplication
referralUrl = referralUrl.replace(/&new=1/g, '')
@@ -61,9 +97,10 @@ async function main(): Promise<void> {
log(false, 'CREATOR-CLI', '📖 Usage Examples:', 'log', 'cyan')
log(false, 'CREATOR-CLI', ' npm run creator -- -y # Auto mode', 'log', 'gray')
log(false, 'CREATOR-CLI', ' npm run creator -- -y email@gmail.com # With recovery email', 'log', 'gray')
log(false, 'CREATOR-CLI', ' npm run creator -- -y email@gmail.com https://rewards... # Full automation', 'log', 'gray')
log(false, 'CREATOR-CLI', ' npm run creator -- -y email@gmail.com "https://rewards..." # Full automation (QUOTES REQUIRED!)', 'log', 'gray')
log(false, 'CREATOR-CLI', '', 'log')
log(false, 'CREATOR-CLI', '⚠️ IMPORTANT: Put -y and email BEFORE the URL!', 'warn', 'yellow')
log(false, 'CREATOR-CLI', '⚠️ IMPORTANT: Always put QUOTES around the URL if it contains "&"', 'warn', 'yellow')
log(false, 'CREATOR-CLI', '', 'log')
}