-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from URenko/dev
v0.5.0
- Loading branch information
Showing
11 changed files
with
220 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,3 +106,4 @@ venv.bak/ | |
python/ | ||
CERT/ | ||
hosts | ||
*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[accounts.pixiv.net] | ||
"pixivAccount.captchaType":"KCaptcha" = "pixivAccount.captchaType":"ReCaptcha" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
var domains = { | ||
"steamcommunity.com": 1, | ||
"pixiv.net": 1, | ||
"tumblr.com": 1, | ||
"tumblr.co": 1, | ||
"google.com": 1, | ||
"recaptcha.net": 1, | ||
"instagram.com": 1, | ||
"quora.com": 1 | ||
}; | ||
|
||
var shexps = { | ||
"*://zh.wikipedia.org/*": 1, | ||
"*://ja.wikipedia.org/*": 1, | ||
"*://steamcommunity-a.akamaihd.net/*": 1, | ||
"*://steamuserimages-a.akamaihd.net/*": 1 | ||
}; | ||
|
||
var proxy = "PROXY 127.0.0.1:7654;"; | ||
|
||
var direct = 'DIRECT;'; | ||
|
||
var hasOwnProperty = Object.hasOwnProperty; | ||
|
||
function shExpMatchs(str, shexps) { | ||
for (shexp in shexps) { | ||
if (shExpMatch(str, shexp)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
function FindProxyForURL(url, host) { | ||
var suffix; | ||
var pos = host.lastIndexOf('.'); | ||
pos = host.lastIndexOf('.', pos - 1); | ||
while(1) { | ||
if (pos <= 0) { | ||
if (hasOwnProperty.call(domains, host)) { | ||
return proxy; | ||
} else if (shExpMatchs(url, shexps)) { | ||
return proxy; | ||
} else { | ||
return direct; | ||
} | ||
} | ||
suffix = host.substring(pos + 1); | ||
if (hasOwnProperty.call(domains, suffix)) { | ||
return proxy; | ||
} | ||
pos = host.lastIndexOf('.', pos - 1); | ||
} | ||
} |
Oops, something went wrong.