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

forbidden 403 #87

Closed
Ellinach opened this issue May 4, 2024 · 1 comment
Closed

forbidden 403 #87

Ellinach opened this issue May 4, 2024 · 1 comment

Comments

@Ellinach
Copy link

Ellinach commented May 4, 2024

It gives me this error when i tried to retrieve data from twitter '
"bidden Traceback (most recent call last)
Cell In[20], line 1
----> 1 tweets = scraper.get_user_tweets('usa','Tweets')
2 tweets

File ~\anaconda3\Anacond\New folder\Lib\site-packages\twikit\client.py:1761, in Client.get_user_tweets(self, user_id, tweet_type, count, cursor)
1750 params = flatten_params({
1751 'variables': variables,
1752 'features': FEATURES
1753 })
1754 endpoint = {
1755 'Tweets': Endpoint.USER_TWEETS,
1756 'Replies': Endpoint.USER_TWEETS_AND_REPLIES,
1757 'Media': Endpoint.USER_MEDIA,
1758 'Likes': Endpoint.USER_LIKES,
1759 }[tweet_type]
-> 1761 response = self.http.get(
1762 endpoint,
1763 params=params,
1764 headers=self.base_headers
1765 ).json()
1767 instructions
= find_dict(response, 'instructions')
1768 if not instructions_:

File ~\anaconda3\Anacond\New folder\Lib\site-packages\twikit\http.py:51, in HTTPClient.get(self, url, **kwargs)
50 def get(self, url, **kwargs) -> httpx.Response:
---> 51 return self.request('GET', url, **kwargs)

File ~\anaconda3\Anacond\New folder\Lib\site-packages\twikit\http.py:36, in HTTPClient.request(self, method, url, **kwargs)
34 raise Unauthorized(message, headers=response.headers)
35 elif status_code == 403:
---> 36 raise Forbidden(message, headers=response.headers)
37 elif status_code == 404:
38 raise NotFound(message, headers=response.headers)

Forbidden: status: 403, message: ""

@d60
Copy link
Owner

d60 commented May 4, 2024

@Ellinach
That error means that the client is not authorised. Are you logged in to your account?

@d60 d60 closed this as completed May 17, 2024
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

2 participants