engine/process.py
def media_path(self, token, file_info, m_type):
        """Get a saved media file from Telegram API. It contains a secret token,
           therefore can not be revealed. Save media to telegra.ph, get its url
           (it does not have any confidential information). Return the url."""
        try:
            with urllib.request.urlopen(f'https://api.telegram.org/file/bot{token}/{file_info.file_path}') as get:
                if get.getcode() == 200:
                    post = requests.post('https://telegra.ph/upload', files={'file': ('file', get, m_type)})
                    if post.status_code == 200:
                        return post.json()[0]['src']
        except:
            pass
Get a saved media file from Telegram API. It contains a secret token,
           therefore can not be revealed. Save media to telegra.ph, get its url
           (it does not have any confidential information). Return the url.
Get a saved media file from Telegram API. It contains a secret token,
therefore can not be revealed. Save media to telegra.ph, get its url
(it does not have any confidential information). Return the url.
Get a saved media file from Telegram API . It contains a secret token therefore can not be revealed . Save media to telegra . ph get its url ( it does not have any confidential information ) . Return the url .
def media_path(self, token, file_info, m_type):
        try:
            with urllib.request.urlopen(f'https://api.telegram.org/file/bot{token}/{file_info.file_path}') as get:
                if get.getcode() == 200:
                    post = requests.post('https://telegra.ph/upload', files={'file': ('file', get, m_type)})
                    if post.status_code == 200:
                        return post.json()[0]['src']
        except:
            pass
def media_path ( self , token , file_info , m_type ) : try : with urllib . request . urlopen ( f'https://api.telegram.org/file/bot{token}/{file_info.file_path}' ) as get : if get . getcode ( ) == 200 : post = requests . post ( 'https://telegra.ph/upload' , files = { 'file' : ( 'file' , get , m_type ) } ) if post . status_code == 200 : return post . json ( ) [ 0 ] [ 'src' ] except : pass
Get a saved media file from Telegram API.
Get a saved media file from Telegram API .
"""Get a saved media file from Telegram API. It contains a secret token,
           therefore can not be revealed. Save media to telegra.ph, get its url
           (it does not have any confidential information). Return the url."""
self
token
file_info
m_type