���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/vidoe.top/vendor/athlon1600/youtube-downloader/src/ |
<?php namespace YouTube; use YouTube\Models\StreamFormat; use YouTube\Responses\PlayerApiResponse; use YouTube\Responses\VideoPlayerJs; use YouTube\Utils\Utils; class PlayerResponseParser { /** * @var PlayerApiResponse */ private $response; /** @var VideoPlayerJs */ protected $videoPlayerJs; protected function __construct(PlayerApiResponse $response) { $this->response = $response; } public static function createFrom(PlayerApiResponse $playerApiResponse) { return new static($playerApiResponse); } public function setPlayerJsResponse(VideoPlayerJs $videoPlayerJs) { $this->videoPlayerJs = $videoPlayerJs; } /** * @return StreamFormat[] */ public function parseLinks($signatureDecrypter = null) { $formats_combined = $this->response->getAllFormats(); // final response $return = array(); foreach ($formats_combined as $format) { // appear as either "cipher" or "signatureCipher" $cipher = Utils::arrayGet($format, 'cipher', Utils::arrayGet($format, 'signatureCipher', '')); // some videos do not need to be decrypted! if (isset($format['url'])) { $return[] = new StreamFormat($format); continue; } $cipherArray = Utils::parseQueryString($cipher); $url = Utils::arrayGet($cipherArray, 'url'); $sp = Utils::arrayGet($cipherArray, 'sp'); // used to be 'sig' $signature = Utils::arrayGet($cipherArray, 's'); $streamUrl = new StreamFormat($format); if ($this->videoPlayerJs) { $decoded_signature = (new SignatureDecoder())->decode($signature, $this->videoPlayerJs->getResponseBody()); $decoded_url = $url . '&' . $sp . '=' . $decoded_signature; $streamUrl->url = $decoded_url; } else { $streamUrl->url = $url; } $return[] = $streamUrl; } return $return; } }