I've downloaded all my old tweets, but I'm still not sure on how to get my old direct messages back. Can someone please tell me how to do that?
I am not sure what you mean by "get back" your direct messages. Like Zedinc pointed it, the DMs are not part of your archive (because I guess it would require to contain tweets from other people of your conversations to make sense).
If there are not deleted and you just would like to download them to keep them offline, there are two ways to do this:
- Use the Twitter API and deal with its limitations: only the latest 200 direct messages can be retrieved.
- Use a tool to simulate the browsing of a conversation and parse the result.
Maybe I can help you with the second idea. I have created a tool (https://github.com/Mincka/DMArchiver) to download my direct messages, with the ability to also download the uploaded images and GIFs (as MP4).
Because it does not rely on the API, it is possible to download more than 200 messages. The script just simulate the "scrolling method" and parse the result.
The main idea is to make requests in loop by calling the following URL with a valid
auth_token cookie value for the authentication and parse the json response:
max_entry_id value is not required for the first request. You need to use the value of the
min_entry_id variable in the response as the new
max_entry_id in each subsequent iteration to get the next 20 older tweets. When
max_entry_id is not in the json response, you are at the begin of the thread.