Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Danbooru is banned in some countries so chainging Shima, Saitou, Safebooru and Kagamihara base url back also made these sites useless in banned countries too. #4780

Closed
Qappashiro opened this issue Mar 29, 2021 · 2 comments
Labels
Important Infrastructure Site operational or infrastructural concerns

Comments

@Qappashiro
Copy link

Is it possible to use the same url of other proxy links of danbooru like in old days? main danbooru adress like https://danbooru/ donmai us/ is banned in a third world country like mine so all the images cant load at all in this case. but if the link is like https://shima.donmai.us/data .... then there was no problem at all. its same for "kagamihara" and "saitou" proxies too. would be awesome at least one of them is not using main danbooru.donmai,us link so that site is still accessible for countries who banned danbooru in the first place.

it used to be like https://shima.donmai.us/data/sample/8f/98/… when u were using https://shimadonmai.us/
i mean by banned banned in some countries like mine
but shima or other kagamihara or saitou or other domains are not banned so hope at least one of these uses same url as base link so that i dont have to use vpn all time.

Example: https://shima.donmai.us/posts/4440522 is not vissible as you can see in the screenshot:

https://media.discordapp.net/attachments/710192137878241372/823166285680345088/Untitled.png

because the site is using https://danbooru.donmai.us/data/original/30/44/__original_drawn_by_richard_ri39p__304474a3fa45ba2e4d21c6a98ba8763a.png

and not https://shima.donmai.us/data/original/30/44/__original_drawn_by_richard_ri39p__304474a3fa45ba2e4d21c6a98ba8763a.png

anymore. At least please make one of those shima, saito or other domains are accessible for people who are living in third world countries and where danbooru is banned so that we can use the site like in old days without using VPN. Changing DNS to 1.1.1.1 also not working either too so public DNS are out of question.

"danbooru.donmai.us
Server: UnKnown
Address: 192.168.1.1

Non-authoritative answer:
Name: danbooru.donmai.us
Addresses: 2606:4700:20::681a:a27
2606:4700:20::681a:b27
2606:4700:20::ac43:4663
195.175.254.2


shima.donmai.us
Server: UnKnown
Address: 192.168.1.1

Non-authoritative answer:
Name: shima.donmai.us
Addresses: 2606:4700:20::681a:a27
2606:4700:20::ac43:4663
2606:4700:20::681a:b27
104.26.10.39
104.26.11.39
172.67.70.99"

even if you use the DNS its same:

Default Server: one.one.one.one
Address: 1.1.1.1

danbooru.donmai.us
Server: one.one.one.one
Address: 1.1.1.1

Non-authoritative answer:
Name: danbooru.donmai.us
Addresses: 2606:4700:20::ac43:4663
2606:4700:20::681a:b27
2606:4700:20::681a:a27
172.67.70.99
104.26.10.39
104.26.11.39

shima.donmai.us
Server: one.one.one.one
Address: 1.1.1.1

Non-authoritative answer:
Name: shima.donmai.us
Addresses: 2606:4700:20::681a:b27
2606:4700:20::681a:a27
2606:4700:20::ac43:4663
172.67.70.99
104.26.10.39
104.26.11.39

and you get this error https://media.discordapp.net/attachments/710192137878241372/823207221528887317/unknown.png?width=1618&height=910

In short: problem is two-fold; the dns poisoning is one part, but the other is that the local cloudflare node doesn't want to serve the site; so I'^d have to somehow manipulate anycast to get a connection to a different CF node which i'm not sure is possible.

@luni3359 luni3359 added Important Infrastructure Site operational or infrastructural concerns labels Mar 29, 2021
@bipface
Copy link
Contributor

bipface commented Apr 2, 2021

i prepared a simple workaround in the form of a webextension;
it just redirects every request from danbooru.donmai.us to cdn.donmai.us

manifest.json:

{
	"description" : "Redirects all danbooru.donmai.us requests to cdn.donmai.us.",
	"manifest_version" : 2,
	"name" : "CdnBooru Request Rewriter",
	"version" : "2021.4.2",
	"homepage_url" : "https://github.com/danbooru/danbooru/issues/4780",

	"browser_specific_settings" : {
		"gecko" : {
			"id" : "cdnbooru-request-rewriter@donmai.us"}},

	"permissions" : [
		"webRequest",
		"webRequestBlocking",
		"*://*.donmai.us/*"],
	
	"background" : {
		"scripts" : ["background.js"]}
}

background.js:

'use strict';

const webextApi = (
	typeof browser !== `undefined` ? browser :
	typeof chrome !== `undefined` ? chrome :
	undefined);

if (webextApi !== undefined) {
	webextApi.webRequest.onBeforeRequest.addListener(
		onBeforeRequ, {urls : ['*://danbooru.donmai.us/*']}, [`blocking`]);
} else {
	console.log(`can't find browser api - listener not installed`);};

function onBeforeRequ({url : originalHref, method}) {
	/* redirect all danbooru.donmai.us requests to cdn.donmai.us: */
	let url = new URL(originalHref);
	url.hostname = `cdn.donmai.us`;
	console.log(`rewrote request "${originalHref}" → "${url.href}"`);
	return {redirectUrl : url.href};
};

@evazion
Copy link
Member

evazion commented Sep 1, 2021

All images are now served from cdn.donmai.us so this should work as long as that domain isn't blocked.

@evazion evazion closed this as completed Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Important Infrastructure Site operational or infrastructural concerns
Projects
None yet
Development

No branches or pull requests

4 participants