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

Commit

Permalink
Removed deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Jul 28, 2017
1 parent 5ce729f commit 8c3daa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 55 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Removed

- **Breaking** method `SignatureDecipher::downloadPlayerScript()` was removed, use `SignatureDecipher::downloadRawPlayerScript()` instead
- **Breaking** method `SignatureDecipher::decipherSignature()` was removed, use `SignatureDecipher::decipherSignatureWithRawPlayerScript()` instead

## [0.3] - 2017-07-28

### Added
Expand Down
55 changes: 0 additions & 55 deletions src/SignatureDecipher.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,6 @@ public static function downloadRawPlayerScript($playerURL)
);
}

/**
* download the raw player script with cache
*
* @deprecated since version 0.3, to be removed in 0.4. Use SignatureDecipher::downloadRawPlayerScript() instead
*
* @param string $videoID
* @return string returns the playerID
*/
public static function downloadPlayerScript($videoID)
{
@trigger_error(__METHOD__ . ' is deprecated since version 0.3, to be removed in 0.4. Use SignatureDecipher::downloadRawPlayerScript() instead', E_USER_DEPRECATED);

$player_info = static::getPlayerInfoByVideoId($videoID);

$playerID = $player_info[0];
$playerURL = $player_info[1];

if(!file_exists('cache/playerscript_' . $playerID)) {
$decipherScript = self::downloadRawPlayerScript($playerURL);
file_put_contents('cache/playerscript_' . $playerID, $decipherScript);
}

return $playerID;
}

/**
* decipher a signature with a raw player script
*
Expand Down Expand Up @@ -159,36 +134,6 @@ public static function decipherSignatureWithRawPlayerScript($decipherScript, $si
return $decipheredSignature;
}

/**
* decipher a signature
*
* @deprecated since version 0.3, to be removed in 0.4. Use SignatureDecipher::decipherSignatureWithRawPlayerScript() instead
*
* @param string $playerID
* @param string $signature
* @return string returns the decipherd signature
*/
public static function decipherSignature($playerID, $signature)
{
@trigger_error(__METHOD__ . ' is deprecated since version 0.3, to be removed in 0.4. Use SignatureDecipher::decipherSignatureWithRawPlayerScript() instead', E_USER_DEPRECATED);

if(!$playerID) return;

if(file_exists("cache/playerscript_$playerID"))
{
$decipherScript = file_get_contents("cache/playerscript_$playerID");
}
else
{
die("\n==== Player script was not found for id: $playerID ====");
}

return static::decipherSignatureWithRawPlayerScript(
$decipherScript,
$signature
);
}

private static function executeSignaturePattern($patterns, $deciphers, $signature)
{
echo("\n\n\n==== Retrieved deciphers ====\n\n");
Expand Down

0 comments on commit 8c3daa1

Please sign in to comment.