RSSHub icon indicating copy to clipboard operation
RSSHub copied to clipboard

Twitter 403 forbidden

Open K33k0 opened this issue 1 year ago • 1 comments

Routes

/twitter/media/:id/:routeParams?
/twitter/user/:id/:routeParams?

Full routes

/twitter/user/elonmusk
/twitter/media/elonmusk

Related documentation

https://docs.rsshub.app/deploy/config#twitter

What is expected?

To either pull the media, or the feed for the user.

What is actually happening?

Returning a 403 forbidden error

Deployment information

Self-hosted

Deployment information (for self-hosted)

OS: Linux, Docker Image: Latest

Additional info

This is the error I receive
: [GET] "https://x.com/i/api/graphql/k5XapwcSikNsEsILW5FvgA/UserByScreenName?features=%7B%22hidden_profile_likes_enabled%22%3Atrue%2C%22hidden_profile_subscriptions_enabled%22%3Atrue%2C%22responsive_web_graphql_exclude_directive_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Afalse%2C%22subscriptions_verification_info_is_identity_verified_enabled%22%3Atrue%2C%22subscriptions_verification_info_verified_since_enabled%22%3Atrue%2C%22highlights_tweets_tab_ui_enabled%22%3Atrue%2C%22responsive_web_twitter_article_notes_tab_enabled%22%3Atrue%2C%22creator_subscriptions_tweet_preview_api_enabled%22%3Atrue%2C%22responsive_web_graphql_skip_user_profile_image_extensions_enabled%22%3Afalse%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%7D&fieldToggles=%7B%22withAuxiliaryUserLabels%22%3Afalse%7D&variables=%7B%22screen_name%22%3A%22elonmusk%22%2C%22withSafetyModeUserFields%22%3Atrue%7D": 403 Forbidden

I have these related env variables configured.
``` yaml
TWITTER_COOKIE: 'auth_token=<redacted>; ct0=<redacted>'
TWITTER_USERNAME: [email protected]
TWITTER_PASSWORD: this@is@password


### This is not a duplicated issue

- [X] I have searched [existing issues](https://github.com/DIYgod/RSSHub/issues) to ensure this bug has not already been reported

K33k0 avatar Jun 27 '24 14:06 K33k0

Searching for maintainers:
  • /twitter/media/:id/:routeParams?: @DIYgod @yindaheng98 @Rongronggg9
  • /twitter/user/:id/:routeParams?: @DIYgod @yindaheng98 @Rongronggg9

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake. 如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。

github-actions[bot] avatar Jun 27 '24 14:06 github-actions[bot]

same problem, is there any solution?

hst-Sunday avatar Aug 02 '24 15:08 hst-Sunday

The cookie variable changed. It should be TWITTER_AUTH_TOKEN='<redacted>'.

flameleaf avatar Aug 03 '24 01:08 flameleaf

Yep, that did it. thanks @flameleaf

K33k0 avatar Aug 12 '24 19:08 K33k0