diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index e9728f96..daf52fb2 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -377,7 +377,7 @@ EOD; if($data === null || !is_array($data) || count($data) != 1) { $twitterPage = getContents('https://twitter.com'); - $jsMainRegex = '/(https:\/\/abs\.twimg\.com\/responsive-web\/web\/main\.[^\.]+\.js)/m'; + $jsMainRegex = '/(https:\/\/abs\.twimg\.com\/responsive-web\/web_legacy\/main\.[^\.]+\.js)/m'; preg_match_all($jsMainRegex, $twitterPage, $jsMainMatches, PREG_SET_ORDER, 0); $jsLink = $jsMainMatches[0][0]; @@ -420,6 +420,8 @@ EOD; $guestTokenRegex = '/gt=([0-9]*)/m'; preg_match_all($guestTokenRegex, $pageContent['header'], $guestTokenMatches, PREG_SET_ORDER, 0); + if (!$guestTokenMatches) + preg_match_all($guestTokenRegex, $pageContent['content'], $guestTokenMatches, PREG_SET_ORDER, 0); if (!$guestTokenMatches) returnServerError('Could not parse guest token'); $guestToken = $guestTokenMatches[0][1]; return $guestToken;