aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/web.py
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-04-29 14:22:03 +0200
committersalmonik <raisersoft@proton.me>2026-04-29 14:22:03 +0200
commitdba3388567818cb5c60be9d406d3e1cccc84b3ea (patch)
tree53a0903f7a4c381c7ad12e3e632ef8dd8ebba39f /cogs/web.py
parentmultitude of changes. (diff)
downloadsenator-sperma-dba3388567818cb5c60be9d406d3e1cccc84b3ea.tar.gz
senator-sperma-dba3388567818cb5c60be9d406d3e1cccc84b3ea.zip
Refactor database connections and add integration tests
- Use context managers for sqlite3 connections in cron, vclogs, and database utils - Add URL helper utility for yt-dlp with clean_url_for_ytdlp function - Add slow integration test markers and new integration test files - Fix test imports to use conftest directly instead of tests.conftest - Improve downloader error handling and use COPYPARTY_URL_UPLOAD env var - Update pytest.ini with slow test markers and warning filters - Document slow test usage in AGENTS.md
Diffstat (limited to 'cogs/web.py')
-rw-r--r--cogs/web.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cogs/web.py b/cogs/web.py
index eea13b1..fd22f9f 100644
--- a/cogs/web.py
+++ b/cogs/web.py
@@ -11,6 +11,7 @@ from bs4 import BeautifulSoup
11import urllib.parse 11import urllib.parse
12import yt_dlp 12import yt_dlp
13import logging 13import logging
14from cogs.utils.url_helper import clean_url_for_ytdlp
14 15
15logger = logging.getLogger(__name__) 16logger = logging.getLogger(__name__)
16 17
@@ -24,6 +25,7 @@ class Web(commands.Cog):
24 if "youtube.com/watch" not in url: 25 if "youtube.com/watch" not in url:
25 return None 26 return None
26 27
28 url = clean_url_for_ytdlp(url)
27 logger.info("youtube link") 29 logger.info("youtube link")
28 try: 30 try:
29 ydl_opts = {"quiet": True, "nowarnings": True} 31 ydl_opts = {"quiet": True, "nowarnings": True}