The following changes were made by the replace_file_content tool to: /root/aadharbot/gateways.js. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -99,6 +99,45 @@ } } + if (requestUrl && (requestUrl.includes('embed') || requestUrl.includes('master88.in'))) { + try { + console.log(`[GATEWAY] Extracting embedded iframe/url from: ${requestUrl}`); + const embedRes = await fetch(requestUrl, { + headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } + }); + if (embedRes.ok) { + const html = await embedRes.text(); + const iframeMatch = html.match(/]+src=["'](https?:\/\/[^"']+)["']/i) || + html.match(/href=["'](https?:\/\/[^"']+)["']/i); + if (iframeMatch && iframeMatch[1]) { + console.log(`[GATEWAY] Extracted embed URL: ${iframeMatch[1]}`); + requestUrl = iframeMatch[1]; + } + } + } catch (e) { + console.warn(`[GATEWAY] Embed extraction failed:`, e.message); + } + } + + if (requestUrl && (requestUrl.includes('rsteches.com') || requestUrl.includes('cashier-page'))) { + try { + console.log(`[GATEWAY] Handling rsteches cashier: ${requestUrl}`); + const pageRes = await fetch(requestUrl, { + headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } + }); + if (pageRes.ok) { + const pageHtml = await pageRes.text(); + const upiMatch = pageHtml.match(/["'](upi:\/\/pay\?[^"']+)["']/i); + if (upiMatch && upiMatch[1]) { + console.log(`[GATEWAY] Extracted UPI from rsteches: ${upiMatch[1]}`); + requestUrl = upiMatch[1]; + } + } + } catch (e) { + console.warn(`[GATEWAY] rsteches parsing failed:`, e.message); + } + } + const parsedUrl = new URL(requestUrl); const gatewayHost = parsedUrl.host; const isDirectUpi = parsedUrl.searchParams.has('pa') || requestUrl.startsWith('upi://'); [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.