-
|
I couldn't find any endpoint wrapper for Retrieving Media (Direct Messages) Is there a way to get the media using this library or do we need to build this part on our own? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
alkihis
Mar 6, 2022
Replies: 1 comment
-
|
Yep, no wrapper exists for You can download them using the lib, with a little trick it should work. // login with OAuth1.0a
const client = new TwitterApi({ appKey: '', appSecret: '', accessToken: '', accessSecret: '' })
// Get your dms
// ...
// Download a media protected by OAuth
const imgRaw = await client.get<string>(dm.media_url_https, undefined, { prefix: '' })
const imgAsBuffer = Buffer.from(imgRaw)
// use/save imgAsBufferTell me if it works :) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
thesrs02
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yep, no wrapper exists for
ton.twitter.com, you're right!You can download them using the lib, with a little trick it should work.
This isn't optimal, but I welcome it as a feature request!
Tell me if it works :)