From cb3d494be2452bd78c59cf7117fc1c8464b803ce Mon Sep 17 00:00:00 2001 From: Barbara Miller Date: Wed, 30 Jul 2025 12:26:52 -0700 Subject: [PATCH] tidy psycopg imports, mostly --- brozzler/ydl.py | 7 +------ pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/brozzler/ydl.py b/brozzler/ydl.py index 6fea940..35e2bfa 100644 --- a/brozzler/ydl.py +++ b/brozzler/ydl.py @@ -28,7 +28,6 @@ from dataclasses import dataclass from typing import Any, List, Optional import doublethink -import psycopg import structlog import urlcanon import yt_dlp @@ -439,6 +438,7 @@ def _build_youtube_dl(worker, destdir, site, page, ytdlp_proxy_endpoints): logger.info("using yt-dlp proxy ...", proxy=ytdlp_proxy_for_logs) # skip warcprox proxying yt-dlp v.2023.07.06: youtube extractor using ranges + # should_proxy_vid_maybe = not ydl.is_youtube_host # if worker._proxy_for(site): # ydl_opts["proxy"] = "http://{}".format(worker._proxy_for(site)) @@ -481,11 +481,6 @@ def _try_youtube_dl(worker, ydl, site, page): while attempt < max_attempts: try: logger.info("trying yt-dlp", url=ydl.url) - # should_download_vid = not ydl.is_youtube_host - # then - # ydl.extract_info(str(urlcanon.whatwg(ydl.url)), download=should_download_vid) - # if ydl.is_youtube_host and ie_result: - # download_url = ie_result.get("url") with brozzler.thread_accept_exceptions(): # we do whatwg canonicalization here to avoid "" resulting in ProxyError diff --git a/pyproject.toml b/pyproject.toml index 4d7e0c1..12fd956 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ license = "Apache-2.0" [project.optional-dependencies] yt-dlp = ["yt-dlp[default,curl-cffi]>=2024.7.25"] -psycopg = ["psycopg[binary,pool]>=3.2.6"] +psycopg = ["psycopg[pool]>=3.2.6"] dashboard = ["flask>=1.0", "gunicorn>=19.8.1"] warcprox = ["warcprox>=2.4.31"] rethinkdb = [