code: def upload_file(f):
      
      with FilesOpener(f) as files:
          response = requests.post(
              'https://telegra.ph/upload',
              files=files
          ).json()
  
      if isinstance(response, list):
          error = response[0].get('error')
      else:
          error = response.get('error')
  
      if error:
          raise TelegraphException(error)
  
      return [i['src'] for i in response]
docs: Upload file to Telegra.ph's servers. Returns a list of links.
          Allowed only .jpg, .jpeg, .png, .gif and .mp4 files.
  
      :param f: filename or file-like object.
      :type f: file, str or list