Merge branch 'master' of https://github.com/danog/MadelineProto
This commit is contained in:
commit
4ee12321a0
@ -138,6 +138,7 @@ class MTProto
|
|||||||
if (method_exists($elem, 'wakeup')) $this->datacenter->sockets[$key] = $elem->wakeup();
|
if (method_exists($elem, 'wakeup')) $this->datacenter->sockets[$key] = $elem->wakeup();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
$this->getting_state = false;
|
||||||
$this->bigint = PHP_INT_SIZE < 8;
|
$this->bigint = PHP_INT_SIZE < 8;
|
||||||
$this->reset_session();
|
$this->reset_session();
|
||||||
if (!isset($this->v) || $this->v !== $this->getV()) {
|
if (!isset($this->v) || $this->v !== $this->getV()) {
|
||||||
@ -295,8 +296,8 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'app_info' => [ // obtained in https://my.telegram.org
|
'app_info' => [ // obtained in https://my.telegram.org
|
||||||
'api_id' => 65536,
|
'api_id' => 2496,
|
||||||
'api_hash' => '4251a2777e179232705e2462706f4143',
|
'api_hash' => '8da85b0d5bfe62527e5b244c209159c3',
|
||||||
'device_model' => $device_model,
|
'device_model' => $device_model,
|
||||||
'system_version' => $system_version,
|
'system_version' => $system_version,
|
||||||
'app_version' => 'Unicorn', // 🌚
|
'app_version' => 'Unicorn', // 🌚
|
||||||
|
@ -266,6 +266,9 @@ trait Files
|
|||||||
$theend = false;
|
$theend = false;
|
||||||
$cdn = false;
|
$cdn = false;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
if ($resto = $offset % $part_size) {
|
||||||
|
$offset -= $resto;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$res = $cdn ? $this->method_call('upload.getCdnFile', ['file_token' => $info['file_token'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]) : $this->method_call('upload.getFile', ['location' => $info['InputFileLocation'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]);
|
$res = $cdn ? $this->method_call('upload.getCdnFile', ['file_token' => $info['file_token'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]) : $this->method_call('upload.getFile', ['location' => $info['InputFileLocation'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]);
|
||||||
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
||||||
@ -305,6 +308,9 @@ trait Files
|
|||||||
if (isset($info['key'])) {
|
if (isset($info['key'])) {
|
||||||
$res['bytes'] = $ige->decrypt($res['bytes']);
|
$res['bytes'] = $ige->decrypt($res['bytes']);
|
||||||
}
|
}
|
||||||
|
if ($resto) {
|
||||||
|
$res['bytes'] = substr($res['bytes'], $resto);
|
||||||
|
}
|
||||||
if ($end !== -1 && strlen($res['bytes']) + $downloaded_size >= $size) {
|
if ($end !== -1 && strlen($res['bytes']) + $downloaded_size >= $size) {
|
||||||
$res['bytes'] = substr($res['bytes'], 0, $size - $downloaded_size);
|
$res['bytes'] = substr($res['bytes'], 0, $size - $downloaded_size);
|
||||||
$theend = true;
|
$theend = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user