twitter-video-downloader-extension icon indicating copy to clipboard operation
twitter-video-downloader-extension copied to clipboard

Button is gone

Open solserer-labs opened this issue 2 years ago • 8 comments

Seems that twitter updated their css/layout or something and now the button is gone.

Any chance for any update?

solserer-labs avatar Dec 22 '22 11:12 solserer-labs

Hi @solserer-labs,

Twitter api url has changed. Update here https://github.com/mstfsnc/twitter-video-downloader-extension/commit/b3bbc6fe399ae6cb8e49cedc59c9325fffefd447

mstfsnc avatar Dec 22 '22 21:12 mstfsnc

Hello, I've been using your extension as a guide to try to write a simple tweet request. It is way over my knowledge but I could get the json for a tweet by id without authentification with this request :

https://twitter.com/i/api/2/timeline/conversation/${id}.json?tweet_mode=extended

could you help me to rewrite this with the new url type or head me in the right direction ?

function FetchPost (  id, headers = {} ) 
{
	let url = `https://twitter.com/i/api/2/timeline/conversation/${id}.json?tweet_mode=extended`
	return fetch ( url, { credentials: "include", headers: new Headers(headers), } )
	.then ((response) => response.json())
}

gpuido avatar Dec 27 '22 19:12 gpuido

Hi @gpuido,

There is no way to request api without authentication. In the old version, I was using some headers while trying to make a request to the api.

mstfsnc avatar Dec 27 '22 21:12 mstfsnc

Thank you for the help @mstfsnc,

Oh, i think I understand how you do it the new version ! very smart !!

You don't do the request yourself, but you intercept the response request made by twitter.com to twitter api ?

you analyse every XMLHttpRequest in xhr.js and callback your code with the obj when url match api.twitter.com.

This is beautifull code. Do I understand right ?

gpuido avatar Dec 28 '22 13:12 gpuido

Thank you for the help @mstfsnc,

Oh, i think I understand how you do it the new version ! very smart !!

You don't do the request yourself, but you intercept the response request made by twitter.com to twitter api ?

you analyse every XMLHttpRequest in xhr.js and callback your code with the obj when url match api.twitter.com.

This is beautifull code. Do I understand right ?

Yes, absolutely right.

mstfsnc avatar Dec 29 '22 19:12 mstfsnc

Thank you very much for sharing @mstfsnc. 🙏

gpuido avatar Dec 30 '22 10:12 gpuido

One idea I use in many of my tools, you might find interesting is ::

when the user click the download button, IF some text is selected, the extension use the selected text ( filter window.getSelection().toString() ) to define the filename to save ( "Pelé's bicycle kick against the Miami Toros in 1976.mp4" )

I find it very usefull to quickly give a not too long and meaningful file name without typing.

image

gpuido avatar Dec 30 '22 10:12 gpuido

Button has disappeared again, probably due twitter's API

lordhater1 avatar Mar 17 '23 21:03 lordhater1