-
Notifications
You must be signed in to change notification settings - Fork 4
Hidden Tweets
Doğan Çelik edited this page May 25, 2024
·
2 revisions
twdl by default uses Puppeteer (Chromium) to fetch tweets.
If you want Twdl to download restricted/protected content, you need to pass cookies to Twdl.
You can pass cookies in two ways:
-
Recommended: Using
TWDL_COOKIE
environment variable (supports file paths and JSON arrays). - Passing
-k
(cookie) argument
Because cookie is a long value, I recommend that you use the environment variable method.
- First, you need to install a Cookie extension to export Twitter cookies. I use Cookie-Editor.
- After installing it, you need to export Twitter cookies as JSON and save them to a file (e.g.
C:\twitter_cookie.json
).
The only necessary cookie entry in the exported JSON array is the object with"name": "auth_token"
So you can delete the rest of the object if you wish. - After saving the file, we set
TWDL_COOKIE
environment variable to use this JSON file. - Now Twdl will load this cookie file in Puppeteer and you will be able to see restricted tweets.
set TWDL_COOKIE=C:\twitter_cookie.json
twdl [tweet url]
⚠⚠⚠ This is deprecated, ignore this section below.
Warning: If you are using a Batch file to set the environment variable,
you need to escape %
as %%
, otherwise it will NOT work.
To get your Twitter cookies, go to twitter.com
, press F12 or Ctrl + Shift + K (Firefox), go to console and type:
copy(document.cookie);
The command will copy your cookies to your clipboard.