Guest User

Untitled

a guest
Aug 19th, 2023
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. with connect(socketUrl) as ws:
  2.     try:
  3.         while True:
  4.             with open(f'{folder}/{title}.mp4', 'ab') as f:
  5.                 msg = ws.recv()
  6.                 received_bytes += len(msg)
  7.                 print(f'Received {received_bytes} bytes')
  8.                 f.write(msg)
  9.     except Exception:
  10.         print(f'Connection Dropped, Reconnecting')
Advertisement
Add Comment
Please, Sign In to add comment