zorg_network_camera/adaptor.py
def download_image(self):
        """
        Download the image and return the
        local path to the image file.
        """
        split = urlsplit(self.url)
        filename = split.path.split("/")[-1]

        # Ensure the directory to store the image cache exists
        if not os.path.exists(self.cache_directory):
            os.makedirs(self.cache_directory)

        filepath = os.path.join(self.cache_directory, filename)

        data = urllib_request.urlopen(self.url)
        with open(filepath, "wb") as image:
            image.write(data.read())

        return filepath
def download_image(self):
        """
        Download the image and return the
        local path to the image file.
        """
        split = urlsplit(self.url)
        filename = split.path.split("/")[-1]

        # Ensure the directory to store the image cache exists
        if not os.path.exists(self.cache_directory):
            os.makedirs(self.cache_directory)

        filepath = os.path.join(self.cache_directory, filename)

        data = urllib_request.urlopen(self.url)
        with open(filepath, "wb") as image:
            image.write(data.read())

        return filepath
Download the image and return the
        local path to the image file.