code: def get_data(self, datasource, callback):
          
          task = self.__app.worker.current_task
          media_metadata = datasource.connector_type_preset['preset_data']['media_metadata']
          result_data = task['result_data']
          tmp_file = NamedTemporaryFile(delete=False, suffix=SOURCE_FORMAT_EXTENSION.get(media_metadata['sourceFormat']))
          self.__app.log.info("Открываем файл", {"filename": tmp_file.name})
          with open(tmp_file.name, 'wb') as f:
              callback(f)
  
          self.__app.log.info("start media upload")
  
          result_data['stage_id'] = "persist_media_file"
          self.__starter.update_task_result_data(task)
          result = self.__media.upload(open(tmp_file.name), {
              "ttlInSec": 60 * 60 * 24,  # 24h
              "entityId": 2770,
              "objectId": task.get('data', {}).get("ds_id"),
              "info": {"metadata": media_metadata}
          })
  
          result_data['stage_id'] = "generate_media_finish"
          result_data['media_id'] = result['id']
          self.__starter.update_task_result_data(task)
  
          return result
docs: Сохранение медиафайла
          :param task:
          :param media_metadata:
          :param file_suffix:
          :param callback:
          :return: