Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
Fixed YT download
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3-822 committed Feb 3, 2019
1 parent 0f11b6c commit d174d68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hosts/download/youtube_com.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ private function getCipher() {
//if (($spos = strpos($this->playerJs, '.sig||')) === false) $this->decError('Not found (".sig||")');
//if (($cut1 = cut_str(substr($this->playerJs, $spos), '{', '}')) == false) $this->decError('Cannot get inner content of "if(X.sig||X.s)"');
$v = '[\$_A-Za-z][\$\w]*';
if (!preg_match("@(?:\.sig\|\||\.set\(\"signature\",|\|\"signature\",|$v\.sp,)(?:\(0,$v(?:\.$v)*\)\()?($v)\((?:\(0,$v(?:\.$v)*\)\()?$v\.s\)@", $this->playerJs, $fn)) $this->decError('Cannot get decoder function name');
$v3 = '[\$_A-Za-z][\$\w]{3,}';
if (!preg_match("@(?:\.sig\|\||\.set\(\"signature\",|\|\"signature\",|$v\.sp,)(?:\(0,$v(?:\.$v)*\)\(|$v3\()?($v)\((?:\(0,$v(?:\.$v)*\)\(|$v3\()?$v\.s\)@", $this->playerJs, $fn)) $this->decError('Cannot get decoder function name');
$fn = preg_quote($fn[1], '@');
if (!preg_match("@(?:function\s+$fn\s*\(|var\s+$fn\s*=\s*function\s*\(|(?<=(?:{|,|;))\s*$fn\s*=\s*function\s*\()@", $this->playerJs, $fpos, PREG_OFFSET_CAPTURE)) $this->decError('Cannot find decoder function');
$fpos = $fpos[0][1];
Expand Down Expand Up @@ -354,4 +355,4 @@ private function QSelector() {
// [30-8-2016] Fixed slow speed while downloading DASH streams. - Th3-822
// [30-4-2017] Fixed signature decoding functions. - Th3-822
// [25-1-2018] Fixed get_video_info. - Th3-822
// [09-11-2018] Fixed signature decoding functions. - Th3-822
// [03-2-2019] Fixed signature decoding functions. - Th3-822

0 comments on commit d174d68

Please sign in to comment.