Closed ahm786 closed 6 years ago
It seems that youtube has updated their signature script..
Yea seems like it. Do you think the issue can be fixed?
I still waiting until the pull request getting merged.. The new update is by adding this line
case 'var c=a[0];a[0]=a[b%a.length];a[b%a.length]=c':
$c = $processSignature[0];
$processSignature[0] = $processSignature[$number%count($processSignature)];
$processSignature[$number%count($processSignature)] = $c;
$logger->debug(
'{method}: (Swapping array)',
['method' => __METHOD__]
);
break;
After line 306
Thanks! I added that code and the issue was fixed, however now the problem is that most of the cipher videos show permission error.
Hmm.. Btw, I found that this code is called more than once as it download youtube video page and can lead to execution timeout
It should be called once but I'm not sure where to place it after the restructuring by @Art4 ..
Temporary fix for above issue by replacing
with
if (isset($this->raw_data['s']) and $this->config['decipher_signature']) {
// TODO: Remove signature decipher from Format
$videoIds = $this->getCache()->get('videoIds', null);
if(!$videoIds) $videoIds = [];
if(!in_array($this->getVideoId(), $videoIds)) {
$videoIds[] = $this->getVideoId();
$this->getCache()->set('videoIds', $videoIds, 3600*24);
$player_info = SignatureDecipher::getPlayerInfoByVideoId($this->getVideoId());
$playerID = $player_info[0];
$playerURL = $player_info[1];
$this->getCache()->set('playerID', [$playerID, $playerURL], 3600*24);
}
else {
$playerID = $this->getCache()->get('playerID', null);
if($playerID){
$playerURL = $playerID[1];
$playerID = $playerID[0];
} else {
$this->getCache()->set('videoIds', false, 3600*24);
$this->getCache()->set('playerID', false, 3600*24);
return $this->parseUrl();
}
}
$cache_key = 'playerscript_' . $playerID;
$opcode = $this->getCache()->get($cache_key, null);
if ($opcode === null) {
$opcode = SignatureDecipher::downloadRawPlayerScript($playerURL);
$opcode = json_encode(SignatureDecipher::extractDecipherOpcode($opcode, $this->getLogger()));
$this->getCache()->set($cache_key, $opcode, 3600*24);
}
$opcode = json_decode($opcode, true);
$sig = SignatureDecipher::executeSignaturePattern(
$opcode['decipherPatterns'],
$opcode['deciphers'],
$this->raw_data['s'],
$this->getLogger()
);
if (strpos($this->raw_data['url'], 'ratebypass=') === false) {
$this->raw_data['url'] .= '&ratebypass=yes';
}
$signature = '&signature=' . $sig;
}
Thanks! I've replaced it. Now the only issue is that the download link of cipher videos are showing permission error. Before it would work fine :(
Edit: it only happens with a few videos such as https://youtu.be/fv9kIkgt9so
Same here, I have changed with the "temporary" update code above but still show only "==== Decipher dictionary was not found ===="
@chadul this update should work #309
@ahm786 Hmm, I have no problem on my localhost. Can you try clear the cache folder?
@StefansArya I saw its not yet ready
You could download it from my fork
Hello,
I've checked this last version but it works on locale but not on server. Either using getvideo.php or index.php 0 byte file is retrieved.
Fixed with #309
Description
It seems like there's an issue with the signature decipher. Whenever I want to download a cipher video, it returns the following error:
"==== Decipher dictionary was not found ===="
I can confirm that the latest playerscript file is downloaded in cache, so there's an issue with the code.
@StefansArya @Art4 Do you know what is causing this problem?
Steps to Reproduce
Try downloading a cipher video, such as:
https://www.youtube.com/watch?v=lvs68OKOquM
Expected behavior: Fetch download links
Actual behavior: Returns error: ==== Decipher dictionary was not found ====
Version
0.7-dev
Additional Information
Server info: NGINX, Ubuntu 17, PHP7.1