@vitalets/google-translate-api
Version:
A free and unlimited API for Google Translate
7 lines (6 loc) • 302 B
text/typescript
export function extractTooManyRequestsInfo(html: string | undefined) {
const ip = html?.match(/IP address: (.+?)<br>/)?.[1] || '';
const time = html?.match(/Time: (.+?)<br>/)?.[1] || '';
const url = (html?.match(/URL: (.+?)<br>/)?.[1] || '').replace(/&/g, '&');
return { ip, time, url };
}