Use webp
Twitter serves webp's on most media types by simply adding the URL parameter format=webp. Since it is a vastly superior image format to jpeg and file sizes are significantly smaller, nitter should consider serving those for "small" images on tweets.
Simply adding the mentioned parameter here lowers the network usage through images in my feed from ~2.21MiB to ~852KiB https://github.com/zedeus/nitter/blob/5f31e86e0e8578377fa7d5aeb9631bbb2d35ef1e/src/views/tweet.nim#L64
Note that this isn't a portable solution since not all browsers, notably Safari, doesn't support webp unconditionally.
Good idea, thank you for the suggestion!
webp already old format. Need to use avif at least
Hopefully this will fix the problem I have with Cloudflare redirecting all the videos on my instance to https://www.cloudflare-terms-of-service-abuse.com/stream.mp4 Apparently more than 50% of the requests are media which is why cloudflare is trying to block them. For now I am using a different service.
This probably won't help you with videos but lower your overall bandwidth usage.
@HookedBehemoth I'm not a Safari user myself but according to caniuse.com webp should work. Apparently version 16.0 of Safari released on Sep 12 2022 introduced full support.
https://github.com/zedeus/nitter/commit/cd163b26a3f6c2751276475072406b397d8355c5
This breaks macOS Catalina Safari 15 which cannot display webp.
I see we are allowed to leave erroneous data and just claim it is 'vastly superior' these days?
Webp is a proprietary image format.
Furthermore, it breaks some combinations of browser; and even more, if one is trying to view the highest quality image, webp defaults to using the smallest possible standard, breaking extensions like image max url, either in script or add-on format.
Most importantly of all, webp is a slap in the face to archivists and those working to preserve content.
If anything, as a privacy tool and informative, minimalist and open-source front-end, webp usage should be challenged where possible. I realise one complaint will not challenge this decision, and I know the future of site design is every site using webp and then hundreds of 'free open source frontend providers' wondering why Google is - at best - restricting frontend access to any site hosting webp files.
Please heavily reconsider.
Stand by what I wrote here, but if the behaviour is not working as designed then it's likely some combination of factors on my end. Deprecated.
It's only used for thumbnails/previews, when you click on the images you get the full resolution non-webp image like before.
@zedeus I appreciate the quick response, but that behaviour is not working as described. I do not think it's a nitter issue, unfortunately. Disregard what I wrote prior until I can verify the issue is not limited to nitter. But to clarify -
When clicking images on their own, I should be getting the image served at full resolution, like a non-webp variant..? Blargh.
Time to go hunting for what's causing problems this time; again, I appreciate the quick response.
Edit, @zedeus ; going to stop responding here since I will open a new issue if this persists throughout different browsers and/or I can isolate what might be causing the behaviour. But again, my thanks.
Yes, clicking on a tweet's image should serve the full resolution jpg. If it doesn't that's weird and either a Twitter change or a bug.