mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 01:06:17 +00:00
Fix url
This commit is contained in:
@@ -132,9 +132,13 @@ Automatically create new Microsoft accounts with advanced security features:
|
||||
# Interactive mode (asks everything)
|
||||
npm run creator
|
||||
|
||||
# With specific recovery email (auto-detected, no flag needed!)
|
||||
# With specific recovery email (simplified URL - recommended)
|
||||
npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com
|
||||
|
||||
# If URL has & symbols (from Microsoft copy-paste), use quotes:
|
||||
npm run creator -- "https://rewards.bing.com/welcome?rh=CODE&ref=..." -y backup@gmail.com
|
||||
|
||||
# ⚠️ IMPORTANT: URLs with & MUST be in quotes (CMD/PowerShell requirement)
|
||||
```
|
||||
|
||||
**✨ Features:**
|
||||
|
||||
@@ -38,10 +38,16 @@ npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y
|
||||
# With specific recovery email (auto-detected)
|
||||
npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y backup@gmail.com
|
||||
|
||||
# If URL from Microsoft has &ref= or &form=, use quotes:
|
||||
npm run creator -- "https://rewards.bing.com/welcome?rh=CODE&ref=..." -y backup@gmail.com
|
||||
|
||||
# Minimal - just recovery email without referral
|
||||
npm run creator -- -y myrecovery@gmail.com
|
||||
|
||||
# Note: The -- is REQUIRED to pass arguments to the script via npm!
|
||||
# ⚠️ CRITICAL NOTES:
|
||||
# - The -- is REQUIRED to pass arguments via npm
|
||||
# - URLs with & MUST be in quotes (CMD/PowerShell cuts at & otherwise)
|
||||
# - You can simplify URLs to just ?rh=CODE (other params are optional)
|
||||
```
|
||||
|
||||
### 🎛️ Command Line Arguments
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import * as readline from 'readline'
|
||||
import Browser from '../browser/Browser'
|
||||
import { MicrosoftRewardsBot } from '../index'
|
||||
import { log } from '../util/notifications/Logger'
|
||||
@@ -24,6 +25,41 @@ async function main(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
// CRITICAL: Detect truncated URLs (PowerShell/CMD cut at & character)
|
||||
// If URL detected but no -y flag AND no email, likely the URL was cut
|
||||
if (referralUrl && !autoAccept && !recoveryEmail && args.length === 1) {
|
||||
// Check if URL looks truncated (ends with parameter but no value after &)
|
||||
if (referralUrl.includes('?') && !referralUrl.includes('&')) {
|
||||
log(false, 'CREATOR-CLI', '', 'log')
|
||||
log(false, 'CREATOR-CLI', '⚠️ WARNING: URL may be truncated!', 'warn', 'yellow')
|
||||
log(false, 'CREATOR-CLI', ' The & character is special in CMD/PowerShell and cuts the URL.', 'warn', 'yellow')
|
||||
log(false, 'CREATOR-CLI', '', 'log')
|
||||
log(false, 'CREATOR-CLI', '✅ SOLUTION: Put the URL in quotes:', 'log', 'green')
|
||||
log(false, 'CREATOR-CLI', ' npm run creator -- "https://rewards.bing.com/...full-url..." -y email@gmail.com', 'log', 'cyan')
|
||||
log(false, 'CREATOR-CLI', '', 'log')
|
||||
log(false, 'CREATOR-CLI', '💡 TIP: Only the rh= code matters. You can simplify to:', 'log', 'gray')
|
||||
log(false, 'CREATOR-CLI', ' npm run creator -- https://rewards.bing.com/welcome?rh=YOUR_CODE -y email@gmail.com', 'log', 'cyan')
|
||||
log(false, 'CREATOR-CLI', '', 'log')
|
||||
|
||||
// Ask user if they want to continue anyway
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
})
|
||||
|
||||
await new Promise<void>((resolve) => {
|
||||
rl.question('Continue with this URL anyway? (y/N): ', (answer: string) => {
|
||||
rl.close()
|
||||
if (answer.toLowerCase() !== 'y' && answer.toLowerCase() !== 'yes') {
|
||||
log(false, 'CREATOR-CLI', '❌ Aborted. Please retry with the URL in quotes.', 'error')
|
||||
process.exit(0)
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Banner
|
||||
log(false, 'CREATOR-CLI', '', 'log') // Empty line
|
||||
log(false, 'CREATOR-CLI', '='.repeat(60), 'log', 'cyan')
|
||||
|
||||
Reference in New Issue
Block a user