Commit Graph

585 Commits

Author SHA1 Message Date
Jaroslav Beneš 852804ee5c Actually suspend the download process group on pause
Pause only stopped the stdout reader loop; yt-dlp kept transferring at
full rate until the pipe buffer filled, consuming bandwidth while the
UI claimed the download was paused. Send SIGSTOP/SIGCONT to the whole
process group (yt-dlp and its ffmpeg children) on Unix. Windows has no
equivalent signal; the limitation is documented in the helper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 01:26:44 +02:00
Jaroslav Beneš 5064b38315 Marshal channel-switch UI updates back to the GUI thread
The yt-dlp stable/nightly channel switcher mutated QLabel/QRadioButton
state directly from a raw threading.Thread, which is undefined behavior
in Qt. The worker now only runs the subprocess and emits a signal; the
connected slot applies all widget updates on the GUI thread via Qt's
queued delivery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 01:26:00 +02:00
Jaroslav Beneš dff14ec3e8 Enforce SHA256 verification on every binary install path
Three gaps allowed an unverified binary to reach a trusted location:

- The ffmpeg ZIP fallback logged a warning on checksum mismatch and
  installed anyway (the 7z path already aborted). Abort instead.
- The yt-dlp auto-update path downloaded and renamed the binary over
  the verified one with no checksum at all. Verify against the official
  SHA2-256SUMS like the first-install path, and use atomic os.replace.
- The yt-dlp first install streamed the download directly to the
  trusted path and only verified afterwards; a crash in between left an
  unverified executable to be run on next launch. Download to .part and
  os.replace only after verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 01:24:35 +02:00
