Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* READ ME!
- /* Required on file : wget, php5.6 - 7.1 [ cli ]
- /* Created By 0xCor3 | Security Ghost
- /* Thanks For Stackoverflow.com && Security Ghost */
- 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);
- }
- $baseUrl = 'https://www.googleapis.com/youtube/v3/';
- // https://developers.google.com/youtube/v3/getting-started
- $apiKey = 'AIzaSyA5vOzQg5uXEjEz3eLiahKrIvTcFpc7G8A';
- // If you don't know the channel ID see below
- $channelId = 'UCfMcMOvgflhwW3FQtLosn7Q';
- $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 = $rem[1];
- $t = $rem[0];
- echo $z++."). ".$linkid." => ".$l."<br>";
- system("wget --max-redirect 1 -c $l -O $t.m4a");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement