Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
423 B
3
Indexable
Never
from datetime import datetime
from pil import image
from time import sleep
import requests


def take_img(

        time,
        imagen=requests.get(
        'http://10.0.208.226:8080/cgi-bin/snapshot.sh?res=high&watermark=yes',
            auth=('user', 'pass')),
        format='jpeg',
        dir="r'\opt\data\ramiro\'"):

    image.save(dir + time + format)


while True:
    sleep(5)
    take_img(time=datetime.now())