ppbbww

Pillar Point boats, birds, and waves watcher
git clone git@abtrout.com:ppbbww.git
Log | Files | Refs | README | LICENSE

commit 1587e3abc9b87f0e959b900dee5e6a496a42ff6a
parent 908ff405673361c98cfe92b494a9f71d2ec2a21a
Author: david cochran <about.trout@gmail.com>
Date:   Thu, 13 Feb 2025 19:40:41 -0800

minor changes made since September

Diffstat:
Mppboatwatch/ppbbww.py | 4++--
Mppboatwatch/stream_sampler.py | 13+++----------
2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/ppboatwatch/ppbbww.py b/ppboatwatch/ppbbww.py @@ -70,10 +70,10 @@ def filter_matches(matches): continue # Skip common but uninteresting cases based on size and label. box_size = (box[2] - box[0]) * (box[3] - box[1]) - if num_boxes < 5 and box_size < 500: + if num_boxes < 3 and box_size < 500: logging.info(f"Skipping small box (box_size={box_size})") continue - if num_boxes < 5 and label == "boat" and box_size < 3000: + if num_boxes < 3 and label == "boat" and box_size < 3000: logging.info(f"Skipping small boat (box_size={box_size})") continue if num_boxes < 5 and label == "bird" and box_size < 1000: diff --git a/ppboatwatch/stream_sampler.py b/ppboatwatch/stream_sampler.py @@ -12,24 +12,17 @@ from tempfile import mkstemp DEFAULT_HEADERS = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0", "Accept": "*/*", - "Accept-Language": "en-US,en;q=0.5", + "Accept-Language": "en-US,en;q=0.9", "Accept-Encoding": "gzip, deflate, br, zstd", "Origin": "https://www.surfline.com", - "Host": "cams.cdn-surfline.com", "DNT": "1", "Referer": "https://www.surfline.com/", - "Pragma": "no-cache", "Cache-Control": "no-cache", - "Sec-Fetch-Dest": "empty", - "Sec-Fetch-Mode": "cors", - "Sec-Fetch-Site": "cross-site", - "TE": "trailers", } - class StreamSampler: def __init__(self, cam_name, data_dir="./data"): - self.base_url = f"https://cams.cdn-surfline.com/cdn-wc/wc-{cam_name}" + self.base_url = f"https://hls.cdn-surfline.com/oregon/wc-{cam_name}" self.cam_name = cam_name self.data_dir = data_dir @@ -44,7 +37,7 @@ class StreamSampler: return self.__extract_frames(chunk_file) async def __get_recent_chunk_url(self, session): - url = f"{self.base_url}/chunklist.m3u8" + url = f"{self.base_url}/playlist.m3u8" async with session.get(url) as res: chunklist = await res.text() # Only check last/final chunk from chunklist.