1.2.2
This commit is contained in:
parent
ea68301ae2
commit
60e0273d25
15
.env.example
15
.env.example
@ -1,5 +1,5 @@
|
|||||||
proxy=
|
proxy=
|
||||||
#Tor的Socks5代理
|
#Tor的Socks5代理,如 192.168.1.1:1080
|
||||||
|
|
||||||
RedisHost=
|
RedisHost=
|
||||||
#Redis主机名
|
#Redis主机名
|
||||||
@ -19,5 +19,16 @@ ZlibraryLogin=loginzlib2vrak5zzpcocc3ouizykn6k5qecgj2tzlnab5wcbqhembyd.onion
|
|||||||
Zlibrary=bookszlibb74ugqojhzhg2a63w5i2atv5bqarulgczawnbmsb6s6qead.onion
|
Zlibrary=bookszlibb74ugqojhzhg2a63w5i2atv5bqarulgczawnbmsb6s6qead.onion
|
||||||
#除非Zlib的洋葱域名改变否则无需更改
|
#除非Zlib的洋葱域名改变否则无需更改
|
||||||
|
|
||||||
version=1.0.1
|
reg_url="https://zh.singlelogin.rs/registration"
|
||||||
|
#注册按钮的链接
|
||||||
|
|
||||||
|
public_login=zh.singlelogin.rs
|
||||||
|
#公网登录域名
|
||||||
|
|
||||||
|
public_url=zh.z-library.rs
|
||||||
|
#公网域名
|
||||||
|
|
||||||
|
copyright=MimirLib
|
||||||
|
copyright_url="https://mimir.pp.ua"
|
||||||
|
version=1.2.2
|
||||||
#无需更改
|
#无需更改
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
.env
|
.env
|
||||||
.history
|
.history
|
||||||
|
runtime/*
|
||||||
|
books/*
|
||||||
|
@ -38,20 +38,33 @@ class File
|
|||||||
$id=$request->cookie('id', 'blank');
|
$id=$request->cookie('id', 'blank');
|
||||||
$key=$request->cookie('key', 'blank');
|
$key=$request->cookie('key', 'blank');
|
||||||
$path=$request->input('path','blank');
|
$path=$request->input('path','blank');
|
||||||
|
$tor=$request->cookie('tor', 'false');
|
||||||
if($key=='blank' || $id=='blank'){
|
if($key=='blank' || $id=='blank'){
|
||||||
return json(['code'=>509,'msg'=>'未登录或参数错误']);
|
return json(['code'=>509,'msg'=>'未登录或参数错误']);
|
||||||
}
|
}
|
||||||
$auth=array('remix_userid'=>"$id",'remix_userkey'=>"$key",'siteLanguageV2'=>'zh','selectedSiteMode'=>'books');
|
$auth=array('remix_userid'=>"$id",'remix_userkey'=>"$key",'siteLanguageV2'=>'zh','selectedSiteMode'=>'books');
|
||||||
$url='http://'.getenv('Zlibrary')."$path";
|
|
||||||
$get=Http::withProxy('socks5h://'.getenv('proxy'))->withCookies($auth,getenv('Zlibrary'));
|
$host=getenv('public_url');
|
||||||
|
$httpquery=Http::timeout(60);
|
||||||
|
if($tor=='true'){
|
||||||
|
$host=getenv('Zlibrary');
|
||||||
|
$httpquery=$httpquery->withProxy('socks5h://'.getenv('proxy'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$url='http://'.$host.$path;
|
||||||
|
$get=$httpquery->withRedirect(['max'=> 5,'track_redirects' => true])->withCookies($auth,$host);
|
||||||
$head=$get->head($url);
|
$head=$get->head($url);
|
||||||
$ContentLength=(int)$head->header('Content-Length');
|
$ContentLength=(int)$head->header('Content-Length');
|
||||||
$size=round(($ContentLength/1048576),2);
|
$size=round(($ContentLength/1048576),2);
|
||||||
|
$redirectback=explode(', ',$head->header('X-Guzzle-Redirect-History'));
|
||||||
|
$outurl=end($redirectback);
|
||||||
if($size>=30){
|
if($size>=30){
|
||||||
return json(['code'=>500,'msg'=>'文件太大了!']);
|
return json(['code'=>500,'msg'=>'文件太大了!','url'=>$outurl]);
|
||||||
}
|
}
|
||||||
if($head->header('Content-Type')=='text/html; charset=UTF-8'){
|
if($head->header('Content-Type')=='text/html; charset=UTF-8'){
|
||||||
return json(['code'=>404,'msg'=>'链接错误']);
|
# print_r($head);
|
||||||
|
# return json(['code'=>404,'msg'=>'链接错误']);
|
||||||
|
return json(['code'=>808,'msg'=>$outurl]);
|
||||||
}
|
}
|
||||||
$redis = Redis::connection('default');
|
$redis = Redis::connection('default');
|
||||||
$name=base64_encode($path);
|
$name=base64_encode($path);
|
||||||
|
@ -19,6 +19,8 @@ class IndexController
|
|||||||
$response = response();
|
$response = response();
|
||||||
$id=$request->cookie('id', 'blank');
|
$id=$request->cookie('id', 'blank');
|
||||||
$key=$request->cookie('key', 'blank');
|
$key=$request->cookie('key', 'blank');
|
||||||
|
$tor=$request->cookie('tor', 'false');
|
||||||
|
|
||||||
if($key=='blank' || $id=='blank'){
|
if($key=='blank' || $id=='blank'){
|
||||||
return redirect('/login');
|
return redirect('/login');
|
||||||
}
|
}
|
||||||
@ -35,28 +37,46 @@ class IndexController
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
$url='http://'.getenv('Zlibrary').$path;
|
$host=getenv('public_url');
|
||||||
$auth=array('remix_userid'=>"$id",'remix_userkey'=>"$key",'siteLanguageV2'=>'zh','selectedSiteMode'=>'books');
|
$httpquery=Http::timeout(60);
|
||||||
$return = Http::withProxy('socks5h://'.getenv('proxy'))->withCookies($auth,getenv('Zlibrary'))->get($url);
|
$onion='<svg style="margin-bottom: -4px;" t="1718896386758" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9713" width="24" height="24"><path d="M512 597.333333C469.333333 597.333333 384 640 384 682.666667 384 768 512 768 512 768L512 725.333333C488.533333 725.333333 469.333333 706.133333 469.333333 682.666667 469.333333 659.2 488.533333 640 512 640L512 597.333333M512 810.666667C512 810.666667 341.333333 789.333333 341.333333 704 341.333333 576 469.333333 544 512 544L512 490.666667C469.333333 490.666667 298.666667 554.666667 298.666667 682.666667 298.666667 853.333333 512 853.333333 512 853.333333L512 810.666667M429.653333 299.946667 480.426667 322.56C498.773333 218.453333 547.84 149.333333 547.84 149.333333 529.493333 193.28 517.546667 229.546667 509.866667 258.133333 561.493333 151.466667 666.026667 85.333333 666.026667 85.333333 615.68 135.68 578.56 190.293333 553.386667 235.946667 620.8 164.266667 714.24 117.333333 714.24 117.333333 599.466667 190.72 547.84 307.2 535.04 339.626667L558.506667 343.04C558.506667 365.226667 558.506667 385.706667 569.173333 401.92 601.6 482.56 768 489.386667 768 682.666667 768 875.946667 596.053333 938.666667 504.746667 938.666667 413.44 938.666667 213.333333 897.28 213.333333 682.666667 213.333333 468.053333 424.533333 466.346667 462.08 380.586667 467.2 364.373333 429.653333 299.946667 429.653333 299.946667Z" p-id="9714" fill="#8a8a8a"></path></svg>';
|
||||||
$response->withHeaders($return->headers());
|
$torstatus='<span>Off</span>';
|
||||||
|
if($tor=='true'){
|
||||||
|
$host=getenv('Zlibrary');
|
||||||
|
$httpquery=$httpquery->withProxy('socks5h://'.getenv('proxy'));
|
||||||
|
$onion='<svg style="margin-bottom: -4px;" t="1718896386758" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9713" width="24" height="24"><path d="M512 597.333333C469.333333 597.333333 384 640 384 682.666667 384 768 512 768 512 768L512 725.333333C488.533333 725.333333 469.333333 706.133333 469.333333 682.666667 469.333333 659.2 488.533333 640 512 640L512 597.333333M512 810.666667C512 810.666667 341.333333 789.333333 341.333333 704 341.333333 576 469.333333 544 512 544L512 490.666667C469.333333 490.666667 298.666667 554.666667 298.666667 682.666667 298.666667 853.333333 512 853.333333 512 853.333333L512 810.666667M429.653333 299.946667 480.426667 322.56C498.773333 218.453333 547.84 149.333333 547.84 149.333333 529.493333 193.28 517.546667 229.546667 509.866667 258.133333 561.493333 151.466667 666.026667 85.333333 666.026667 85.333333 615.68 135.68 578.56 190.293333 553.386667 235.946667 620.8 164.266667 714.24 117.333333 714.24 117.333333 599.466667 190.72 547.84 307.2 535.04 339.626667L558.506667 343.04C558.506667 365.226667 558.506667 385.706667 569.173333 401.92 601.6 482.56 768 489.386667 768 682.666667 768 875.946667 596.053333 938.666667 504.746667 938.666667 413.44 938.666667 213.333333 897.28 213.333333 682.666667 213.333333 468.053333 424.533333 466.346667 462.08 380.586667 467.2 364.373333 429.653333 299.946667 429.653333 299.946667Z" p-id="9714" fill="#7A5EB7"></path></svg>';
|
||||||
|
$torstatus='<span style="color:green;">On</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$url='http://'.$host.$path;
|
||||||
|
|
||||||
|
$auth=array('remix_userid'=>"$id",'remix_userkey'=>"$key",'siteLanguageV2'=>'zh','siteLanguage'=>'zh','selectedSiteMode'=>'books');
|
||||||
|
$return = $httpquery->withCookies($auth,$host)->get($url);
|
||||||
|
|
||||||
$back=$return->body();
|
$back=$return->body();
|
||||||
if($return->header('Content-Type')=='text/html; charset=UTF-8'){
|
if($return->header('Content-Type')=='text/html; charset=UTF-8'){
|
||||||
$ver=getenv('version');
|
$ver=getenv('version');
|
||||||
|
$copyright=getenv('copyright');
|
||||||
|
$copyright_url=getenv('copyright_url');
|
||||||
|
|
||||||
$front= <<<EOF
|
$front= <<<EOF
|
||||||
<html><body>
|
<html><body>
|
||||||
<center>
|
<center>
|
||||||
<div style="background-color: bisque;color: black;position:fixed!important;font-size:1.8rem;line-height:1.618;z-index:9999!important;text-align:-webkit-center;">
|
<div style="background-color: bisque;color: black;position:fixed!important;font-size:1.8rem;line-height:1.618;z-index:9999!important;text-align:-webkit-center;">
|
||||||
Zlibrary Proxy(v$ver) UserID:$id <a style="color: coral;" href="/login/logout">[退出账号]</a><a style="color: black;" href="//www.pmnet.gq" target="_blank_pmnet"> [PublicMirrorsNetwork]</a>
|
Zlibrary Proxy(v$ver) UserID:$id <a href='/login/switchtor?to=$path'>[$onion Tor $torstatus]</a> <a style="color: coral;" href="/login/logout">[退出账号]</a><a style="color: black;" href="$copyright_url" target="_blank_pmnet"> [$copyright]</a>
|
||||||
</div>
|
</div>
|
||||||
</center></body></html>
|
</center></body></html>
|
||||||
EOF;
|
EOF;
|
||||||
$back=$front.$back;
|
$back=$front.$back;
|
||||||
}
|
}
|
||||||
|
$backhead=$return->headers();
|
||||||
|
$backhead['Content-Length']=strlen($back);
|
||||||
|
|
||||||
|
$response->withHeaders($backhead);
|
||||||
|
|
||||||
/**Make Cache */
|
/**Make Cache */
|
||||||
if($path=='/resources/build/global.js?0.495' || $path=='/resources/build/global.css?0.495' || $path=='/resources/ext/freewall.js' || preg_match("/^image*/",$return->header('Content-Type')) ){
|
if($path=='/resources/build/global.js?0.495' || $path=='/resources/build/global.css?0.495' || $path=='/resources/ext/freewall.js' || preg_match("/^image*/",$return->header('Content-Type')) ){
|
||||||
$redis->hset($rpath,'CT',json_encode($return->headers()));
|
$redis->hset($rpath,'CT',json_encode($backhead));
|
||||||
$redis->hset($rpath,'body',$back);
|
$redis->hset($rpath,'body',$back);
|
||||||
$redis->expire($rpath,43200);
|
$redis->expire($rpath,43200);
|
||||||
}
|
}
|
||||||
@ -76,6 +96,8 @@ EOF;
|
|||||||
$username=$request->post('name','blank');
|
$username=$request->post('name','blank');
|
||||||
$password=$request->post('password','blank');
|
$password=$request->post('password','blank');
|
||||||
$code=$request->post('code','blank');
|
$code=$request->post('code','blank');
|
||||||
|
$tor=$request->post('tor',false);
|
||||||
|
|
||||||
if($username=='blank' || $password=='blank' || $code=='blank'){
|
if($username=='blank' || $password=='blank' || $code=='blank'){
|
||||||
return json(['code'=>500, 'msg'=>'缺少参数']);
|
return json(['code'=>500, 'msg'=>'缺少参数']);
|
||||||
}
|
}
|
||||||
@ -102,8 +124,15 @@ EOF;
|
|||||||
return json(['code' => 400, 'msg' => '输入的验证码不正确']);
|
return json(['code' => 400, 'msg' => '输入的验证码不正确']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$url='https://'.getenv('public_login').'/rpc.php';
|
||||||
|
$response=Http::timeout(60);
|
||||||
|
if($tor=='true'){
|
||||||
$url='http://'.getenv('ZlibraryLogin').'/rpc.php';
|
$url='http://'.getenv('ZlibraryLogin').'/rpc.php';
|
||||||
$response = Http::withProxy('socks5h://'.getenv('proxy'))->post("$url", ['isModal' => true,'email'=>"$username",'password'=>"$password",'site_mode'=>'books','action'=>'login','redirectUrl'=>'','isSinglelogin'=>'1','isTorVersion'=>'1','gg_json_mode'=>'1']);
|
$response=$response->withProxy('socks5h://'.getenv('proxy'));
|
||||||
|
}
|
||||||
|
$response = $response->post("$url", ['isModal' => true,'email'=>"$username",'password'=>"$password",'site_mode'=>'books','action'=>'login','redirectUrl'=>'','isSinglelogin'=>'1','isTorVersion'=>'1','gg_json_mode'=>'1']);
|
||||||
|
#print_r($response);
|
||||||
|
|
||||||
if(!$response->successful()){
|
if(!$response->successful()){
|
||||||
return json(['code' => 501, 'msg' => '登陆失败,服务端错误']);
|
return json(['code' => 501, 'msg' => '登陆失败,服务端错误']);
|
||||||
}
|
}
|
||||||
@ -112,7 +141,13 @@ EOF;
|
|||||||
if(isset($return->response->validationError)){
|
if(isset($return->response->validationError)){
|
||||||
return json(['code' => 502, 'msg' => 'Zlib登陆失败:'.$return->response->message]);
|
return json(['code' => 502, 'msg' => 'Zlib登陆失败:'.$return->response->message]);
|
||||||
}
|
}
|
||||||
$url=parse_url($return->response->params)['query'];
|
#print_r($return->response);
|
||||||
|
$rawparma=$return->response->params;
|
||||||
|
if($tor=='true'){
|
||||||
|
$rawparma=$return->response->priorityRedirectUrl;
|
||||||
|
}
|
||||||
|
$url=parse_url($rawparma)['query'];
|
||||||
|
#print_r($url);
|
||||||
$queryParts = explode('&', $url);
|
$queryParts = explode('&', $url);
|
||||||
$params = array();
|
$params = array();
|
||||||
foreach ($queryParts as $param) {
|
foreach ($queryParts as $param) {
|
||||||
@ -120,7 +155,7 @@ EOF;
|
|||||||
$params[$item[0]] = $item[1];
|
$params[$item[0]] = $item[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return json(['code'=>200,'msg'=>'登陆成功','userid'=>$params['remix_userid']])->cookie('id', $params['remix_userid'],43200,'/')->cookie('key', $params['remix_userkey'],43200,'/');
|
return json(['code'=>200,'msg'=>'登陆成功','userid'=>$params['remix_userid']])->cookie('id', $params['remix_userid'],43200,'/')->cookie('key', $params['remix_userkey'],43200,'/')->cookie('tor', $tor,43200,'/');
|
||||||
}
|
}
|
||||||
public function code(Request $request)
|
public function code(Request $request)
|
||||||
{
|
{
|
||||||
@ -150,6 +185,8 @@ EOF;
|
|||||||
|
|
||||||
$id=$request->cookie('id', 'blank');
|
$id=$request->cookie('id', 'blank');
|
||||||
$key=$request->cookie('key', 'blank');
|
$key=$request->cookie('key', 'blank');
|
||||||
|
$tor=$request->cookie('tor', 'false');
|
||||||
|
|
||||||
if($key=='blank' || $id=='blank'){
|
if($key=='blank' || $id=='blank'){
|
||||||
return redirect('/login');
|
return redirect('/login');
|
||||||
}
|
}
|
||||||
@ -158,6 +195,7 @@ EOF;
|
|||||||
'id' => $id,
|
'id' => $id,
|
||||||
'key'=> $key,
|
'key'=> $key,
|
||||||
'path'=> $path,
|
'path'=> $path,
|
||||||
|
'tor'=>$tor,
|
||||||
]);
|
]);
|
||||||
return view('index');
|
return view('index');
|
||||||
|
|
||||||
@ -169,5 +207,17 @@ EOF;
|
|||||||
return response()->file(base_path() . '/app/controller/IndexController.php');
|
return response()->file(base_path() . '/app/controller/IndexController.php');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public function tor(Request $request)
|
||||||
|
{
|
||||||
|
$to=$request->input('to','/');
|
||||||
|
$tor=$request->cookie('tor','false');
|
||||||
|
if($tor=='true'){
|
||||||
|
$tor='false';
|
||||||
|
}else{
|
||||||
|
$tor='true';
|
||||||
|
}
|
||||||
|
return redirect($to)->cookie('tor', $tor,43200,'/');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,15 @@
|
|||||||
<main>
|
<main>
|
||||||
<center>
|
<center>
|
||||||
<div style="background-color: bisque;color: black;">
|
<div style="background-color: bisque;color: black;">
|
||||||
Zlibrary Proxy(v<?php echo(getenv('version'));?>) UserID:<?php echo($id);?> <a style="color: coral;" href="/login/logout">[退出账号]</a>
|
<?php
|
||||||
|
$onion='<svg style="margin-bottom: -4px;" t="1718896386758" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9713" width="24" height="24"><path d="M512 597.333333C469.333333 597.333333 384 640 384 682.666667 384 768 512 768 512 768L512 725.333333C488.533333 725.333333 469.333333 706.133333 469.333333 682.666667 469.333333 659.2 488.533333 640 512 640L512 597.333333M512 810.666667C512 810.666667 341.333333 789.333333 341.333333 704 341.333333 576 469.333333 544 512 544L512 490.666667C469.333333 490.666667 298.666667 554.666667 298.666667 682.666667 298.666667 853.333333 512 853.333333 512 853.333333L512 810.666667M429.653333 299.946667 480.426667 322.56C498.773333 218.453333 547.84 149.333333 547.84 149.333333 529.493333 193.28 517.546667 229.546667 509.866667 258.133333 561.493333 151.466667 666.026667 85.333333 666.026667 85.333333 615.68 135.68 578.56 190.293333 553.386667 235.946667 620.8 164.266667 714.24 117.333333 714.24 117.333333 599.466667 190.72 547.84 307.2 535.04 339.626667L558.506667 343.04C558.506667 365.226667 558.506667 385.706667 569.173333 401.92 601.6 482.56 768 489.386667 768 682.666667 768 875.946667 596.053333 938.666667 504.746667 938.666667 413.44 938.666667 213.333333 897.28 213.333333 682.666667 213.333333 468.053333 424.533333 466.346667 462.08 380.586667 467.2 364.373333 429.653333 299.946667 429.653333 299.946667Z" p-id="9714" fill="#8a8a8a"></path></svg>';
|
||||||
|
$torstatus='<span>Off</span>';
|
||||||
|
if($tor=='true'){
|
||||||
|
$onion='<svg style="margin-bottom: -4px;" t="1718896386758" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9713" width="24" height="24"><path d="M512 597.333333C469.333333 597.333333 384 640 384 682.666667 384 768 512 768 512 768L512 725.333333C488.533333 725.333333 469.333333 706.133333 469.333333 682.666667 469.333333 659.2 488.533333 640 512 640L512 597.333333M512 810.666667C512 810.666667 341.333333 789.333333 341.333333 704 341.333333 576 469.333333 544 512 544L512 490.666667C469.333333 490.666667 298.666667 554.666667 298.666667 682.666667 298.666667 853.333333 512 853.333333 512 853.333333L512 810.666667M429.653333 299.946667 480.426667 322.56C498.773333 218.453333 547.84 149.333333 547.84 149.333333 529.493333 193.28 517.546667 229.546667 509.866667 258.133333 561.493333 151.466667 666.026667 85.333333 666.026667 85.333333 615.68 135.68 578.56 190.293333 553.386667 235.946667 620.8 164.266667 714.24 117.333333 714.24 117.333333 599.466667 190.72 547.84 307.2 535.04 339.626667L558.506667 343.04C558.506667 365.226667 558.506667 385.706667 569.173333 401.92 601.6 482.56 768 489.386667 768 682.666667 768 875.946667 596.053333 938.666667 504.746667 938.666667 413.44 938.666667 213.333333 897.28 213.333333 682.666667 213.333333 468.053333 424.533333 466.346667 462.08 380.586667 467.2 364.373333 429.653333 299.946667 429.653333 299.946667Z" p-id="9714" fill="#7A5EB7"></path></svg>';
|
||||||
|
$torstatus='<span style="color:green;">On</span>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
Zlibrary Proxy(v<?php echo(getenv('version'));?>) UserID:<?php echo($id);?> <a href='/login/switchtor?to=<?php echo($path);?>'>[<?php echo($onion);?> Tor <?php echo($torstatus);?>]</a> <a style="color: coral;" href="/login/logout">[退出账号]</a>
|
||||||
</div>
|
</div>
|
||||||
</center>
|
</center>
|
||||||
<div id="container">
|
<div id="container">
|
||||||
@ -82,6 +90,9 @@
|
|||||||
<div id="start" style="display: none;">
|
<div id="start" style="display: none;">
|
||||||
<button onclick="download()">点此开始下载图书</button>
|
<button onclick="download()">点此开始下载图书</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="outdown" style="display: none;">
|
||||||
|
<button onclick="outdownload()">前往外部链接下载</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<script src="zlibproxy/jquery-3.6.3.min.js"></script>
|
<script src="zlibproxy/jquery-3.6.3.min.js"></script>
|
||||||
@ -144,8 +155,10 @@
|
|||||||
$('#start').hide();
|
$('#start').hide();
|
||||||
}
|
}
|
||||||
if (data.code == 500) {
|
if (data.code == 500) {
|
||||||
$('#notice').html('文件过大(大于30Mb),暂时无法通过ZlibProxy下载');
|
$('#notice').html('文件过大(大于30Mb),暂时无法通过ZlibProxy下载<br />但您可以尝试从外部链接下载(可能需要梯子)');
|
||||||
$('#start').hide();
|
$('#start').hide();
|
||||||
|
$('#outdown').show();
|
||||||
|
window.outurl=data.url;
|
||||||
}
|
}
|
||||||
if (data.code == 400) {
|
if (data.code == 400) {
|
||||||
$('#notice').html('图书不存在……请尝试别的图书');
|
$('#notice').html('图书不存在……请尝试别的图书');
|
||||||
@ -155,10 +168,19 @@
|
|||||||
$('#notice').html('缺少参数或未登录');
|
$('#notice').html('缺少参数或未登录');
|
||||||
setTimeout(function(){$(location).attr('href','/login')},1500);
|
setTimeout(function(){$(location).attr('href','/login')},1500);
|
||||||
}
|
}
|
||||||
|
if (data.code == 808) {
|
||||||
|
$('#notice').html('Zlib要求您前往外部链接下载(可能是因为今日次数用完,或触发风控)<br />请点击前往外部链接查看(可能需要梯子)');
|
||||||
|
$('#start').hide();
|
||||||
|
$('#outdown').show();
|
||||||
|
window.outurl=data.msg;
|
||||||
|
}
|
||||||
$('#load').hide();
|
$('#load').hide();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function outdownload(){
|
||||||
|
window.open(window.outurl);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -59,6 +59,68 @@
|
|||||||
90% { transform: scaley(1); }
|
90% { transform: scaley(1); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 开关 - 滑块周围的框 */
|
||||||
|
.switch {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 60px;
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 隐藏默认 HTML 复选框 */
|
||||||
|
.switch input {
|
||||||
|
opacity: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 滑块 */
|
||||||
|
.slider {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: #2fbc47;
|
||||||
|
-webkit-transition: .4s;
|
||||||
|
transition: .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:before {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
height: 26px;
|
||||||
|
width: 26px;
|
||||||
|
left: 4px;
|
||||||
|
bottom: 4px;
|
||||||
|
background-color: white;
|
||||||
|
-webkit-transition: .4s;
|
||||||
|
transition: .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider {
|
||||||
|
background-color: #2196F3;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus + .slider {
|
||||||
|
box-shadow: 0 0 1px #2196F3;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
-webkit-transform: translateX(26px);
|
||||||
|
-ms-transform: translateX(26px);
|
||||||
|
transform: translateX(26px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 圆形滑块 */
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>ZlibraryProxy-登录</title>
|
<title>ZlibraryProxy-登录</title>
|
||||||
</head>
|
</head>
|
||||||
@ -73,8 +135,8 @@
|
|||||||
</script>
|
</script>
|
||||||
<main>
|
<main>
|
||||||
<h1>Z-library Proxy</h1><hr />
|
<h1>Z-library Proxy</h1><hr />
|
||||||
<p>这是一个Zlibrary的代理镜像</p>
|
<p>这是一个Zlibrary的代理镜像 ver:<?php echo(getenv('version')); ?></p>
|
||||||
<a href="https://www.pmnet.gq/" target="_blank_pmnet">由[<span class="pmnet">PublicMirrorsNetwork</span>]维护</a>
|
<a href="<?php echo(getenv('copyright_url')); ?>" target="_blank_pmnet">由[<span class="pmnet"><?php echo(getenv('copyright')); ?></span>]维护</a>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
本代理利用广大的Tor代理和中继节点,基于<a href="" target="_blank_tor">TOR</a>技术提供服务
|
本代理利用广大的Tor代理和中继节点,基于<a href="" target="_blank_tor">TOR</a>技术提供服务
|
||||||
@ -83,7 +145,7 @@
|
|||||||
<br />
|
<br />
|
||||||
使用前请确保您的行为符合当地法律
|
使用前请确保您的行为符合当地法律
|
||||||
<br />
|
<br />
|
||||||
由于Zlibrary的邮件服务器已经宕机,任何新注册和更改密码请求均无效,均无法使用,如果您的账号还未通过邮箱激活将无法使用本服务
|
选择公网时速度更快,当公网不可用时,请选择TOR网络,TOR网络速度较慢但更安全。
|
||||||
<br />
|
<br />
|
||||||
<span style="color: coral;">本代理不会保存您的密码(仅在浏览器cookies保存您的ID)</span>
|
<span style="color: coral;">本代理不会保存您的密码(仅在浏览器cookies保存您的ID)</span>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
@ -93,6 +155,11 @@
|
|||||||
<h4>登录到Z-Library</h4>
|
<h4>登录到Z-Library</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<form action="new_apply.php" method="POST">
|
<form action="new_apply.php" method="POST">
|
||||||
|
<p>公网 <label class="switch">
|
||||||
|
<input id="tor" type="checkbox" name="tor">
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label> TOR网络
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label for="name">*Zlibrary账号(email)</label>
|
<label for="name">*Zlibrary账号(email)</label>
|
||||||
<input required="required" name="name" id="name" placeholder="Your Zlib Username" type="email" style="width:50%">
|
<input required="required" name="name" id="name" placeholder="Your Zlib Username" type="email" style="width:50%">
|
||||||
@ -116,13 +183,16 @@
|
|||||||
</form>
|
</form>
|
||||||
<p>
|
<p>
|
||||||
<button onclick="login()" value="登录" style="width:30%">登录</button>
|
<button onclick="login()" value="登录" style="width:30%">登录</button>
|
||||||
点击登录代表您同意并接受<a href="https://www.pmnet.gq/PMNETTOS" target="_blank_tos">PMNET TOS</a>
|
<button onclick="window.open('<?php echo(getenv('reg_url')); ?>')" value="注册" style="width:10%">注册</button>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
点击登录代表您同意并接受<a href="https://www.pmnet.gq/PMNETTOS" target="_blank_tos">TOS</a>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<hr/>
|
<hr/>
|
||||||
©PMNET.GQ 2023 Made with <a href="https://oxal.org/projects/sakura">sakura.css</a>
|
©<?php echo(getenv('copyright')); ?> 2024 Made with <a href="https://oxal.org/projects/sakura">sakura.css</a>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="zlibproxy/jquery-3.6.3.min.js"></script>
|
<script src="zlibproxy/jquery-3.6.3.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
@ -130,10 +200,12 @@
|
|||||||
var name = $("#name").val();
|
var name = $("#name").val();
|
||||||
var password = $("#password").val();
|
var password = $("#password").val();
|
||||||
var ccode = $("#code").val();
|
var ccode = $("#code").val();
|
||||||
|
var tor = $("#tor").prop('checked');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: '/login/check',
|
url: '/login/check',
|
||||||
data: {'name':name,'password':password,'code':ccode},
|
data: {'name':name,'password':password,'code':ccode,'tor':tor},
|
||||||
async: true,
|
async: true,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
cache: false,
|
cache: false,
|
||||||
|
@ -27,6 +27,8 @@ Route::any('/test', function ($request) {
|
|||||||
});
|
});
|
||||||
Route::any('/login/logout', [app\controller\IndexController::class, 'logout']);
|
Route::any('/login/logout', [app\controller\IndexController::class, 'logout']);
|
||||||
Route::any('/logout.php', [app\controller\IndexController::class, 'logout']);
|
Route::any('/logout.php', [app\controller\IndexController::class, 'logout']);
|
||||||
|
Route::any('/login/switchtor', [app\controller\IndexController::class, 'tor']);
|
||||||
|
|
||||||
Route::any('/dl/{id}/{way}', [app\controller\IndexController::class, 'download']);
|
Route::any('/dl/{id}/{way}', [app\controller\IndexController::class, 'download']);
|
||||||
|
|
||||||
Route::any('/zlibproxy/check', [app\controller\File::class, 'check'])->middleware([
|
Route::any('/zlibproxy/check', [app\controller\File::class, 'check'])->middleware([
|
||||||
|
47
test.php
47
test.php
@ -1,44 +1,5 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/vendor/autoload.php';
|
$a=array("a"=>"red","b"=>"green");
|
||||||
require_once __DIR__ . '/support/bootstrap.php';
|
$a['c']="1";
|
||||||
use yzh52521\EasyHttp\Response;
|
print_r($a);
|
||||||
use yzh52521\EasyHttp\RequestException;
|
?>
|
||||||
use yzh52521\EasyHttp\Http;
|
|
||||||
use support\Redis;
|
|
||||||
use support\Cache;
|
|
||||||
|
|
||||||
/**
|
|
||||||
$redis = Redis::connection('default');
|
|
||||||
$kf='ProxyCache_';
|
|
||||||
$path='/test2';
|
|
||||||
$rpath=$kf.base64_encode($path);
|
|
||||||
$ct=array('1'=>'2','3'=>'4');
|
|
||||||
$ct=json_encode($ct);
|
|
||||||
$redis->hset($rpath,'CT',$ct);
|
|
||||||
|
|
||||||
**/
|
|
||||||
/**
|
|
||||||
$auth=array('remix_userid'=>"22770140",'remix_userkey'=>"1e8f326d20604ada541b4f3a67d19946",'siteLanguageV2'=>'zh','selectedSiteMode'=>'books');
|
|
||||||
$url='http://bookszlibb74ugqojhzhg2a63w5i2atv5bqarulgczawnbmsb6s6qead.onion/dl/7228066/aa9a95';
|
|
||||||
$return=Http::withProxy('socks5h://10.1.5.2:19100')->withCookies($auth,'bookszlibb74ugqojhzhg2a63w5i2atv5bqarulgczawnbmsb6s6qead.onion')->head($url);
|
|
||||||
|
|
||||||
$size=round(($return->header('Content-Length')/1048576),2);
|
|
||||||
if($size>=30){
|
|
||||||
echo "Too Large";
|
|
||||||
}
|
|
||||||
if($return->header('Content-Type')=='text/html; charset=UTF-8'){
|
|
||||||
echo "Error 404";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo("\n");
|
|
||||||
print_r($return->headers());
|
|
||||||
**/
|
|
||||||
|
|
||||||
$af= <<<EOF
|
|
||||||
attachment; filename="How to:如何不切实际地解决实际问题(What if作者新作!比尔·盖茨推荐他每一本书!百万级畅销书作者、全球科普网红兰道尔·门罗超大脑洞来袭!)... (z-lib.org).epub";filename*=utf-8''How%20to%EF%BC%9A%E5%A6%82%E4%BD%95%E4%B8%8D%E5%88%87%E5%AE%9E%E9%99%85%E5%9C%B0%E8%A7%A3%E5%86%B3%E5%AE%9E%E9%99%85%E9%97%AE%E9%A2%98%EF%BC%88What%20if%E4%BD%9C%E8%80%85%E6%96%B0%E4%BD%9C%EF%BC%81%E6%AF%94%E5%B0%94%C2%B7%E7%9B%96%E8%8C%A8%E6%8E%A8%E8%8D%90%E4%BB%96%E6%AF%8F%E4%B8%80%E6%9C%AC%E4%B9%A6%EF%BC%81%E7%99%BE%E4%B8%87%E7%BA%A7%E7%95%85%E9%94%80%E4%B9%A6%E4%BD%9C%E8%80%85%E3%80%81%E5%85%A8%E7%90%83%E7%A7%91%E6%99%AE%E7%BD%91%E7%BA%A2%E5%85%B0%E9%81%93%E5%B0%94%C2%B7%E9%97%A8%E7%BD%97%E8%B6%85%E5%A4%A7%E8%84%91%E6%B4%9E%E6%9D%A5%E8%A2%AD%EF%BC%81%EF%BC%89...%20%28z-lib.org%29.epub
|
|
||||||
EOF;
|
|
||||||
|
|
||||||
$filerealname=explode('"',explode(";",$af)[1])[1];
|
|
||||||
print_r($filerealname);
|
|
Loading…
Reference in New Issue
Block a user