zedeus / nitter

Alternative Twitter front-end
https://nitter.net
GNU Affero General Public License v3.0
10.14k stars 536 forks source link

Nitter.net images not embedding on Discord #804

Open net-tech opened 1 year ago

net-tech commented 1 year ago

Hi there,

I'm having a strange issue on Discord when trying to use a Nitter Image URL such as https://nitter.net/pic/media%2FFqfM3xIXoAINbKM.jpg in a Embed. The image will not appear however any other image jpg from the web works just fine: Nitter Image Test

CleanShot 2023-03-05 at 23 36 03@2x

A random JPG from Wikipedia

CleanShot 2023-03-05 at 23 36 12@2x

I asked in a development server on Discord and was told

that host may have some sort of hotlink protection or something that prevents the image from being loaded from another host just tried it and it also won't embed, so its an issue with the image or the image host

So I'm just opening this to ask whether that is the case. Thanks.

zedeus commented 1 year ago

No idea why this is, another host (nitter.nl) with no unnecessary security headers also won't embed.

net-tech commented 1 year ago

I've made my bot upload Nitter's image to imgur for now and embed that.

net-tech commented 1 year ago

As of today, Discord released an Embed Debug tool. Custom instance embeds work fine, however, when debugging why nitter.net images still won't embed using the debug tool, I got this reason from the debugger @zedeus

CleanShot 2023-08-11 at 22 48 50@2x
zedeus commented 1 year ago

I guess it's probably due to the IP address/range being blocked by my extensive cloud blocking rules. Any idea which IP(s) they might use to pull embeds?

net-tech commented 1 year ago

I guess it's probably due to the IP address/range being blocked by my extensive cloud-blocking rules. Any idea which IP(s) they might use to pull embeds?

Not sure which exact ones. All I know is they use Google Cloud and Cloudflare as far as their infrastructure goes.

zedeus commented 1 year ago

That's tricky, I don't want to unban GCP ranges because of all the abuse that comes from them, not sure what to do about this.

net-tech commented 1 year ago

That's tricky, I don't want to unban GCP ranges because of all the abuse that comes from them, not sure what to do about this.

If you're talking about DDoS attacks, it might be useful to put nitter.net behind CloudFlare too. If it's something else, you could report it to GCP via their Abuse Report Form. However, I understand how this could be tedious. I guess we could keep this issue open and pin it in that case.

flaviut commented 1 year ago

Can you configure your firewall to do a reverse DNS lookup on the connecting address?

In my quick testing, I saw discord crawling from 35.227.62.178 and 35.196.132.85 with UA Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com).

dig -x 35.227.62.178 comes up with crawl-35-227-62-178.ptr.discord.com, dig -x 35.196.132.85 comes up with crawl-35-196-132-85.ptr.discord.com.

DarkDoccieDutch commented 7 months ago

Is there any follow up or fix on this subject?