upload_video_4.py 827 B

123456789101112131415161718192021222324
  1. def configure_video(self, upload_id, video, thumbnail, caption=''):
  2. clipInfo = get_video_info(video)
  3. self.upload_photo(photo=thumbnail, caption=caption, upload_id=upload_id)
  4. data = self.json_data({
  5. 'upload_id': upload_id,
  6. 'source_type': 3,
  7. 'poster_frame_index': 0,
  8. 'length': 0.00,
  9. 'audio_muted': False,
  10. 'filter_type': 0,
  11. 'video_result': 'deprecated',
  12. 'clips': {
  13. 'length': clipInfo['duration'],
  14. 'source_type': '3',
  15. 'camera_position': 'back',
  16. },
  17. 'extra': {
  18. 'source_width': clipInfo['width'],
  19. 'source_height': clipInfo['height'],
  20. },
  21. 'device': self.device_settings,
  22. 'caption': caption,
  23. })
  24. return self.send_request('media/configure/?video=1', data)