Jaroslav Beneš b40deb0d5f Write ffmpeg dir to user PATH via registry instead of setx
setx truncates values at 1024 characters, and the old code fed it the
merged process PATH (system + user), permanently duplicating every
system entry into the user hive and silently dropping anything past the
limit. Read and rewrite only the HKCU Environment Path value with
winreg, preserving REG_EXPAND_SZ, and broadcast WM_SETTINGCHANGE.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 01:23:04 +02:00
Jaroslav Beneš 202dd9eaee Fix UnboundLocalError in manual yt-dlp binary selection
Unpacking getOpenFileName() into a variable named _ made _ local to
select_ytdlp_path(), so the i18n _() calls earlier in the function
raised UnboundLocalError before the file dialog could open, breaking
manual binary selection entirely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 01:22:26 +02:00
Jaroslav Beneš a1d1f87b65 Scope cleanup routines to files created by the current download
cleanup_partial_files() deleted every *.part and *.fNNN.* file in the
whole download directory, and cleanup_subtitle_files() deleted any new
.vtt/.srt under it recursively - including files belonging to other
applications (e.g. a browser's own .part downloads in ~/Downloads).

Track every destination path yt-dlp reports for this download and
restrict both cleanup passes to those files and their .part/.ytdl
siblings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 01:22:05 +02:00
Jaroslav Beneš c54574224a Merge YTSage 5.2.0 history as upstream base for SageTube
Imports the full commit history of github.com/oop7/YTSage (MIT).
LICENSE keeps both copyright lines; upstream README preserved at
docs/UPSTREAM_README.md. Future syncs: git fetch upstream && git merge
upstream/main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 01:19:28 +02:00
Jaroslav Beneš 115969856c Initial commit 2026-07-24 23:00:53 +00:00
oop7 4bc43174b6 Release YTSage 5.2.0
Bump the project and package version from 5.2.0b to 5.2.0.
2026-07-01 13:42:10 +03:00
oop7 3a63e13639 Merge branch 'beta' 2026-07-01 13:41:07 +03:00
oop7 bc3e7fd4fd Persist speed limit settings to config
Speed limit settings (value and unit) are now loaded from config on app initialization and saved to config when updated. This ensures the user's speed limit preferences persist across app restarts.
2026-07-01 12:33:12 +03:00
oop7 dac298a524 Show audio codec details in format table
Highlight AC3/EAC3 surround-sound formats in the GUI format table and include channel/bitrate details where available. Also relax the audio-only filter so formats without filesize can still be shown.
2026-07-01 11:46:30 +03:00
oop7 72f9098a70 Persist and restore main window state
Restore window geometry/state on startup and save them on exit. Adds YTSageApp._load_window_state() and calls it during UI init; saves Base64-encoded geometry/state via ConfigManager when closing. Adds default config keys "window_geometry" and "window_state". Includes error handling and debug logging to avoid failures if stored values are invalid.
2026-06-14 20:19:40 +03:00
oop7 8c9966000e Improve save_path handling and use ConfigManager
Normalize path input to string, ensure parent directories are created (mkdir with parents=True), and check writability using the normalized path. Replace manual JSON file write with ConfigManager.set("download_path", ...) and add import for ConfigManager. Adjust logging to use logger.error for failures and replace logger.exception where appropriate. These changes improve robustness when saving the download path and centralize config persistence.
2026-06-14 17:59:48 +03:00
oop7 ec18262bba Bump version to 5.2.0b
Update package version from 5.0.10b to 5.2.0b in pyproject.toml and ytsage/__init__.py to reflect the new beta release and keep metadata in sync.
2026-06-14 17:54:03 +03:00
oop7 45d3cdbad4 Default generic_mode to True; preserve explicit False
Set the default generic_mode to True in the config manager and update GUI initialization to distinguish between a missing config and an explicit False. Replace usages of `ConfigManager.get(... ) or False` with a None check so that an explicit False value is respected. Changes made in ytsage/utils/ytsage_config_manager.py and GUI initializers in ytsage/gui/ytsage_gui_main.py and ytsage/gui/ytsage_gui_dialogs/ytsage_dialogs_settings.py.
2026-06-14 17:49:36 +03:00
oop7 831e66a5b9 Include readme-translations in MANIFEST
Add a recursive-include rule for the readme-translations directory to MANIFEST.in so translated README files are included in source distributions (sdist) and packaged with releases.
2026-05-25 14:04:32 +03:00
oop7 e76d47412d Correct path for localized README creation
Fix README contribution instructions to point new translations to the readme-translations/ directory. Previously the docs suggested creating README.<code>.md at the repo root; this change clarifies that localized files should be placed under readme-translations/README.<code>.md to keep translations organized.
2026-05-25 14:04:12 +03:00
oop7 d3c3094880 Fix translated README links to root
Update links in readme-translations/*.md so they point to the project root (prepend ../). Adjusted references for README.md, .github/CI_CD_README.md and LICENSE across the translation files so links resolve correctly from the readme-translations directory.
2026-05-25 14:02:55 +03:00
oop7 e1a2fe52c6 Fix README link path in Arabic translation
Update the English README link in readme-translations/README.ar.md to point to the repository root (../README.md) so the language table correctly references the top-level README.
2026-05-25 14:02:39 +03:00
oop7 2aa8c023f4 Point README links to readme-translations/
Update README links to reference translation files under the readme-translations/ directory. Adjusted the language list and the translations table to use readme-translations/ paths and corrected the English link to README.md. This organizes translation links to a dedicated folder.
2026-05-25 14:01:31 +03:00
oop7 938cc9be46 Bump version to 5.1.0
Update package version from 5.0.10b to 5.1.0 in pyproject.toml and ytsage/__init__.py to prepare for the 5.1.0 release.
2026-05-14 15:54:07 +03:00
oop7 9bf22a6b22 Merge branch 'beta' 2026-05-14 15:52:50 +03:00
oop7 d581754062 Fix image paths in README
Update README.md image src attributes to use 'branding/...' instead of '../branding/...', correcting broken links to the wordmark and various screenshots (main, Download-Settings, playlist, audio_format, Custom-Option) so images render properly in the repository's README.
2026-05-14 15:50:37 +03:00
oop7 0216f7be71 Polish Russian README translation
Refine the Russian README translation: update UI labels, headings and anchor IDs, translate screenshot alt texts and table entries, normalize installation and troubleshooting instructions, and improve wording/consistency across sections (installation, usage, features, networking, tools, localization and contribution). Small formatting and phrasing tweaks to make the Russian text clearer and more consistent.
2026-05-14 15:47:20 +03:00
oop7 39320db3a0 Polish README text, paths, and formatting
Editorial and structural updates to README.md and readme-translations/README.tr.md: fix image paths (use ../branding/ and forward slashes), standardize wording/capitalization (Application, Download, Install, etc.), reformat feature tables and installation sections for consistency, clarify install/update/run commands, improve macOS/Windows troubleshooting and antivirus guidance, adjust screenshot alt texts, and apply numerous minor localization and copy corrections in the Turkish translation.
2026-05-14 15:39:06 +03:00
oop7 3ba021dfbb Update Polish README translation and formatting
Apply copy edits and formatting fixes to readme-translations/README.pl.md: adjust wording and capitalization, standardize section headings and anchors (e.g. instalacja, funkcje, użycie), harmonize terminology (Download Settings, Generic Mode), fix tables and list formatting, update platform/executable descriptions and installation steps, revise screenshots alt text, clarify usage and troubleshooting instructions, and refresh localization & contributing sections for consistency.
2026-05-14 15:38:35 +03:00
oop7 ca176d7844 Refine README.ja.md translations and formatting
Polish Japanese README translation and formatting: update wording and punctuation for clarity, translate and normalize section headings and links, refine tables and feature lists, adjust installation and platform-specific instructions, update screenshot alt text and usage examples, and improve troubleshooting and localization entries for consistency.
2026-05-14 14:56:52 +03:00
oop7 37777310c9 Update German and Italian README translations
Refine and standardize wording in readme-translations/README.de.md and README.it.md. Improvements include clearer UI labels (Analyze/Download), consistent terminology for installation and features, corrected language names, updated tables and formatting, improved screenshot alt texts, and various grammar/translation fixes to align both locales with the main README for clarity and consistency.
2026-05-14 14:52:50 +03:00
oop7 0c73bfcd98 Polish README translations (ES, HI, ID)
Copy edits and consistency fixes for translated README files in readme-translations (Spanish, Hindi and Indonesian). Changes include corrected wording and grammar, standardized headings and labels (installation, usage, settings), localized UI/alt text updates, clarified install/update instructions, unified terminology (e.g. Generic Mode, FFmpeg/yt-dlp detection), and various formatting improvements across language tables and troubleshooting notes. Pure documentation updates only.
2026-05-14 14:51:33 +03:00
oop7 ffa46d4a2a Improve Arabic README translation
Refine Arabic localization and formatting in readme-translations/README.ar.md. Updates include clearer word choices (e.g., تحميل vs تنزيل), consistent UI label translations (Analyze/Download), corrected language names and links, improved table layouts, localized installation and troubleshooting instructions, updated screenshot alt texts, and additional notes about playlist export and Generic Mode. These changes tidy wording and improve consistency for Arabic readers.
2026-05-14 14:45:43 +03:00
oop7 9fd09cd0d0 Handle playlist items as completed on partial errors
For playlist downloads, treat an item as completed if a file was created even when the downloader returned a non-zero code. Emit 100% progress for such cases and update the status to "download.completed (with some errors)" when return_code != 0, otherwise keep the normal completed status. This avoids reporting false failures for playlist items that produced output despite errors.
2026-05-14 13:47:05 +03:00
oop7 99ba5d6d8a Ignore playlist errors; normalize version cache
When downloading playlists, add --ignore-errors and --no-abort-on-error so a single failure won't stop the entire playlist download. Also normalize values stored in the version cache: coerce version_info to a string (or empty string) and path to a string or None to ensure consistent types when reading/writing cached tool metadata.
2026-05-14 12:37:56 +03:00
oop7 ba07a3300c Bump version to 5.0.10b
Update project version from 5.0.9b to 5.0.10b in pyproject.toml and ytsage/__init__.py to prepare a new beta release.
2026-05-01 22:51:06 +03:00
oop7 0d5cbb2df1 Write auto-subs only if selected; show count
Downloader: add detection for "Auto-generated" subtitle selection and only append --write-auto-subs when an auto-generated subtitle is explicitly chosen (prevents always enabling the flag when any subtitles are requested). GUI: update subtitle label to display the number of selected subtitles when >0, falling back to the zero-selected message otherwise. Small UX and behavior fixes in DownloadThread and AnalysisMixin.
2026-05-01 16:49:58 +03:00
oop7 abef0d8a6d Strip playlist_index placeholder for single files
When building the output template for single-file downloads, remove any playlist-specific preamble (e.g. '%(playlist_index)s - ') from filename_part. Adds a regex-based substitution to clean up leftover playlist_index placeholders so single downloads don't get playlist-style prefixes in their filenames.
2026-05-01 16:29:28 +03:00
oop7 abec69fb84 Include index and formatted durations in exports
Enhance playlist export output for Text and CSV formats. Text files now include a numeric index, a title fallback ("Video N"), and a human-readable duration ([H:MM:SS] or [MM:SS]) when available before the URL. CSV export adds a "Playlist Index" column and writes a formatted title with index and duration. Duration parsing is protected against non-integer values. M3U and JSON export behavior unchanged.
2026-05-01 14:23:29 +03:00
oop7 d2f96baf63 Bump version to 5.0.9b
Update package version from 5.0.7b to 5.0.9b in pyproject.toml and ytsage/__init__.py to reflect the new release.
2026-04-28 13:37:31 +03:00
oop7 e78b634bee Add remember_settings and private_video keys
Add two new localization keys across multiple language files: "remember_settings" (cookie dialog) and "private_video" (download/error message) to inform users about remembering cookie settings and private videos. Also fix minor formatting in en.json (split combined line for open_folder/save_playlist/reset). Updated locale files: ar, de, en, es, fr, hi, id, it, ja, pl, pt, ru, tr, zh.
2026-04-28 13:31:07 +03:00
oop7 8dc0991619 Persist cookie settings across sessions
Restore cookie configuration on startup when previously active and the user opted to remember them. If config indicates a file source and the path exists, set cookie_file_path; if browser source, set browser_cookies_option. Treat missing "cookie_remember" as true by default. If the user did not opt to remember cookies, reset cookie_active to false. Added logging for restored settings and initialization state.
2026-04-28 13:30:13 +03:00
oop7 4ae78b830d Add 'Remember Cookie Settings' checkbox
Introduce a "Remember Cookie Settings" QCheckBox to the cookies UI (label uses gettext key "cookies.remember_settings"). The control defaults to True when no prior setting exists and applies custom styling for the indicator and text. Its toggled signal is wired to ConfigManager.set("cookie_remember", checked) so the preference is saved immediately (avoiding dependence on an Apply button), and the value is also saved when the dialog persists other cookie settings. Uses the "cookie_remember" config key for storage.
2026-04-28 13:29:43 +03:00
oop7 5bbecf1e1d Detect private/sign-in yt-dlp errors
Update AnalysisThread error handling to detect yt-dlp stderr containing "Private video" or "Sign in". For those cases, emit a localized errors.private_video message and log a specific private-video error; otherwise preserve the existing generic ytdlp_failed behavior. Playlist visibility signals and early return remain unchanged.
2026-04-28 13:29:26 +03:00
oop7 fe0f8241ff Improve playlist format selection and resolution
When downloading playlists, avoid reusing a specific format_id from the first item (which can fail for subsequent videos). For audio-only playlists, use yt-dlp's bestaudio fallback; for video playlists, respect a provided resolution by extracting the height and applying -S res:<height>, otherwise fall back to bestvideo+bestaudio/best. Invalid resolution strings are caught and logged, and revert to the dynamic best-quality fallback.
2026-04-28 12:55:46 +03:00
oop7 bb461898e4 Update translations across multiple locales
Update and improve translations for multiple language files (ar, de, es, fr, hi, id, it, ja, pl, pt, ru, tr, zh). Key changes include localized strings for playlist saving ("Save Playlist As" -> localized), save/result/error messages, concurrent connections and help text, default selection/settings (video quality and subtitle language), and various wording/typo fixes. Also add/translate FFmpeg installation and yt-dlp setup messages in Turkish and Chinese. No functional code changes.
2026-04-25 17:42:36 +03:00
oop7 a2e11eec06 Update French translations
Translate several UI strings in ytsage/languages/fr.json from English to French: update `save_playlist`, `filter_playlist_placeholder`, and a group of settings strings (`concurrent_fragments`, `concurrent_fragments_help`, `defaults_settings`, `default_video_quality`, `default_subtitle_language`, `defaults_help`) to provide correct French localization and improve consistency.
2026-04-25 17:40:49 +03:00
oop7 9856dbf301 Update Spanish and Hindi translations
Improve localization by updating translations in ytsage/languages/es.json and ytsage/languages/hi.json. Spanish fixes provide full translations for interface help text, restart notice, playlist/save labels, dialog placeholders, and playlist save messages. Hindi adds translated strings for concurrent connections, related help text, and default selection settings for video quality and subtitles.
2026-04-25 17:40:24 +03:00
oop7 3d06c4dba6 Update German and Hindi translations
Translate several UI strings in ytsage/languages for German (de.json) and Hindi (hi.json). Changes include localized labels for saving playlists and filtering videos, dialog placeholders, and various settings text (e.g. concurrent connections and default selection help in German). Hindi updates add translated playlist save dialog messages and related UI strings.
2026-04-25 17:39:52 +03:00
oop7 d8c3ce8fa1 Add new i18n keys to language files
Add new localization keys across multiple ytsage language JSONs. Common addition: "filter_playlist_placeholder" added to most languages. Spanish, Turkish and Chinese receive several new strings for custom commands, proxy settings, FFmpeg installation messages, history loading, time/placeholders and validation messages. Also ensure files end with newline. Files modified: ar, de, es, fr, hi, id, it, ja, pl, pt, ru, tr, zh.
2026-04-25 10:58:43 +03:00
oop7 d19ac96ff7 Bump package version to 5.0.7b
Update project version in pyproject.toml and ytsage/__init__.py from 5.0.5b to 5.0.7b to mark the new release.
2026-04-25 10:54:08 +03:00
oop7 a512c603ce Document playlist export and new defaults
Update README to reflect new features and settings: add "Export Playlists" to the feature table; document the "Save Playlist As" export options (.txt, .csv, .m3u, .json). Add docs for Default Video Resolution and Default Subtitle Languages settings, and update the Output Filename Format variables to include %(playlist_index)s and %(resolution)s. These changes keep the README in sync with recent UI/settings additions.
2026-04-25 10:46:43 +03:00