Add search/mentions commands and fix cookie decryption
- Added `search <query>` command to search tweets - Added `mentions` command to find @clawdbot mentions - Fixed Chrome cookie decryption to extract hex values correctly - Added SearchTimeline query ID (may need updating as Twitter rotates these) Note: Search endpoints may return 404 if query IDs are outdated
This commit is contained in:
+9
-1
@@ -79,7 +79,15 @@ function decryptCookieValue(encryptedHex: string): string | null {
|
||||
let decrypted = decipher.update(encryptedData);
|
||||
decrypted = Buffer.concat([decrypted, decipher.final()]);
|
||||
|
||||
return decrypted.toString('utf8');
|
||||
// Chrome v10 cookies have key material prepended before the actual value
|
||||
// Twitter cookies are hex strings, so extract the longest hex sequence
|
||||
const decryptedStr = decrypted.toString('utf8');
|
||||
const hexMatch = decryptedStr.match(/[a-f0-9]{32,}/i);
|
||||
if (hexMatch) {
|
||||
return hexMatch[0];
|
||||
}
|
||||
// Fallback: keep only printable ASCII characters
|
||||
return decryptedStr.replace(/[^\x20-\x7E]/g, '');
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user