improved video naming

This commit is contained in:
1MalcolmS
2026-03-27 16:39:54 -07:00
parent ce6479be42
commit a574a77a4b
70 changed files with 110 additions and 43 deletions

23
testingtemplate.txt Normal file
View File

@@ -0,0 +1,23 @@
import requests
from time import time
from time import sleep
headerz = {'Accept' : 'image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5', 'Accept-Encoding' :
'gzip, deflate, br, zstd', 'Accept-Language' :
'en-CA,en-US;q=0.9,en;q=0.8', 'Referer' :
'https://www.portvancouver.com/' }
while True:
seconds = int(time()* 1000)
print(seconds)
r = "https://ehub.portvancouver.com/Webcams/Photos/CPCTruckRoute?" + str(time)
response = requests.get(r, headers=headerz)
sleep(1)
image_name = "image" + str(seconds) + ".jpg"
if response.status_code == 200:
with open(image_name, 'wb') as f:
f.write(response.content)
print(response.status_code)