Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function cget($lvn){
- if(isset($_GET[$lvn]))
- return $_GET[$lvn];
- else
- return "";
- }
- $gd="";$ref1=!1;
- if(isset($_SERVER["HTTP_REFERER"])&&strpos($ref1=$_SERVER["HTTP_REFERER"],"/gd.d")==6)$gd="gd.";
- header("Access-Control-Allow-Origin: http://".$gd."dreamoftranscendence.x10host.com");
- $mime1=cget("m2");
- if(!strlen($mime1))
- $mime1="text/html;charset=utf-8";
- if(($_cej1=($_ce1=cget("ce"))=="js")||($rjs_=isset($_GET["rjs"])))$mime1="text/javascript;charset=utf-8";
- header("Content-Type: ".$mime1);
- function s_page($ti0,$b0dy){
- return "<!Doctype html><html><head><meta content='text/html; charset=utf-8' http-equiv='Content-Type'/><title>".$ti0."</title></head><body>".$b0dy."</body></html>";
- }
- $rd1_='{"is":"f.php","exists":!0}';
- if($_ce1=="html"){
- if((!($orig=cget("or")))&&$ref1) $orig=substr($ref1,4,strpos($ref1,"/",9)-4); else $orig="://dreamoftranscendence.x10host.com";
- exit(s_page("check existence iframe",'<script type="text/javascript">var pos=function(or_,i){try{self.top.postMessage('.$rd1_.',or_);}catch(e){if(!i)pos("http://main.xfiddle.com",!0);}};if(self!=self.top)pos("http'.$orig.'");</script>'));
- }else if($_cej1)exit('if(typeof self.got_it_01=="function")self.got_it_01('.$rd1_.');');
- if(strlen(cget("r2"))>0){
- header("Cache-Control: max-age=172800");
- header("Location: http".cget("r2"));
- exit;
- }
- $shwo=cget("shwo");
- $agent= "Mozilla/5.0 (Windows NT 8.1; WOW64; Trident/7.0; rv:11.0) like Gecko";
- function sset_curl($dat,$url1){
- global $agent;
- curl_setopt($dat,CURLOPT_SSL_VERIFYPEER,false);
- curl_setopt($dat,CURLOPT_RETURNTRANSFER,true);
- curl_setopt($dat,CURLOPT_USERAGENT,$agent);
- curl_setopt($dat,CURLOPT_VERBOSE,true);
- curl_setopt($dat,CURLOPT_HTTPGET,true);
- curl_setopt($dat,CURLOPT_ENCODING,"gzip");
- if(strlen($url1)>2)
- curl_setopt($dat,CURLOPT_URL, $url1);
- }
- function gurl($es,$bf,$af){
- $es="\x02".$es;
- $sp1=strpos($es,$bf);
- $fe_s=substr($es,$sp1+strlen($bf));
- $sp2=strpos($fe_s,$af);
- if($sp1 && $sp2)
- return substr($fe_s,0,$sp2);
- else
- return "";
- }
- function gurli($es,$bf,$af){
- $es="\x02".$es;
- $sp1=stripos($es,$bf);
- $fe_s=substr($es,$sp1+strlen($bf));
- $sp2=stripos($fe_s,$af);
- if($sp1 && $sp2)
- return substr($fe_s,0,$sp2);
- else
- return "";
- }
- $acc01="en-US";
- function load_curl($url,$extra_h,$bdy){
- global $agent, $acc01;
- $h0st=gurl($url,"://","/");
- $harr=["Accept"=>"text/html, application/xhtml xml, image/jxr, */*",
- "Accept-Encoding"=>"gzip, deflate",
- "Accept-Language"=>$acc01,
- "Host"=>$h0st,
- "User-Agent"=>$agent];
- $if0=gettype($extra_h)=="array";
- if($if0)
- $harr=array_merge($harr, $extra_h);
- $g1=curl_init();
- sset_curl($g1,$url);
- if($bLn=strlen($bdy)){
- if(!isset($harr["Content-Length"])) $harr["Content-Length"]=$bLn;
- curl_setopt($g1,CURLOPT_HTTPGET,false);
- curl_setopt($g1,CURLOPT_POST,!0);
- curl_setopt($g1,CURLOPT_POSTFIELDS,$bdy);
- }
- $i0=0;
- $harr2=[];
- foreach($harr as $n1 => $v1){
- $harr2[$i0]=$n1.": ".$v1;
- $i0++;
- }
- curl_setopt($g1, CURLOPT_COOKIESESSION, true);
- curl_setopt($g1, CURLOPT_BINARYTRANSFER,true);
- curl_setopt($g1, CURLOPT_HEADER, true);
- curl_setopt($g1, CURLOPT_HTTPHEADER, $harr2);
- curl_setopt($g1, CURLOPT_FRESH_CONNECT, true);
- $fdat01=curl_exec($g1);
- $hl1=curl_getinfo($g1, CURLINFO_HEADER_SIZE);
- curl_close($g1);
- $hed1=substr($fdat01, 0, $hl1);
- $b0dy=substr($fdat01, $hl1);
- if((strlen($b0dy)-gurli($hed1,"content-length: ","\r\n"))==2) $b0dy=substr($b0dy,2);
- /*if($blen=strlen($b0dy) && gurli($hed1, "\r\nContent-Encoding: ", "\r\n")=="gzip")
- $b0dy=gzinflate($b0dy, $blen*/
- $r00=[$hed1, $b0dy, $url];
- if($if0)
- $r00[3]=$extra_h;
- return $r00;
- }
- function s_cuk($v,$dn,$pt,$nd){
- header("Set-Cookie: ".$v."; Expires=".date("D, j-M-Y H:i:s", time()+round(86400*$nd))." GMT; Path=/".$pt."; Domain=".$dn.";");
- }
- function strinclude($str){
- $fi=fopen($p_="temp_".rand (1,1000).".txt","w");
- fwrite($fi,$str);
- fclose($fi);
- include $p_;
- unlink($p_);
- }
- $gdfg_c=0;
- function gdfg($gfi,$i){
- global $gdfg_c,$shwo;
- $pp1="https://docs.google.com/uc?";
- $rfu=load_curl($pp1."id=".$gfi."&export=download", "","");
- if(substr($shwo,3)*1==$gdfg_c&&substr($shwo,0,3)=="gfg")
- exit("got: ".$rfu[2]."\x0D\x0A".$rfu[0].$rfu[1]);
- if(strpos($rfu[1],"<title>Go"."og"."le Drive - Virus scan warning</title>")||gurl($rfu[0], "\x20", "\x20")=="500"){
- $ku=gurli($rfu[0],"set-cookie: ", ";");
- if(strlen($ku))
- $ku=["Cookie"=>$ku];
- $rfu=load_curl($pp1.gurl($rfu[1], 'href="/uc?', '"'), $ku,"");
- }
- $rfu=load_curl(gurli($rfu[0],"\r\nlocation: ", "\r\n"), "","");
- if(substr($shwo,4)*1==$gdfg_c&&substr($shwo,0,4)=="grfg")
- exit("got: ".$rfu[2]."\x0D\x0A".$rfu[0].$rfu[1]);
- $tbp=strpos($rfu[1],"~*tbar*~");
- if($tbp)
- $rfu[1]=str_replace("~*tbar*~", file_get_contents("../t_bar.html"), $rfu[1]);
- $gdfg_c++;
- if($i)
- strinclude($rfu[1]);
- else
- return $rfu;
- }
- $ggb_p_00="0Bxb5iFgmM3V6SS1QQlZBS0w0bGc";
- $r_p1=[$_SERVER["SERVER_NAME"],$_SERVER["REQUEST_URI"]];
- if(substr($r_p1[1],0,6)!="/f.php")
- $fp_includenorun=!0;
- if(isset($fp_includenorun)){ gdfg($ggb_p_00,1); goto ending; }
- $main_c=function(){
- global $agent, $g004, $ggb_p_00, $g0, $cukie, $ggb_true, $shwo,$r_p1;
- gdfg("0Bxb5iFgmM3V6dDJsQUdGN3V2OUU",1); //stor
- $SS_r_cache=f_parse();
- if($shwo=="cache"){
- var_dump($SS_r_cache);
- exit;
- }
- $nm=cget("f");
- $fes=strpos($r_p1[1],".php/");
- if(!strlen($nm) && $fes){
- $nm="/".substr($r_p1[1],$fes+5);
- if($qui=strpos($nm,"?"))
- $nm=substr($nm,0,$qui);
- $nm=urldecode($nm);
- }
- $url_par_ex="<br>Available URL Params:\n<br> f: the file name of a file stored on Google drive (Letter Case needs to match) a / and the file name will also work\n<br> m2: specify an alternate content-type header\n<br> fid: folder id of Google drive folder that file is stored in (you can use sub-directory paths but the root directory must be specified).\n<br> cg: (complete get) use this if you want the file output directly instead of redirecting to the Google drive download link\n<br> shwo: in case of error, show fetched content at various stages\n<br>r2: redirect (302) to specified url\n<br>rjs: return file path in javascript format.";
- if(!strlen($nm))
- exit(s_page("f.php", "Please put the \"f\" param in the url.".$url_par_ex));
- if($nm[0]!="/")
- $nm="/".$nm;
- $nm=str_replace ("//","/",$nm);
- $tree_1=explode("/",$nm);
- $lev_0=0;
- if($tree_1==["",""])
- $nm2="index.html";
- else
- $tree_1=array_slice($tree_1,1);
- $nm2=$tree_1[$lev_0];
- $tl_1=count($tree_1);
- if($tree_1[$tl_1-1]=="") $tree_1[$tl_1-1]="index.html";
- $c_var01="nm_".base64_encode($nm);
- if(isset($SS_r_cache[$c_var01])){
- $g004=[$SS_r_cache[$c_var01], $tree_1[$tl_1-1]];
- goto endy;
- }
- $s_pos01=strpos(strrev($nm), "/");
- $nm5=substr($nm,0,strlen($nm)-$s_pos01);
- if($nm5[0]!="/")
- $nm5="/".$nm5;
- $mn_gd_fr=cget("fid");
- if(isset($SS_r_cache["fid".$nm5]) && !strlen($mn_gd_fr) && !isset($_GET["f"])){
- $mn_gd_fr=$SS_r_cache["fid".$nm5];
- $nm2=$tree_1[$tl_1-1];
- }
- if(!strlen($mn_gd_fr))
- $mn_gd_fr="0Bxb5iFgmM3V6VkUtdVU1eWV4ZWs"; //mn gd fr (main googledrive folder)
- $cukie=[];
- gdfg($ggb_p_00,1);
- if(isset($SS_r_cache["KEY"])){
- $unglobd=$SS_r_cache["KEY"];
- goto fload;
- }
- $res_1=load_curl("https://drive.google.com/open?id=".$mn_gd_fr, "", "");
- if($shwo=="1")
- exit($res_1[0]."\n".$res_1[1]);
- $res_1=re_302($res_1);
- couki($res_1);
- $hds1=$res_1[0];
- $fdat1=$res_1[1];
- if(stripos($hds1, "\r\nLocation: "))
- exit(s_page("Error: ", "Error, 302 manys."));
- if($shwo=="2")
- exit("R_times = ".$res_1["re_dir"]."<br>\n".$hds1."\n".$fdat1);
- if(stripos($fdat1, "<html>") < 20)
- $d_name=gurli($fdat1, "<title>", "</title>");
- if(!strpos($fdat1, "__initData"))
- exit(s_page("Error", "Error, no key ring."));
- $dataGlob01=gurl($fdat1, "__initData", "\x0A;");
- if($shwo=="DataGlob")
- exit("//<script type='text/javascript'>\x0Aself.__initData".$dataGlob01."\x0Aif(typeof self.got_it_01=='function')\x0Aself.got_it_01(__initData); //</script>");
- $unglob01=explode('https://client-channel.'.$g0.'.com/client-channel/client', $dataGlob01);
- $unglob02=strrev(clunch(strrev($unglob01[0]),"[","]")).clunch($unglob01[1],"]","[");
- $unglob02=str_replace('""','',$unglob02);
- if($shwo=="Globby")
- exit($unglob02);
- $unglob02=explode('"',$unglob02);
- $ug2_l=count($unglob02);
- $unglb_r=0;
- while(!isset($unglobd) && $unglb_r < $ug2_l){
- $_dis=$unglob02[$unglb_r];
- if(strlen($_dis) > 15)
- if($_dis[0]=="A")
- $unglobd=$_dis;
- $unglb_r++;
- }
- if(!isset($unglobd))
- exit(s_page("Error", "No key to fit the lock."));
- $SS_r_cache["KEY"]=$unglobd;
- fload:
- if($shwo=="unGlobd")
- exit($unglobd);
- $pth01="https://clients6.google.com/drive/v2beta/files?openDrive=true&reason=102&syncType=0&errorRecovery=false&q=trashed%20%3D%20false%20and%20'".$mn_gd_fr."'%20in%20parents&fields=kind%2CnextPageToken%2Citems(kind%2Ctitle%2CmimeType%2CcreatedDate%2CmodifiedDate%2CmodifiedByMeDate%2ClastViewedByMeDate%2CfileSize%2ClastModifyingUser(kind%2C%20displayName%2C%20picture%2C%20permissionId%2C%20emailAddress)%2ChasThumbnail%2CthumbnailVersion%2CiconLink%2Cid%2Cshared%2CsharedWithMeDate%2CuserPermission(role)%2CexplicitlyTrashed%2CquotaBytesUsed%2Cshareable%2Ccopyable%2CfileExtension%2CsharingUser(kind%2CdisplayName%2Cpicture%2CpermissionId%2CemailAddress)%2Cspaces%2Ceditable%2Cversion%2CteamDriveId%2ChasAugmentedPermissions%2CtrashingUser(kind%2CdisplayName%2Cpicture%2CpermissionId%2CemailAddress)%2CtrashedDate%2Cparents(id)%2Clabels(starred%2Chidden%2Ctrashed%2Crestricted%2Cviewed)%2Cowners(permissionId%2CdisplayName%2Cpicture%2Ckind)%2Ccapabilities(canCopy%2CcanDownload%2CcanEdit%2CcanAddChildren%2CcanDelete%2CcanRemoveChildren%2CcanShare%2CcanTrash%2CcanRename%2CcanReadTeamDrive%2CcanMoveTeamDriveItem))%2CincompleteSearch&appDataFilter=NO_APP_DATA&spaces=DRIVE&maxResults=150&orderBy=folder%2Ctitle%20asc&key=".$unglobd;
- $eh1=["Origin"=>"https://drive.google.com", "Referer"=>"https://drive.google.com/drive/folders/".$mn_gd_fr, "Accept"=>"*/*"]; //"x-goog-authuser"=>"0"
- $ic01=if_cuk($pth01);
- if(strlen($ic01))
- $eh1["Cookie"]=$ic01;
- $res_2=load_curl($pth01, $eh1,'');
- $res_2=re_302($res_2);
- couki($res_2);
- if(stripos($res_2[0], "\r\nLocation: "))
- exit(s_page("Error: ", "Error, 302 manys."));
- $fldr_dat=json_decode($res_2[1],!0);
- //bad code:
- while(isset($fldr_dat["nextPageToken"])){
- $pth01.="&pageToken=".$fldr_dat["nextPageToken"];
- $ic01=if_cuk($pth01);
- if(strlen($ic01))
- $eh1["Cookie"]=$ic01;
- $res_3=load_curl($pth01, $eh1);
- $res_3=re_302($res_3);
- $fldr_dat2=json_decode($res_3[1],!0);
- $fldr_dat["items"]=array_merge($fldr_dat["items"],$fldr_dat2["items"]);
- if(isset($fldr_dat2["nextPageToken"])) $fldr_dat["nextPageToken"]=$fldr_dat2["nextPageToken"]; else unset($fldr_dat["nextPageToken"]);
- //$res_2[1]=substr($res_2[1], 0, -1).",".substr($res_3[1], 1);
- }
- //end bad code
- if($shwo=="JSON_".$lev_0)
- exit("/*".$res_2[0]."*//*\nself.got_url=\"".$res_2[2]."\"\nself.GDFs_1=".json_encode($fldr_dat).";\n//e: ");
- if(!isset($d_name) && $mn_gd_fr == "0Bxb5iFgmM3V6VkUtdVU1eWV4ZWs")
- $d_name="b0x{}^W@\x24";
- /*$nm3=str_replace('"', "\\u0022", $nm2);
- if(!strpos($res_2[1], $nm3)) */
- foreach($fldr_dat["items"] as $v){
- if($v["title"]==$nm2) $_file1_=$v;
- }
- if(!isset($_file1_)){
- //bad code 2:
- if($nm2=="index.html"||$nm2=="index.htm"||$nm2=="index.php"){
- $ti_="Index Of ".htmlentities($nm);
- $NDX_="<style>td,th{padding-left:10px;}</style><br>".$ti_."<br><table><tbody><tr><th></th><th>Name</th><th>Size (bytes)</th><th>Created On Date</th><th>Last Modified Date</th><th>Owner</th></tr>\r\n<tr><td></td><td><a href='../'>Parent Directory</a></td><td>0</td><td>. . .</td><td>. . .</td><td>. . .</td></tr>\r\n<tr><td></td><td><a href='/./f.php/'>Top Directory</a></td><td>0</td><td>. . .</td><td>. . .</td><td>. . .</td></tr>\r\n";
- foreach($fldr_dat["items"] as $v){
- $s_="";
- if($v["mimeType"]=="application/vnd.google-apps.folder"){ $SS_r_cache["fid".$nm5.$v["title"]]=$v["id"];
- $s_="/";
- }else $SS_r_cache["nm_".base64_encode($v["title"])]=$v["id"];
- if(!isset($v["fileSize"])) $v["fileSize"]=0;
- $NDX_.="<tr><td><img src='".$v["iconLink"]."'></td><td><a href='".$v["title"].$s_."'>".$v["title"]."</a></td><td>".$v["fileSize"]."</td><td>".$v["createdDate"]."</td><td>".$v["modifiedDate"]."</td><td>".$v["owners"][0]["displayName"]."</td>\r\n";
- }
- c_store($SS_r_cache);
- exit(s_page($ti_,$NDX_."</tbody></table>"));
- }else
- //end bad code 2 */
- exit(s_page("Error", "Error: \"$nm2\" not found in folder: \"".$mn_gd_fr."\" AKA \"".$d_name."\"".$url_par_ex));
- }
- //get file/folder id from drive
- $fid1=$_file1_["id"];
- if($_file1_["mimeType"]=="application/vnd.google-apps.folder"){
- $lev_0++;
- if($lev_0 > 12)
- exit(s_page("Error", "Error, too many sub dirs. Try using the \"fid\" parameter with the id of the folder the file you are looking for is in, and change the \"f\" parameter to only the file name."));
- if($lev_0 < $tl_1)
- $nm2=$tree_1[$lev_0];
- else
- $nm2="index.html";
- $d_name=$nm2;
- $mn_gd_fr=$fid1;
- unset($_file1_);
- goto fload;
- }
- $gc01=if_cuk("https://drive.google.com/");
- if(strlen($gc01))
- header("X-got-cookie: ".$gc01);
- if($tl_1 >1 && !isset($SS_r_cache["fid".$nm5]) && !isset($_GET["fid"])){
- $SS_r_cache["fid".$nm5]=$mn_gd_fr;
- }
- if(strlen($fid1) < 25)
- exit(s_page("Error", "Error, Unknown. ☹ :("));
- if(!isset($SS_r_cache[$c_var01]))
- $SS_r_cache[$c_var01]=$fid1;
- c_store($SS_r_cache);
- $g004=[$fid1, $nm2,$unglobd];
- endy:
- if(gurl($r_p1[1],".php/","?")=="Stor.php_act" && !strlen(cget("fid")))
- exit();
- };
- $main_c();
- unset($main_c);
- $grr2="https://docs.google.com/uc?id=".$g004[0]."&export=download";
- if($rjs_){
- if(cget("sdsc")*1){
- $res_='"odt":'.(load_curl("https://clients6.google.com/drive/v2beta/files/".$g004[0]."?fields=createdDate%2Cdescription%2Ckind&supportsTeamDrives=true&key=AIzaSyC1qbk75NzWBvSaDh6KnsjjA9pIrP4lYIE",["Origin"=>"https://drive.google.com", "Referer"=>"https://drive.google.com/file/d/".$g004[0]."/view"],"")[1]);
- }else $res_="";
- echo "self.fid_01={\"path\":\"".$grr2."\", \"name\":\"".$g004[1]."\"".$res_."};\r\nif(typeof self.got_it_01=='function')\r\nself.got_it_01(fid_01);";
- }elseif(!isset($_GET["dwnld"])){
- $pa=strpos("_".$g004[1],'.php_act');
- $ii=($pa&&strpos("_".$g004[1], '.')==$pa)&&(!isset($_GET["fid"]));
- if($ii&&(!$ggb_true))
- gdfg($ggb_p_00,1);
- $gro=gdfg($g004[0], $ii);
- if(!$ii)
- echo $gro[1];
- }
- else
- header("Location: ".$grr2);
- ending:
- 0;
- ?>
Add Comment
Please, Sign In to add comment