python-twitter
python-twitter copied to clipboard
twitter.error.TwitterError: [{'code': 34, 'message': 'Sorry, that page does not exist.'}]
Whenever I make a request with the api to fetch Direct Messages api.GetDirectMessages(), it always throws me a twittererror with the message "Sorry, that page does not exist."
Traceback:
Traceback (most recent call last):
File "C:/Users/neela/Desktop/Programs/python projects/Mine/DM Storage/login.py", line 13, in <module>
logging.info(api.GetDirectMessages())
File "C:\Program Files\Python36\lib\site-packages\twitter\api.py", line 2937, in GetDirectMessages
data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
File "C:\Program Files\Python36\lib\site-packages\twitter\api.py", line 4908, in _ParseAndCheckTwitter
self._CheckForTwitterError(data)
File "C:\Program Files\Python36\lib\site-packages\twitter\api.py", line 4928, in _CheckForTwitterError
raise TwitterError(data['errors'])
twitter.error.TwitterError: [{'code': 34, 'message': 'Sorry, that page does not exist.'}]
I tried looking through #592 , but it was closed at Nov. 2018, and the new endpoints should have been implemented. There have been four months since the closure, and how has there not been enough time to update the API endpoints?
+1 have this problem
Honestly if I knew how a token was received and then requested to the API I could send a push request to fix it.
From: Eric Semeniuc [email protected] Sent: Tuesday, February 12, 2019 7:18 PM To: bear/python-twitter [email protected] Cc: PokestarFan [email protected]; Author [email protected] Subject: Re: [bear/python-twitter] twitter.error.TwitterError: [{'code': 34, 'message': 'Sorry, that page does not exist.'}] (#603)
+1 have this problem
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bear/python-twitter/issues/603#issuecomment-462999286 , or mute the thread https://github.com/notifications/unsubscribe-auth/ANSYJzAcOs2a_qH9R0eRvY1MXPRJVOLEks5vM1m2gaJpZM4af7zf . https://github.com/notifications/beacon/ANSYJxXycUJo_2EYaizlJqMN2dfwUxEDks5vM1m2gaJpZM4af7zf.gif
This email has been checked for viruses by AVG. https://www.avg.com
here's a quick hack to be able to use json: https://github.com/TrustedCapsules/python-twitter/commit/e0c90859e136a833d5bf7264438718f1b0cf85c2
The DirectMessage class needs to be updated (see https://github.com/TrustedCapsules/python-twitter/blob/e0c90859e136a833d5bf7264438718f1b0cf85c2/twitter/models.py#L180)
Hi, I tried the fix and it didn't work, I just get the following:
Traceback (most recent call last):
File "[path_removed]/tweeting.py", line 13, in
@theelk801 You must use the return_json flag since the model hasnt been updated. Then you can manually manipulate the dict
Oh, I see. Alright, I suppose that'll have to do for now. Thanks!
For anyone confused on how to implement the flag, it is api.GetDirectMessages(return_json=True) where api is the TwitterApi instance
I'm getting the same error 34 when trying to get DMs from an authorized App, even when I'm using the return_json parameter. :-/
I am still having the same error in accessing DMs and neither the return_json parameter nor that quick hack fix work :/
Hi guys, the Error is caused by the old version of pip package, in the pip version the function GetDirectMessages uses an old URL, you can change that for the new url. Step 1: find api.py file run pip show python-twitter and see the path
Step 2: find the old url in api.py, line 2922
Step 3: change that line with url = '%s/direct_messages/events/list.json' % self.base_url
@DVRodri8 So you mean update the package?
Is there any kind of ETA or planning on getting this in the project?
Hi guys, the Error is caused by the old version of pip package, in the pip version the function GetDirectMessages uses an old URL, you can change that for the new url. Step 1: find api.py file run pip show python-twitter and see the path
Step 2: find the old url in api.py, line 2922
Step 3: change that line with url = '%s/direct_messages/events/list.json' % self.base_url
This plus return_json=True made it work for me
Hi guys, the Error is caused by the old version of pip package, in the pip version the function GetDirectMessages uses an old URL, you can change that for the new url. Step 1: find api.py file run pip show python-twitter and see the path Step 2: find the old url in api.py, line 2922 Step 3: change that line with url = '%s/direct_messages/events/list.json' % self.base_url
This plus
return_json=Truemade it work for me
Can you specify this?
For anyone confused on how to implement the flag, it is
api.GetDirectMessages(return_json=True)where api is the TwitterApi instance
@chrischma
{"errors":[{"code":34,"message":"Sorry, that page does not exist."}]}