parler_video.py 981 B

12345678910111213141516171819
  1. class ParlerVideoAPI:
  2. def __init__(self, session, root_url="http://api.parler.com"):
  3. self.root_url = root_url
  4. self.s = session
  5. def get_current_video_status(self, *args, **kwargs):
  6. return self.s.get("{}/v2/upload/video/status".format(self.root_url), *args, **kwargs)
  7. def get_video_processing_status(self, video, *args, **kwargs):
  8. return self.s.get("{}/v2/upload/video/status/{}".format(self.root_url, video), *args, **kwargs)
  9. def cancel_video_process(self, video, *args, **kwargs):
  10. return self.s.delete("{}/v2/upload/video/cancel/{}".format(self.root_url, video), *args, **kwargs)
  11. def notify_server_of_the_finished_uploaded_video(self, video, *args, **kwargs):
  12. return self.s.post("{}/v2/upload/video/uploaded/{}".format(self.root_url, video), *args, **kwargs)
  13. def request_video_upload_url(self, *args, **kwargs):
  14. return self.s.post("{}/v2/upload/video/new".format(self.root_url), *args, **kwargs)