title: Capturing the video stream from a website into a file
body: <p>For my image classification project I need to collect classified images, and for me a good source would be different webcams around the world streaming video in the internet. Like this one:</p>
  
  <p><a href="https://www.skylinewebcams.com/en/webcam/espana/comunidad-valenciana/alicante/benidorm-playa-poniente.html" rel="noreferrer">https://www.skylinewebcams.com/en/webcam/espana/comunidad-valenciana/alicante/benidorm-playa-poniente.html</a></p>
  
  <p>I don't really have any experience with video streaming and web scraping generally, so after searching for the info in internet, i came up with this naive code in python:</p>
  
  <pre><code>url='https://www.skylinewebcams.com/a816de08-9805-4cc2-94e6-2daa3495eb99'
  r1 = requests.get(url, stream=True)
  filename = "stream.avi"
  
  if(r1.status_code == 200):
      with open(filename,'w') as f:
          for chunk in r1.iter_content(chunk_size=1024):
              f.write(chunk)
  
  else:
      print("Received unexpected status code {}".format(r.status_code))
  </code></pre>
  
  <p>where the url address was taken from the source of the video block from the website:</p>
  
  <pre><code>&lt;video data-html5-video="" 
  poster="//static.skylinewebcams.com/_2933625150.jpg" preload="metadata" 
  src="blob:https://www.skylinewebcams.com/a816de08-9805-4cc2-94e6- 
  2daa3495eb99"&gt;&lt;/video&gt;
  </code></pre>
  
  <p>but it does not work (avi file is empty), even though in the browser video streaming is working good. Can anybody explain me how to capture this video stream into the file?</p>