Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* READ ME!
- /* Required Tools on This Script : wget, php5.6 - 7.1 [ cli ]
- /* Created By 0xCor3 | Security Ghost
- /* Thanks For Stackoverflow.com && Security Ghost */
- system("clear");
- $m="\033[1;31m";
- $k="\033[1;33m";
- $h="\033[1;32m";
- $b="\033[1;34m";
- $baseUrl = 'https://www.googleapis.com/youtube/v3/';
- $apiKey = 'AIzaSyA5vOzQg5uXEjEz3eLiahKrIvTcFpc7G8A';
- function banner(){
- echo "\t=====================================\n";
- echo "\t= MAZTER YOUTUBE M4A =\n";
- echo "\t= FROM CHANNEL DOWNLOADER =\n";
- echo "\t= By 0xCor3 | Security Ghost =\n";
- echo "\t=====================================\n";
- }
- function Grabmp3($id){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "http://saveitoffline.com/process/?url=https://www.youtube.com/watch?v=".$id."&type=json");
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
- $ex = curl_exec($ch);
- $gLink = json_decode($ex);
- $title = $gLink->title;
- $dl = $gLink->urls[19]->id;
- $hm = $title."|".$dl;
- return($hm);
- }
- function loadz($url){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
- $ex = curl_exec($ch);
- curl_close($ch);
- return($ex);
- }
- function GInfo($apiKey,$channelId){
- $m="\033[1;31m";
- $k="\033[1;33m";
- $h="\033[1;32m";
- $b="\033[1;34m";
- $r = loadz("https://www.googleapis.com/youtube/v3/channels?part=snippet&id={$channelId}&key={$apiKey}");
- $dcd = json_decode($r);
- if(preg_match("/description/i", $r)){
- $title = $dcd->items[0]->snippet->title;
- $curl = $dcd->items[0]->snippet->customUrl;
- $desc = $dcd->items[0]->snippet->description;
- }else{
- echo $m."Channel Not FOUND Exiting...\n";
- sleep(3);
- exit();
- }
- $banner = "{$h}\n\n";
- $banner.= "= Channel Name : ".$k.$title.$h."\n";
- $banner.= "= Channel URL : {$b}https://www.youtube.com/c/".$curl.$h."\n";
- $banner.= "+++++++++++ Channel Description ++++++++++\n";
- $banner.= $m.$desc.$h."\n";
- $banner.= "++++++++++++++++++++++++++++++++++++++++++\n";
- $banner.= "\n\n";
- return($banner);
- }
- banner()."\n";
- echo "Channel ID : "; $channelId = trim(fgets(STDIN));
- echo GInfo($apiKey,$channelId);
- echo "Lanjut ? (y/n) : "; $lanjut = trim(fgets(STDIN));
- if($lanjut == "y"){
- $params = [
- 'id'=> $channelId,
- 'part'=> 'contentDetails',
- 'key'=> $apiKey
- ];
- $url = $baseUrl . 'channels?' . http_build_query($params);
- $json = json_decode(loadz($url), true);
- $playlist = $json['items'][0]['contentDetails']['relatedPlaylists']['uploads'];
- $params = [
- 'part'=> 'snippet',
- 'playlistId' => $playlist,
- 'maxResults'=> '50',
- 'key'=> $apiKey
- ];
- $url = $baseUrl . 'playlistItems?' . http_build_query($params);
- $json = json_decode(loadz($url), true);
- $videos = [];
- foreach($json['items'] as $video)
- $videos[] = $video['snippet']['resourceId']['videoId'];
- while(isset($json['nextPageToken'])){
- $nextUrl = $url . '&pageToken=' . $json['nextPageToken'];
- $json = json_decode(loadz($nextUrl), true);
- foreach($json['items'] as $video)
- $videos[] = $video['snippet']['resourceId']['videoId'];
- }
- $z = 1;
- foreach ($videos as $linkid) {
- $rem = explode("|",Grabmp3($linkid));
- $l = trim($rem[1]);
- $t = trim($rem[0]);
- echo $k.$z++."). ".$k.$linkid." => ".$b.$t."\n";
- }
- echo $k."Download All? (y/n) : ".$h; $dls = trim(fgets(STDIN));
- if($dls == "y"){
- foreach ($videos as $linkid){
- echo $k.$z++."). ".$k.$linkid." => ".$b.$t."\n";
- system("wget -O '$t.m4a' --trust-server-names '$l'");
- }
- }else{
- echo $m."Okay, Iam Done. Exiting \n";
- sleep(1);
- exit();
- }
- }else{
- echo $m."Okay, Exiting....\n";
- sleep(2);
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement