title; $videoAuthor = $video_info->author; $videoDurationSecs = $video_info->lengthSeconds; $videoDuration = secToDuration($videoDurationSecs); $videoChannel = $video_info->author; // Begin_ViewCount $extract_video_view = $video_info->viewCount; $videoViews = bytes($extract_video_view); // End_ViewCount // change hqdefault.jpg to default.jpg for downgrading the thumbnail quality $videoThumbURL = "https://i1.ytimg.com/vi/{$video_id}/hqdefault.jpg"; $librethumb = $video_info->videoThumbnails[0]->url; // Extract videos from JSON $streamFormats = $video_info->formatStreams; // Downloads $downloads = $video_info->formatStreams; // Breaking DRM!!! $url_drm = $streamFormats[0]->url; @$headers = get_headers($url_drm); if (preg_match('/^HTTP\/\d\.\d\s+(403)/', $headers[0])){ // Liberty data $breakquality = trim($streamFormats[0]->resolution, 'p'); $breakurl = "https://invidio.us/latest_version?id={$video_id}&itag=18&local=true"; $breaklink = << EOT; $downloadFormat = $downloads[0]->container; $downloadQuality = $streamFormats[0]->resolution; $breakdownload = <<
{$downloadFormat}
{$downloadQuality}
EOT; } else { $breaklink = ''; $breakdownload = ''; } // End Breaking DRM!!! // // Captions // $streamCaptions = $video_info->captions;