/**
* Downloads a snap.
*
* @param string $id
* The snap ID.
*
* @return mixed
* The snap data or FALSE on failure.
*/
public function getMedia($id)
{
// Make sure we're logged in and have a valid access token.
if (!$this->auth_token || !$this->username) {
return FALSE;
}
$timestamp = parent::timestamp();
$result = parent::post('/blob', array('id' => $id, 'timestamp' => $timestamp, 'username' => $this->username), array($this->auth_token, $timestamp));
if (parent::isMedia(substr($result, 0, 2))) {
return $result;
} else {
$result = parent::decryptECB($result);
if (parent::isMedia(substr($result, 0, 2))) {
return $result;
}
}
return FALSE;
}