├── now.json ├── copying ├── api ├── js.js └── php.php ├── config ├── index.html └── panda.js /now.json: -------------------------------------------------------------------------------- 1 | {"rewrites":[{"source":"/(.*)","destination":"/api/js.js"}]} -------------------------------------------------------------------------------- /copying: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /api/js.js: -------------------------------------------------------------------------------- 1 | /* 2 | --Now.sh|now.json-- 3 | {"rewrites":[{"source":"/(.*)","destination":"/api/js.js"}]} 4 | --Now.sh|now.json-- 5 | */ 6 | module.exports=function(req,res){ 7 | let key=req.url.match(/\/(\w+)\.panda\.user\.js$/i); 8 | let obj=JSON.parse(require('fs').readFileSync(require('path').resolve(__dirname,'..')+'/config','utf-8')); 9 | let txt=obj.monkey.replace(/`func`/g,obj.func).replace(/`node`/g,obj.node).replace(/`ver`/g,obj.ver).replace(/`key`/g,(key?'s.setAttribute(\'exkey\',\''+key[1]+'\');':'')).replace(/`web`/g,obj.node.slice(1,-1).split(',')[0].slice(1,-1)); 10 | res.status(200).send(txt); 11 | } -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | { 2 | "ver":"28", 3 | "node":"['https://expanda.now.sh/','https://ghcdn.rawgit.org/noprogramming/expanda/master/','https://noprogramming.github.io/expanda/']", 4 | "func":"function panda_init(c){if(c>=3){return;};let n=`node`;let t=setTimeout(function(){clearTimeout(t);panda_init(c+1);},3000);let s=document.createElement('script');s.src=(n[c]?n[c]:n[0])+'panda.js?'+parseInt(Date.parse(new Date())/600000)+c;s.onerror=function(){clearTimeout(t);panda_init(c+1);};s.onload=function(){clearTimeout(t);};`key`document.body.appendChild(s);};", 5 | "monkey":"// ==UserScript==\r\n// @name 熊猫书签\r\n// @namespace `web`\r\n// @description zh-cn/\r\n// @license WTFPL\r\n// @version `ver`\r\n// @match `web`\r\n// @match *://exhentai.org/*\r\n// @match *://e-hentai.org/*\r\n// @grant none\r\n// ==/UserScript==\r\n (function(){'use strict';`func`if(document.getElementById('expanda')){document.getElementById('expanda').style.display='';}else{panda_init(0);};})();\r\n", 6 | "origin":"javascript:(function(){`func`panda_init(0);}());" 7 | } 8 | -------------------------------------------------------------------------------- /api/php.php: -------------------------------------------------------------------------------- 1 | server-- 12 | if ($scheme != https) { 13 | rewrite ^(.*)$ https://$server_name$1 permanent; 14 | } 15 | if (!-e $request_filename) { 16 | rewrite ^(.*)$ /api/php.php; 17 | } 18 | --Nginx|host.conf>server-- 19 | */ 20 | preg_match('/\/(\w+)\.panda\.user\.js$/i',$_SERVER['REQUEST_URI'],$key); 21 | $obj=json_decode(file_get_contents('../config'),true); 22 | $txt=str_replace(array('`func`','`node`','`ver`','`key`','`web`'),array($obj['func'],$obj['node'],$obj['ver'],($key?'s.setAttribute(\'exkey\',\''.$key[1].'\');':''),substr(explode(',',substr($obj['node'],1,-1))[0],1,-1)),$obj['monkey']); 23 | header('Content-Type:application/javascript;'); 24 | echo $txt; 25 | ?> 26 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 熊猫书签 10 | 21 | 22 | 23 | 26 |
27 | 油猴 28 | 熊猫书签 29 | 传统 30 |
31 | 32 |
33 | [密钥绑定]
34 |
35 |
36 |
37 | [账号注册]
38 | 注册地址:https://forums.e-hentai.org/?act=Reg
39 | 中国大陆无法访问,需挂载拥有私人IP欧美V:P!И,不能多人共用同IP。
40 | 使用亚洲IP注册的账户,也无法获得里区权限。V:P!И务必选用欧美节点。
41 | 建议用Gmail邮箱注册,使用163、QQ等国内邮箱注册账户无法获得权限。
42 | 注册完成等待一周左右时间,账号应该就能获得里区权限,参照流程登录:
43 | 挂载欧美V:P!И,清空浏览器COOKIE,先登录表站,再访问里站
44 | 如果还出现白屏,多等一周换个欧美V:P!И登录,再不行就是凉了。
45 |
46 |
47 | [密钥提取]
48 | 示例格式:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12345x1e2d3c
49 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaipb_pass_hash
50 | 12345ipb_member_id
51 | x是解析所需的分隔符
52 | 1e2d3cigneous
53 | 使用电脑浏览器,按上节教程登录里站。按下F12,找到COOKIE:
54 | [Edge] Debug-Cookie-exhentai.org
55 | [Chrome] Application-Cookies-exhentai.org
56 | [Firefox] Storage-Cookies-exhentai.org
57 | 复制ipb_pass_hashipb_member_idigneous三个变量。
58 | 按照格式规范组合成密钥,保存好就可以用了。
59 |
60 |
61 | 79 | 97 |
98 | [常见问题]
99 | 这里收集了一些使用E站时常见的错误。
100 | 网络封锁:链接被重置
101 | 直接访问跳转至被墙的表站,请使用熊猫书签。
102 | 无权访问:白屏或“err”
103 | 地域拦截或账号失效,请尝试断开V:P!И访问。
104 | 流量超限:509 Bandwidth Limit Exceeded
105 | 浏览了过多图片,请等待配额恢复或更换IP。
106 |
107 |
108 | ZEIT 109 | GitHub 110 | RawGit 111 |
112 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /panda.js: -------------------------------------------------------------------------------- 1 | var exkey_public='d9a945052c952334dd5d252b0c7388963552014x0745cd567'; 2 | var exkey_private='7a245abd0fa9866ccdfeaf58ff7dd0fd3552014xcc246e753'; 3 | function panda_public(){ 4 | if(document.cookie.match(/ipb_pass_hash=([\da-z]{32})/) && document.cookie.match(/ipb_pass_hash=([\da-z]{32})/)[1]==exkey_public.substr(0,32)){return true;} 5 | return false; 6 | }; 7 | function panda_exkeyset(){ 8 | var exkey=prompt(panda_lang_1,panda.getAttribute('exkey')?panda.getAttribute('exkey'):''); 9 | if(exkey || exkey===''){panda_leapover(exkey);}; 10 | }; 11 | function panda_leapover(exkey){ 12 | if(!exkey){exkey=exkey_public;}; 13 | document.cookie='ipb_member_id='+exkey.split('x')[0].substr(32)+';path=/;domain=.exhentai.org'; 14 | document.cookie='ipb_pass_hash='+exkey.split('x')[0].substr(0,32)+';path=/;domain=.exhentai.org'; 15 | document.cookie='igneous='+(exkey.split('x')[1]?exkey.split('x')[1]:'')+';path=/;domain=.exhentai.org'; 16 | document.cookie='sk=;path=/;domain=.exhentai.org'; 17 | document.cookie='yay=0;path=/;domain=.exhentai.org'; 18 | document.body.innerHTML='Loading...'; 19 | var xhr=new XMLHttpRequest(); 20 | xhr.open('GET','https://exhentai.org',true); 21 | xhr.onerror=function(){if(confirm(panda_lang_0)){panda_leapover(exkey);};}; 22 | xhr.onreadystatechange=function(){if(this.readyState===4 && this.status===200){ 23 | if(!this.responseText.match(//)){panda_exkeyset();return;}; 24 | window.location.href=window.location.href.replace(/favicon.ico$/,''); 25 | }}; 26 | xhr.send(null); 27 | }; 28 | function panda_recookie(){ 29 | if(!document.cookie.match(/panda_sniff=1/)){return;}; 30 | document.cookie='ipb_member_id='+document.cookie.match(/panda_user=(\d+)/)[1]+';path=/;domain=.exhentai.org'; 31 | document.cookie='ipb_pass_hash='+document.cookie.match(/panda_pass=([\da-z]{32})/)[1]+';path=/;domain=.exhentai.org'; 32 | document.cookie='igneous='+document.cookie.match(/panda_igneous=([\da-z]+)/)[1]+';path=/;domain=.exhentai.org'; 33 | document.cookie='sk='+(document.cookie.match(/panda_sk=([\da-z]+)/)?document.cookie.match(/panda_sk=([\da-z]+)/)[1]:'')+';path=/;domain=.exhentai.org'; 34 | document.cookie='yay=0;path=/;domain=.exhentai.org'; 35 | document.cookie='panda_sniff=;path=/;domain=.exhentai.org'; 36 | }; 37 | function panda_sniffimg(run,func){ 38 | if(!run){func();return;}; 39 | var exkey=exkey_private; 40 | if(!document.cookie.match(/panda_sniff=1/)){ 41 | document.cookie='panda_user='+document.cookie.match(/ipb_member_id=(\d+)/)[1]+';path=/;domain=.exhentai.org'; 42 | document.cookie='panda_pass='+document.cookie.match(/ipb_pass_hash=([\da-z]{32})/)[1]+';path=/;domain=.exhentai.org'; 43 | document.cookie='panda_igneous='+document.cookie.match(/igneous=([\da-z]+)/)[1]+';path=/;domain=.exhentai.org'; 44 | document.cookie='panda_sk='+(document.cookie.match(/sk=([\da-z]+)/)?document.cookie.match(/sk=([\da-z]+)/)[1]:'')+';path=/;domain=.exhentai.org'; 45 | document.cookie='yay=0;path=/;domain=.exhentai.org'; 46 | document.cookie='panda_sniff=1;path=/;domain=.exhentai.org'; 47 | }; 48 | document.cookie='ipb_member_id='+exkey.split('x')[0].substr(32)+';path=/;domain=.exhentai.org'; 49 | document.cookie='ipb_pass_hash='+exkey.split('x')[0].substr(0,32)+';path=/;domain=.exhentai.org'; 50 | document.cookie='igneous='+(exkey.split('x')[1]?exkey.split('x')[1]:'')+';path=/;domain=.exhentai.org'; 51 | document.cookie='sk=;path=/;domain=.exhentai.org'; 52 | document.cookie='yay=0;path=/;domain=.exhentai.org'; 53 | func(); 54 | }; 55 | function panda_loadpage(gid,token,numb,exec){ 56 | var xhr=new XMLHttpRequest(); 57 | xhr.open('GET','https://'+document.domain+'/g/'+gid+'/'+token+'/?p='+(numb-1),true); 58 | xhr.onerror=function(){if(confirm(panda_lang_0)){panda_loadpage(gid,token,numb,exec);};}; 59 | xhr.onreadystatechange=function(){if(this.readyState===4 && this.status===200){ 60 | var info={}; 61 | this.responseText.match(/
(.*?)https:\/\/e[x|-]hentai\.org\/s\/(\w+)\/(\d+)-(\d+)(.*?)<\/div>/g).forEach(function(value){var preg=value.match(/https:\/\/e[x|-]hentai\.org\/s\/(\w+)\/(\d+)-(\d+)/);info[preg[3]]=preg[1];}); 62 | exec(info); 63 | }}; 64 | xhr.send(null); 65 | }; 66 | function panda_loadfile(gid,numb,hash,adds,exec){ 67 | var xhr=new XMLHttpRequest(); 68 | xhr.open('GET','https://'+document.domain+'/s/'+hash+'/'+gid+'-'+numb+'?'+adds,true); 69 | xhr.onerror=function(){exec(null);}; 70 | xhr.onreadystatechange=function(){if(this.readyState===4 && this.status===200){ 71 | var html=this.responseText; 72 | var info={}; 73 | info.numb=numb; 74 | info.hash=hash; 75 | info.show=html.match(/id="img" src="(.*?)"/)[1]; 76 | info.show=info.show.substr(0,info.show.lastIndexOf('/')+1); 77 | info.full=html.match(/href="(https:\/\/e[x|-]hentai.org\/fullimg.php(.*?))"/); 78 | info.full=info.full?info.full[1].replace(/\&/g,'\&'):info.show; 79 | info.adds=adds+'&nl='+html.match(/onclick="return nl\(\'(.*?)\'\)"/)[1]; 80 | exec(info); 81 | }}; 82 | xhr.send(null); 83 | }; 84 | function panda_showlist(){ 85 | var panda_filefrom=parseInt(document.getElementById('panda_filefrom').value); 86 | var panda_filefinl=parseInt(document.getElementById('panda_filefinl').value); 87 | var panda_fileqnty=parseInt(document.getElementById('panda_fileqnty').title); 88 | if(!panda_filefrom || panda_filefrom<0){panda_filefrom=1;}; 89 | if(!panda_filefinl || panda_filefinl>panda_fileqnty){panda_filefinl=panda_fileqnty;}; 90 | if(panda_filefrom>panda_filefinl){alert(panda_lang_8);return;}; 91 | document.getElementById('panda_filefrom').title=panda_filefrom; 92 | document.getElementById('panda_filefinl').title=panda_filefinl; 93 | var panda_pageconf=document.getElementsByClassName('ths'); 94 | var panda_pageqnty=parseInt(panda_pageconf[0].innerHTML)*(panda_pageconf[1].innerHTML=='Normal'?10:5); 95 | var panda_pagefrom=Math.ceil(panda_filefrom/panda_pageqnty); 96 | var panda_pagefinl=Math.ceil(panda_filefinl/panda_pageqnty); 97 | var panda_hashmaps={}; 98 | for(var numb=panda_pagefrom;numb<=panda_pagefinl;numb++){ 99 | panda_loadpage(gid,token,numb,function(info){ 100 | panda_hashmaps=Object.assign(panda_hashmaps,info); 101 | if(Math.ceil(Object.keys(panda_hashmaps).length/panda_pageqnty)==(panda_pagefinl-panda_pagefrom+1)){ 102 | document.getElementById('panda_list').innerHTML=''; 103 | document.getElementById('panda_prev').style.display=''; 104 | document.getElementById('panda_next').style.display=''; 105 | document.getElementById('panda_dock').style.display=''; 106 | document.getElementById('panda_plus').scrollIntoView(); 107 | if(document.cookie.match(/panda_orign=true/) && panda_public()){ 108 | for(var numb=panda_filefrom;numb<=panda_filefinl;numb++){panda_sniff[numb]=1;}; 109 | }; 110 | panda_sniffimg(Object.keys(panda_sniff).length,function(){ 111 | for(var numb=panda_filefrom;numb<=panda_filefinl;numb++){ 112 | document.getElementById('panda_list').innerHTML+=''; 113 | document.getElementById('panda_file_'+numb).click(); 114 | }; 115 | }); 116 | }; 117 | }); 118 | }; 119 | }; 120 | function panda_showfile(numb,hash,adds){ 121 | panda_sniffimg((document.cookie.match(/panda_orign=true/) && adds && panda_public()),function(){ 122 | panda_loadfile(gid,numb,hash,adds,function(info){ 123 | if(!info){return;}; 124 | var file=document.getElementById('panda_file_'+info.numb); 125 | if(Object.keys(panda_sniff).length){ 126 | file.alt=info.adds; 127 | var img=new Image(); 128 | img.src=info.full; 129 | img.onerror=function(){if(panda_sniff[numb]){delete panda_sniff[numb];};if(!Object.keys(panda_sniff).length){panda_recookie();};}; 130 | img.onload=function(){file.src=img.src;if(panda_sniff[numb]){delete panda_sniff[numb];};if(!Object.keys(panda_sniff).length){panda_recookie();};}; 131 | } 132 | else{ 133 | file.alt=info.adds; 134 | file.src=document.cookie.match(/panda_orign=true/)?info.full:info.show; 135 | }; 136 | }); 137 | }); 138 | }; 139 | function panda_showprev(){ 140 | var panda_fileqnty=parseInt(document.getElementById('panda_fileqnty').title); 141 | var panda_readfrom=parseInt(document.getElementById('panda_filefrom').title); 142 | var panda_readfinl=parseInt(document.getElementById('panda_filefinl').title); 143 | if(panda_readfrom==1){alert(panda_lang_9);return;}; 144 | var panda_readqnty=prompt(panda_lang_7,panda_readfinl-panda_readfrom+1); 145 | if(!panda_readqnty && panda_readqnty!==''){return;}; 146 | panda_readqnty=parseInt(panda_readqnty); 147 | if(!panda_readqnty || panda_readqnty<0){panda_readqnty=panda_fileqnty;}; 148 | var panda_filefrom=panda_readfrom-panda_readqnty; 149 | var panda_filefinl=panda_readfrom-1; 150 | if(panda_filefrom<1){panda_filefrom=1;}; 151 | document.getElementById('panda_filefrom').value=panda_filefrom; 152 | document.getElementById('panda_filefinl').value=panda_filefinl; 153 | panda_showlist(); 154 | }; 155 | function panda_shownext(){ 156 | var panda_fileqnty=parseInt(document.getElementById('panda_fileqnty').title); 157 | var panda_readfrom=parseInt(document.getElementById('panda_filefrom').title); 158 | var panda_readfinl=parseInt(document.getElementById('panda_filefinl').title); 159 | if(panda_readfinl==panda_fileqnty){alert(panda_lang_9);return;}; 160 | var panda_readqnty=prompt(panda_lang_7,panda_readfinl-panda_readfrom+1); 161 | if(!panda_readqnty && panda_readqnty!==''){return;}; 162 | panda_readqnty=parseInt(panda_readqnty); 163 | if(!panda_readqnty || panda_readqnty<0){panda_readqnty=panda_fileqnty;}; 164 | var panda_filefrom=panda_readfinl+1; 165 | var panda_filefinl=panda_readfinl+panda_readqnty; 166 | if(panda_filefinl>panda_fileqnty){panda_filefinl=panda_fileqnty;}; 167 | document.getElementById('panda_filefrom').value=panda_filefrom; 168 | document.getElementById('panda_filefinl').value=panda_filefinl; 169 | panda_showlist(); 170 | }; 171 | function panda_plusfunc(){ 172 | var navi=document.getElementsByClassName('gpc')[0].innerHTML.match(/Showing ([\d,]+) - ([\d,]+) of ([\d,]+) images/); 173 | var code=document.createElement('div'); 174 | code.innerHTML='

'+panda_lang_2+'  -   '+panda_lang_3+'   '+panda_lang_4+'   '+((document.domain.substr(1,1)=='x')?'@  ':'')+'?

   [ ▼ ]   

'; 175 | var gtbn=document.getElementById('cdiv'); 176 | gtbn.parentNode.insertBefore(code,gtbn); 177 | }; 178 | var panda=document.getElementsByTagName('script')[document.getElementsByTagName('script').length-1]; 179 | var panda_zhcn=(navigator.language && navigator.language=='zh-CN')?true:false; 180 | var panda_lang_0=panda_zhcn?'网络错误,是否重试?':'Network error, retry?'; 181 | var panda_lang_1=panda_zhcn?'无权访问,更换exkey:(留空使用公共账号)':'Account invalid, alter exkey: (Leave blank to use public account)'; 182 | var panda_lang_2=panda_zhcn?'范围':'Range'; 183 | var panda_lang_3=panda_zhcn?'宽度':'Width'; 184 | var panda_lang_4=panda_zhcn?'原图':'Original'; 185 | var panda_lang_5=panda_zhcn?'嗅探模式将被开启(很慢)':'Sniff mode will be used (Slow)'; 186 | var panda_lang_6=panda_zhcn?'请确认已登录,否则无法加载原图':'If you did not logged in, original pictures will not display'; 187 | var panda_lang_7=panda_zhcn?'加载多少张图片?(留空读取至末尾)':'How many pictures to load? (Leave blank to end)'; 188 | var panda_lang_8=panda_zhcn?'输入有误':'Incorrect input'; 189 | var panda_lang_9=panda_zhcn?'到达边界':'Edge reached'; 190 | var panda_width=document.cookie.match(/panda_width=[\d]+/)?document.cookie.match(/panda_width=(\d+)/)[1]:800; 191 | var panda_sniff={}; 192 | window.addEventListener('beforeunload',function(){panda_recookie();}); 193 | if(!document.domain.match(/^e[x|-]hentai\.org$/)){window.location.href='https://exhentai.org/favicon.ico';} 194 | else if(document.getElementById('gdt') && !document.getElementById('panda_plus')){panda_plusfunc();} 195 | else if(document.getElementById('img')){window.nl=function(adds){panda_loadfile(gid,window.location.href.match(/https:\/\/e[x|-]hentai\.org\/s\/(\w+)\/(\d+)-(\d+)/)[3],window.location.href.match(/https:\/\/e[x|-]hentai\.org\/s\/(\w+)\/(\d+)-(\d+)/)[1],adds,function(info){if(!info){return;};document.getElementById('img').src=info.show;document.getElementById('loadfail').setAttribute('onclick','return nl(\''+info.adds+'\')');});}} 196 | else if(document.body.innerHTML.match(/^err/)){if(window.location.pathname=='/fullimg.php'){document.body.innerHTML='Loading...';panda_sniffimg(true,function(){var img=new Image();img.src=window.location.href;img.onerror=function(){panda_recookie();};img.onload=function(){document.getElementById('img').src=img.src;panda_recookie();};});}else{panda_exkeyset();}} 197 | else if(window.location.pathname=='/favicon.ico' || !document.head.innerHTML){panda_leapover(panda.getAttribute('exkey'));} 198 | else{console.log('!-Panda-!');}; 199 | --------------------------------------------------------------------------------