What is PhotoVideo format in Telethon - telethon

I tried to make a telegram media downloader by using telethon. What is PhotoVideo format in Telethon? I found it in constructor inputMessagesFilterPhotoVideo

Related

How to add payload and use the post method to get response from an API in twincat 3?

enter image description hereNot getting appropriate response like I get on the postman application
I tried a few online APIs which give me response, but I need an option to be able to add a payload in my program. I am using tc3 iotbase library from the twincat library repo.
The HTTP POST request payload is builded by the FB_IotHttpRequest function block, when you call one of the send methods
You can use 2 option here:
FB_IotHttpRequest.SendRequest(...) in this case you need to create the payload JSON manually
FB_IotHttpRequest.SendJsonDomRequest(...) in this case you need just pass the reference of the FB_JsonDomParser, which contains the json document.

Video call through the body of tegram api

I would like to know whether it is possible to start a video call with another user by means of the tdlib library and transfer a picture from a camera connected to a Raspberry Pi to this call? And if so, how do you do that? What methods should I use?
To work with video calls part of Telegram you need to use Telegram's WebRTC client (https://github.com/TelegramMessenger/tgcalls). With MTProto methods you can get params to start this library. Video and audio bytes passing via this library.
There is already implemented high level library for Python that works with official tgcalls library. But working with private calls in a TODO list. You can use this project as an example how to work with tgcalls library.
https://github.com/MarshalX/tgcalls
Here are the python sources With working code of video translator with youtube/m3ui/mp4
https://github.com/EverythingSuckz/tgvc-video-tests

How to send audio file using telethon so that the audio can be played in in-app media player for mobile?

I've tried to use both function, the audio still cannot be played in-app media player
await client.send_file(chat, '/my/songs/song.mp3', voice_note=True)
await client.send_file(chat, '/my/songs/song.mp3', attributes=[DocumentAttributeFilename(file_name=fileName + '.mp3'), DocumentAttributeAudio(duration=100, voice=True)])
I'm looking to send an audio which can be played using in-app audio
player.
Ok, you just need to use send_file, reference on the library docs here.
import asyncio
from telethon import TelegramClient
client = TelegramClient('SESSION_NAME', 'YOUR_API_ID', 'YOUR_API_HASH')
client.start(phone=+xxxxxxxxxxxx)
async def main():
await client.send_file('me', 'test.mp3')
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
client.send_file(chat, '/my/songs/song.mp3', voice_note=True)
test this, its send audio as user record, without "voice_note=True", media sended as main file
I don't know if you're still having this problem, but I solved it by installing the hachoir module with pip install hachoir. Basically the problem is that the client doesn't have the necessary metadata
I had the same situation as the author cause of my mp3-file had no extension (I used temporary file).
The reasons of your situation you can find in send_file method code. In my case, I discovered that if I set mime-type audio/mpeg for my media inside send_file/self._file_to_media in a debug mode, it sends file as in-app audio. So I found out that that method can't guess my file mime-type. I searched ahead and found my solution.
And... I tried voice_note=True - in my case it did not help, because my file was not a voice, but an mp3. And, actually, when I downloaded it it has voice_note=False set. So setting voice_note to True has no meaning if you are handling audio-files which are not voices.

a way to upload video to php server with AVFoundation?

I was wondering what would be the best approach to upload a video using AVfoundation to a server in h264 format. I will be using NSURL and some form of httprequest to post data every 30 second intervals. I was wondering what would be the best way to upload if there are any established libraries to ease my life?
thank you.
You can just use NSURLConnection with a NSMutableURLRequest. Assign a NSInputStream using the
- (void)setHTTPBodyStream:(NSInputStream *)inputStream
method.
Check the documentation:
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableURLRequest_Class/Reference/Reference.html
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsurlconnection_Class/Reference/Reference.html
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSInputStream_Class/Reference/Reference.html

How to send image through axis2

My Service class designed through Axis2, I am able to send any data type of resords like
(premetive datatypes). I don't know how to send Image file.
Have a read of the documentation - its very good for Axis2 -> http://axis.apache.org/axis2/java/core/docs/mtom-guide.html
There are some code examples in there too on how to transfer images using Axis2
Use soap with attachment option or MTOM..Following posts are helpful
http://www.ibm.com/developerworks/webservices/library/ws-soapatt/
http://www.keith-chapman.org/2008/09/attachments-mtom-swa-and-base64binary.html