Twitter Video Download

Adds a button to download video from a tweet

< Opiniones de Twitter Video Download

Puntuación: Bueno; el script funciona tal y como promete

§
Publicado: 05/08/2024

Why do you need to refresh the page in Firefox using Ctrl+F5 for the button to appear?

I spent a lot of time just to understand that the script actually works. Then I spent even more time trying to find the problem.

On my PC, I can only access Twitter through a VPN extension, so I thought the issue might be related to that. I checked different extensions and downloaded a clean portable version of Firefox - the result was the same. Without refreshing with Ctrl+F5, the button doesn't appear. I was confused that in private mode, where I am obviously not logged in, the button appears. I logged out of my account in the regular window - it started appearing there too.

I thought: The problem is with the VPN extensions. I opened the only other browser, Edge, and everything works there.

I thought: The problem is with Firefox. I downloaded and opened Tor, logged into Twitter - the button appears.

Again, I thought: The problem is simultaneously with Firefox and the VPN extensions. I started looking for where exactly the problem arises.

I know nothing about writing scripts, so I asked ChatGPT to rewrite the script to log the code in case of an error. Here’s the rewritten script:

https://pastebin.com/aHqkAN2Q

In the console, this repeats:

Error: React component not found. 3 Twitter Video Download.user.js:49:13

If I refresh with Ctrl+F5, the script does not log any errors.

I asked ChatGPT to compare two logs of the page with the script working correctly with two where it did not work. Here’s what seemed most suspicious:

Content-Security-Policy (CSP): In the logs 2.x, additional messages about blocking inline scripts are added, which may indicate stricter security settings compared to 1.x.

I followed some of ChatGPT's recommendations to solve the problem - it didn’t help. I asked it to rewrite the script to make it work - it didn’t work.

I got frustrated and went to write a review, and only then did I check the responses to previous reviews. For some reason, I hadn’t noticed that there were discussions there before; this is the first time I’m writing something on this site. Also, the last couple of reviews were positive, so I intuitively assumed that the negative review was due to changes on the site. That’s when I saw that in Firefox, it may indeed require Ctrl+F5.

Actually, I assume that without a VPN, the script should work fine in Firefox; otherwise, I think there would be more negative reviews. Although, maybe I’m overestimating Firefox's popularity. Unfortunately, I can’t check it myself.

Question: What exactly is the problem with Firefox? Can I at least make the script work properly from my side? Download some extension that allows Twitter to load any scripts, or something else?

And could you please add a note about the possibility of issues with Firefox in the description? That would save me a lot of time.

This is still the most convenient script I’ve found, without a bunch of unnecessary clicks, redirects to third-party sites, and heavy moral choices: do I want to download 720p or 360p? Plus, with the ability to choose where to download each file. It’s even more frustrating that its convenience is marred by the need to manually press Ctrl+F5 for each of the ten open tabs.

But, in any case, thank you for the script. Even so, it’s much more convenient than the alternatives.

naileDAutor
§
Publicado: 05/08/2024

I knew about the Firefox issue but I couldn't find a solution for years lol (no, it wasn't related to CSP, but to Firefox sandbox)
Well, I had another go at it today, and I think I finally got it to work. Try updating and see if you still need the Ctrl+F5 in Firefox.

§
Publicado: 05/08/2024

Unfortunately, it still doesn't work.

Does Firefox use any special security measures if you're logged in to a site? And why does it work with Ctrl+F5 then?

naileDAutor
§
Publicado: 05/08/2024

Hmm. Are you sure you updated the script? Do you get some error in the console? It works fine for me on the latest Firefox and Tampermonkey now, without Ctrl+F5. Try removing the script and adding it again.

I can't really explain why Ctrl+F5 worked. I guess it's got something to do with script caching, or temporary disabling of sandbox.

§
Publicado: 06/08/2024

I had a text here where I suggested that the problem might be with the VPN and attached logs showing errors even without the script enabled, but I had to delete it because during the testing process, here's what happened:

  • Updated the script: Doesn't work.
  • Deleted and reinstalled the script: Doesn't work.
  • Opened Firefox Portable where Tampermonkey is installed instead of Violentmonkey and repeated everything described above: Doesn't work.
  • Went into settings and deleted all cookies and site data: Doesn't work.
  • Changed Twitter's language from my native one to English: Works.
  • Changed to German: Works.
  • Changed back to my native language: Works.
  • Tried checking through Violentmonkey: Doesn't work.
  • Opened my main Firefox with my native language and tried Tampermonkey: Works.immediately, even without switching to English.

It seems that the new version is indeed functional, at least only in Tampermonkey. I had previously performed all the procedures of changing the language, theme, and any other settings, but it didn't help. Neither in Tampermonkey nor in Violentmonkey.

I just can't understand why it only started working after changing the language; I updated, completely reinstalled the script, and cleared all cookies.

I tried to check what settings Violentmonkey and the script have, experimented with different values, but it didn't help. The only thing I discovered is that when changing the language in Twitter within this open tab, the button appears. New tabs don't create it. As I understand it, changing the language simply refreshes the page like Ctrl+F5, and for some reason, the Portable version didn't clear all the cache. If I hadn't changed the language and just restarted the page with Ctrl+F5, it would probably have started working too.

It's good that at least it works fine in Tampermonkey now. It didn't work in Tampermonkey before. For now, I'll just sit and test.

I'll be completely honest: I'm so lazy to transfer all the dozens of scripts from one extension to another. Of course, I could have both extensions running simultaneously, but that's not as elegant and aesthetically pleasing.

But seriously, what could be the problem with Violentmonkey?

naileDAutor
§
Publicado: 06/08/2024

Update and try now.

§
Publicado: 06/08/2024

Now it works.

naileDAutor
§
Publicado: 06/08/2024

Great. Let's hope it takes a while before something breaks again hehe

It's all just workarounds to a bug in Firefox. Tampermonkey and Violentmonkey have different ways in how they handle it.

Publicar respuesta

Inicia sesión para responder.