Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile icons from X are no longer retrieved #2717

Open
chitoku-k opened this issue Oct 31, 2024 · 0 comments
Open

Profile icons from X are no longer retrieved #2717

chitoku-k opened this issue Oct 31, 2024 · 0 comments

Comments

@chitoku-k
Copy link
Owner

It seems that the X-Client-Transaction-Id header has been made required at some point.

Potentially helpful resources:

One of a few attempts I made:

diff --git a/api/src/Service/Profile/XProfileService.php b/api/src/Service/Profile/XProfileService.php
index 74b7520..e89b5fe 100644
--- a/api/src/Service/Profile/XProfileService.php
+++ b/api/src/Service/Profile/XProfileService.php
@@ -15,7 +15,7 @@ class XProfileService implements ProfileServiceContract
 {
     public const int CACHE_EXPIRE = 180;
 
-    public const string X_API_GRAPHQL_ROOT = 'https://x.com/i/api/graphql/sLVLhk0bGj3MVFEKTdax1w/';
+    public const string X_API_GRAPHQL_ROOT = 'https://api.x.com/graphql';
     public const string TOKEN = 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA';
 
     protected ?string $guestToken = null;
@@ -92,12 +92,20 @@ class XProfileService implements ProfileServiceContract
                 ]));
                 $features = urlencode(json_encode([
                     'blue_business_profile_image_shape_enabled' => true,
+                    'creator_subscriptions_tweet_preview_api_enabled' => true,
+                    'hidden_profile_subscriptions_enabled' => true,
+                    'highlights_tweets_tab_ui_enabled' => true,
                     'responsive_web_graphql_exclude_directive_enabled' => true,
                     'responsive_web_graphql_skip_user_profile_image_extensions_enabled' => true,
                     'responsive_web_graphql_timeline_navigation_enabled' => true,
+                    'responsive_web_twitter_article_notes_tab_enabled' => true,
+                    'rweb_tipjar_consumption_enabled' => true,
+                    'subscriptions_feature_can_gift_premium' => true,
+                    'subscriptions_verification_info_is_identity_verified_enable' => true,
+                    'subscriptions_verification_info_verified_since_enabled' => true,
                     'verified_phone_label_enabled' => true,
                 ]));
-                $target = static::X_API_GRAPHQL_ROOT . "UserByScreenName?variables={$variables}&features={$features}";
+                $target = static::X_API_GRAPHQL_ROOT . "/BQ6xjFU6Mgm-WhEP3OiT9w/UserByScreenName?variables={$variables}&features={$features}";
                 $response = yield $this->client->getAsync($target, [
                     'headers' => $headers,
                 ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant