danog / MadelineProto

Async PHP client API for the telegram MTProto protocol
https://docs.madelineproto.xyz
GNU Affero General Public License v3.0
2.8k stars 636 forks source link

extract video thumbnails #965

Open morteza-rashidi opened 3 years ago

morteza-rashidi commented 3 years ago

I use this product to receive messages from public channels I extract text and video messages without any problems, but I have trouble extracting video messages. Unfortunately, I have trouble extracting video images(thumbnails)

Please help me how to do this

tanks

erfanmola commented 3 years ago

Unfortunately, I have trouble extracting video images(thumbnails)

What kind of problem or error are you facing ?

morteza-rashidi commented 3 years ago

I have no idea what to do

my code is

`require_once 'vendor/autoload.php'; $MadelineProto = new \danog\MadelineProto\API('session.madeline');

$MadelineProto->async(true); $MadelineProto->loop(function () use ($MadelineProto) { yield $MadelineProto->start(); $Messages = yield $MadelineProto->messages->getHistory(['peer' => "@channel", 'offset_id' => 0, 'offset_date' => 0, 'add_offset' => 0, 'limit' => 15, 'max_id' => 0, 'min_id' => 0, 'hash' => 0]); foreach ($Messages as $message){ yield $MadelineProto->downloadToFile($message, 'media/file.mp4'); /// download video /// /// ???????? extracting video images(thumbnails) ????? } });`

danog commented 2 years ago

This was implemented in a project based on MadelineProto, TelegramApiServer, will implement in MadelineProto as well: https://github.com/xtrime-ru/TelegramApiServer/issues/42 In the meantime, you can use the appropriate TAS method to fetch thumbnails.

theeosdev commented 4 months ago

Is there any progress on this issue?