Closed artin closed 4 years ago
Thumbs downloaded with hack after TL layer 100:
See sources of this method: https://github.com/xtrime-ru/TelegramApiServer/blob/7015691686d57cd3422567a498ab5a83f5d5f663/src/MadelineProtoExtensions/ApiExtensions.php#L459:L467
Or you can just use it. It will return thumb image to stream/browser. You can provide 'peer' and 'id', or 'message' object;
Can you give an example ? Do I have to pass 'message' object like downloadToResponse Method To getMediaPreview ?
Can you give an example ? Do I have to pass 'message' object like downloadToResponse Method To getMediaPreview ?
Its my custom method. Im using it like this:
Can you give an example ? Do I have to pass 'message' object like downloadToResponse Method To getMediaPreview ?
You can provide message object in “message”, or send “peer” and “id”. Ill send examples later if you still need them.
Can you give an example ? Do I have to pass 'message' object like downloadToResponse Method To getMediaPreview ?
Its my custom method. Im using it like this:
I mean to what Api Address I have to send my request ? getMediaPreview ? Sending 'message' objects data like what We are requesting to download a file ? (downloadToResponse)
something like this ?
curl --location --request POST '127.0.0.1:9503/api/getMediaPreview' \
--header 'Content-Type: application/json' \
--data-raw '{
"media": {
"_": "message",
"out": false,
"mentioned": false,
"media_unread": false,
"silent": false,
"post": true,
"from_scheduled": false,
"legacy": false,
"edit_hide": false,
"id": 11,
"to_id": {
"_": "peerChannel",
"channel_id": 1247413145
},
"date": 1587479130,
"message": "test caption",
"media": {
"_": "messageMediaDocument",
"document": {
"_": "document",
"id": 5834658774639445891,
"access_hash": 7348570211076296083,
"file_reference": {
"_": "bytes",
"bytes": "AkpaA5kAAAALXukdNW8iv1F3xS5jpQ8TUgjZC\/k="
},
"date": 1587479129,
"mime_type": "video\/mp4",
"size": 1358648,
"thumbs": [
{
"_": "photoStrippedSize",
"type": "i",
"bytes": {
"_": "bytes",
"bytes": "ASUoYI\/7qY9zUsUROWJ4FKzALuOceuKkjkTYRnjFQWgkIUL7imZQ9VFK5DpkEcGmrEWGQRxQgYpjjYcZFFRncBkggUUxE7SR4Hzce1VzuByikKelMxyP61cyCMggCmguRFA0Rx164FMjYq2aklZNgIJz3OKiaViPlOfU4xUrQqWo64mDqQM9KKiC+apAPzelFMkmMQ9TS+XgfeNFFACMh6bv0phVgD85\/IUUUAxvlbuGZj+NFFFMRw=="
}
},
{
"_": "photoSize",
"type": "m",
"location": {
"_": "fileLocationToBeDeprecated",
"volume_id": 400032600322,
"local_id": 4558
},
"w": 320,
"h": 300,
"size": 19721
}
],
"dc_id": 4,
"attributes": [
{
"_": "documentAttributeVideo",
"round_message": false,
"supports_streaming": true,
"duration": 4,
"w": 848,
"h": 784
},
{
"_": "documentAttributeFilename",
"file_name": "IMG_4503.MOV"
}
]
}
},
"views": 6
}
}'
It is a little confusing for me ... I tried all methods but no success :(
Please send an example whenever you have free time Спасибо брат :)
I mean to what Api Address I have to send my request ? getMediaPreview ? something like this ?
Address is correct. Requests alsmoust ok :):
--data-raw '{
"data":{
"message": {
"_": "message",
...
Also you can try to switch to shorted version:
http://127.0.0.1:9503/api/getMediaPreview?data[peer]=channel%231247413145&data[id][]=11
It will fetch message if it not provided.
Sending 'message' objects data like what We are requesting to download a file ? (downloadToResponse)
Only full messages supported. Im extracting $message['media'] from them :) MediaObjects not supported.
Спасибо брат :)
خوش آمدید ;)
Passing message object didn't work for me .. maybe I am doing something wrong somewhere
but the shorted version just worked perfectly :+1: Thanks :100:
Passing message object didn't work for me .. maybe I am doing something wrong somewhere
but the shorted version just worked perfectly 👍 Thanks 💯
Great. Actually im using only short syntax too. So maybe there is a bug with "message" key :)
Every video message on Telegram has 'thumbs' like this :
I am trying to download them but not working and I am getting following error :
I even tried to put it in "Media" array but not success
Curl Connection is giving following error ( without any error on the TelegramApiServer)
Empty reply from server
Did you ever tried to download Video Thumbnail ?