mercredi 1 juillet 2020

Live traffic cam scraping

I would like to know what is the most elegant way to scrape live webcam (traffic) data, ideally using Python. The webcam feed is represented by an API, with each get request yielding a image of the currently available feed from the webcam. The feed in question has a 2/3 second delay and therefore there are ~ 30 images per minute that can be requested.

My current (trivial) solution simply queries the API in a loop (perhaps with a sleep timer) and then cleans up any duplicated images. However, this seems quite dirty and I was wondering if there is a cleaner/more elegant solution available.

In principal I would like the solution to (if at all possible) avoid:

  • downloading duplicated images
  • sleep timers
  • looping

Is something like this possible?




Aucun commentaire:

Enregistrer un commentaire