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/music/media_processing.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/music/media_processing.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cogs/music/media_processing.py b/cogs/music/media_processing.py index b9b814c..91bd406 100644 --- a/cogs/music/media_processing.py +++ b/cogs/music/media_processing.py | |||
| @@ -9,6 +9,7 @@ import os | |||
| 9 | 9 | ||
| 10 | import yt_dlp | 10 | import yt_dlp |
| 11 | from youtubesearchpython import VideosSearch | 11 | from youtubesearchpython import VideosSearch |
| 12 | from cogs.utils.url_helper import clean_url_for_ytdlp | ||
| 12 | 13 | ||
| 13 | logger = logging.getLogger(__name__) | 14 | logger = logging.getLogger(__name__) |
| 14 | 15 | ||
| @@ -36,6 +37,7 @@ class MediaDownloader: | |||
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | try: | 39 | try: |
| 40 | url = clean_url_for_ytdlp(url) | ||
| 39 | with yt_dlp.YoutubeDL(ytdl_opts) as ydl: | 41 | with yt_dlp.YoutubeDL(ytdl_opts) as ydl: |
| 40 | info_dict = ydl.extract_info(url, download=True) | 42 | info_dict = ydl.extract_info(url, download=True) |
| 41 | # Get the base filename without extension | 43 | # Get the base filename without extension |
