diff options
| author | salmonik <raisersoft@proton.me> | 2026-04-29 14:22:03 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-04-29 14:22:03 +0200 |
| commit | dba3388567818cb5c60be9d406d3e1cccc84b3ea (patch) | |
| tree | 53a0903f7a4c381c7ad12e3e632ef8dd8ebba39f /cogs/web.py | |
| parent | multitude of changes. (diff) | |
| download | senator-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 '')
| -rw-r--r-- | cogs/web.py | 2 |
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 | |||
| 11 | import urllib.parse | 11 | import urllib.parse |
| 12 | import yt_dlp | 12 | import yt_dlp |
| 13 | import logging | 13 | import logging |
| 14 | from cogs.utils.url_helper import clean_url_for_ytdlp | ||
| 14 | 15 | ||
| 15 | logger = logging.getLogger(__name__) | 16 | logger = 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} |
