-### Courses
+### Courses
組み込みの Courses プラグインは、**Hotmart**、**Udemy**、**Kiwify**、**Rocketseat**、**Coursera**、**Domestika**、**Skillshare**、**Alura**、**Ebac** を含む 38 の学習プラットフォームに対応しています。アプリ内の Web ビューからログインするか、拡張機能で保存した Cookie を使うか、利用可能な場合はアカウントの認証情報でログインします。LibreGet は購入済みの講座を一覧表示し、講座のアウトラインを開いて必要なセクションを選べるようにし(DRM で保護された講義はスキップされ、報告されます)、レッスンと添付ファイルを、必要に応じて通し番号を付けてダウンロードします。
@@ -568,7 +568,7 @@ AI と通信するツールはすべて、**Settings → AI** で設定したプ
QR コードまたは電話番号でログインします。参加しているすべてのチャンネルとグループを閲覧し、写真、動画、ドキュメント、音声で絞り込み、ファイルを検索し、個別のメディアやチャットのアーカイブ全体を、進捗リスト付きでダウンロードできます。メディアのダウンロードは、サニタイズされたフォルダー名で `{download_dir}/LibreGram/{channel_name}/` に整理されます。
-### Convert
+### Convert
マシンが対応していれば GPU アクセラレーションを使って FFmpeg で変換します:動画と音声のコンテナ、コーデック、解像度、ビットレート、圧縮を変更でき、インターネット接続は不要です。
diff --git a/README.md b/README.md
index 73e48608..f3036b88 100644
--- a/README.md
+++ b/README.md
@@ -197,12 +197,12 @@ LibreGet has native extractors for the platforms people use most, and hands ever
| Category | Sites and formats |
|---|---|
-| Online courses | 38 supported platforms (Hotmart, Udemy, Kiwify, Rocketseat, Coursera, Domestika, Skillshare, and more) through the embedded Courses plugin. Every lesson, section selection, attachments, resume where you stopped. |
-| Video and audio | YouTube (videos, playlists, channels, live from start, chapters, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clips, live), Vimeo, Bluesky, Threads, Pinterest, Douyin |
+| Online courses | 38 supported platforms (Hotmart, Udemy, Kiwify, Rocketseat, Coursera, Domestika, Skillshare, and more) through the embedded Courses plugin. Every lesson, section selection, attachments, resume where you stopped. |
+| Video and audio | YouTube (videos, playlists, channels, live from start, chapters, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clips, live), Vimeo, Bluesky, Threads, Pinterest, Douyin |
| Bilibili, signed in | 4K, HDR, Dolby Vision, Hi-Res lossless and Dolby Atmos according to your subscription. Danmaku comments as XML, ASS or JSON, NFO files for Kodi and Jellyfin, custom naming templates, 11 URL types including bangumi, courses, favorites, watch later and history |
-| Image galleries | Whole galleries and profiles from 250+ sites through gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono and more) |
-| Bulk | Paste many links or load a `.txt`, download whole subreddits, Reddit and X profiles, Instagram and Pinterest profiles, Facebook albums |
-| Files and transfer | `.torrent` files and magnet links with a built-in BitTorrent client, direct HTTP files, HLS and DASH manifests, and person-to-person transfer between two LibreGet installs with a short word code |
+| Image galleries | Whole galleries and profiles from 250+ sites through gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono and more) |
+| Bulk | Paste many links or load a `.txt`, download whole subreddits, Reddit and X profiles, Instagram and Pinterest profiles, Facebook albums |
+| Files and transfer | `.torrent` files and magnet links with a built-in BitTorrent client, direct HTTP files, HLS and DASH manifests, and person-to-person transfer between two LibreGet installs with a short word code |
| Telegram | Photos, videos, files and audio from any channel or group you belong to, saved into organized channel folders (`LibreGram//`), through the embedded Telegram plugin |
Options you set once and forget: default quality, audio-only format (MP3, M4A, Opus, FLAC or WAV), subtitle languages and format (SRT, VTT, ASS, embedded or sidecar), thumbnail and metadata embedding, filename template, organize by platform, skip existing files, split by chapters, speed limit, concurrent downloads, proxy. Rules send a given channel or host to a folder and quality of your choice without asking again. Followed channels are checked in the background and can download new uploads automatically with a tray notification.
@@ -294,7 +294,7 @@ Status legend: no mark means ready, **beta** means it works but has not been tes
- **Real thumbnail.** The frames the CDN already has at 25, 50 and 75 percent, instead of the clickbait cover.
- **Force H.264.** A switch in the browser extension that keeps YouTube on H.264 instead of VP9 and AV1, for machines that stutter on newer codecs.
-### Speech and subtitles (8)
+### Speech and subtitles (8)
- **Transcribe.** Audio or video to subtitles with whisper.cpp, offline. Models download on demand, Metal acceleration on macOS.
- **Text to speech.** Natural voices from Microsoft Edge, free, with a synced subtitle file.
@@ -303,7 +303,7 @@ Status legend: no mark means ready, **beta** means it works but has not been tes
- **Clone a voice**, **Design a voice** and **Isolate vocals** through a VoiceStudio install running on your machine. *beta*
- **Dictation.** Press a global shortcut, speak, and whisper types the text where your cursor is. *beta*
-### Video editing (14)
+### Video editing (14)
- **Cut a clip.** Pick a video on disk and cut out a section. The result lands in the downloads queue.
- **Convert.** Change container, codec or resolution, or compress, through the Convert plugin.
@@ -319,7 +319,7 @@ Status legend: no mark means ready, **beta** means it works but has not been tes
- **Record screen.** Screen and system audio through FFmpeg, with a replay buffer that saves what just happened. *beta*
- **Timeline editor.** *planned*
-### Audio (2)
+### Audio (2)
- **Normalize loudness.** Two-pass EBU R128, so the audio lands where streaming, podcast or broadcast expects it.
- **Remove noise.** Hiss, fan and room noise taken out of a recording, with nothing to download.
@@ -411,7 +411,7 @@ Video downloads from Bilibili live on the home screen. These two are about the f
- **Themes and colors.** Customize the Spotify client with Spicetify themes. *beta*
- **Extensions.** Install Spicetify extensions and custom apps from its Marketplace. *beta*
-### Music (3)
+### Music (3)
- **Playlist to M3U.** Match an exported playlist with the audio files you own and write `.m3u8` and `.pls` for any local player.
- **Synced lyrics.** Fetch lyrics from LRCLIB and save an `.lrc` next to each track.
@@ -426,13 +426,13 @@ All four read the official data export LinkedIn lets you request, on your own ma
- **Messages.** Browse your chat history and save it as a local page.
- **Profile score.** An offline completeness check with what is missing.
-### Games (3)
+### Games (3)
- **Switch album.** Import screenshots and clips from the Switch SD card, named by game and date.
- **Clip organizer.** Sort Game Bar, ShadowPlay, OBS and Steam captures into folders by game.
- **Runs on Linux?** The ProtonDB tier for one game or your whole Steam library.
-### PDF (13)
+### PDF (13)
- **Merge.** Join several PDFs into one, in the order you choose.
- **Split.** Extract pages or break a PDF into parts.
@@ -448,7 +448,7 @@ All four read the official data export LinkedIn lets you request, on your own ma
- **Safe PDF.** Rebuild a PDF from pixels to strip scripts and forms.
- **PDF to Markdown.** Clean Markdown with headings, lists and tables, ready to paste into an LLM.
-### Documents (5)
+### Documents (5)
- **SlideShare to PDF.** Every slide at the largest size, assembled into one PDF.
- **Google Docs export.** Public Docs, Slides and Sheets as PDF, DOCX, PPTX or XLSX.
@@ -456,7 +456,7 @@ All four read the official data export LinkedIn lets you request, on your own ma
- **Image galleries.** Whole galleries and profiles from 250+ sites with gallery-dl.
- **Scribd.** Save readable books as PDF using your own session. *planned*
-### Images (9)
+### Images (9)
- **Upscale.** Real-ESRGAN on any Vulkan GPU, 2x, 3x or 4x. *beta*
- **Resize images.** Batch resize by width, height, fit or percent, converting the format if you want.
@@ -468,7 +468,7 @@ All four read the official data export LinkedIn lets you request, on your own ma
- **Spritesheet.** Slice a sheet into frames, pack frames back with an atlas, or resize a folder by rule.
- **OCR.** Copy the text out of images and slides. *beta*
-### System (10, Windows-only items marked)
+### System (10, Windows-only items marked)
- **Clean caches.** Temp files, logs and app caches with rules per operating system. You review the list before anything is deleted.
- **Disk analyzer.** What takes space, as a treemap plus the largest files, with a send-to-trash button.
@@ -481,7 +481,7 @@ All four read the official data export LinkedIn lets you request, on your own ma
- **Registry cleaner.** Orphaned entries, with a `.reg` backup before removal. Windows. *beta*
- **Software updater.** Update programs in bulk through winget, Chocolatey and Scoop. Windows. *beta*
-### Files (5)
+### Files (5)
- **Duplicates.** Find identical files by hash and free space safely.
- **Bulk rename.** Regex, counters and case changes with a preview before applying.
@@ -489,20 +489,20 @@ All four read the official data export LinkedIn lets you request, on your own ma
- **Find files.** Instant search with Everything on Windows, Spotlight on macOS or fd on Linux.
- **Keep awake.** Stop the computer from sleeping during long jobs.
-### Downloads (2)
+### Downloads (2)
- **Accelerated download.** Big files with 16 connections, resume and checksum via aria2.
- **HLS / DASH manifest.** Paste a `.m3u8` or `.mpd` with Referer and cookie. FFmpeg saves an MP4.
-### Automation (1)
+### Automation (1)
- **Auto clicker.** Click at the exact speed you set, with a global hotkey, limits and random ranges. Windows, macOS and Linux. *beta*
-### Phone (1)
+### Phone (1)
- **Send to phone.** Files, links and text to a paired KDE Connect device.
-### AI (6)
+### AI (6)
- **Compare prices.** The cost of the same model across providers, with prices from LiteLLM and models.dev.
- **AI spending.** How much LibreGet spent on AI, by day, model and task, from a local ledger.
@@ -511,7 +511,7 @@ All four read the official data export LinkedIn lets you request, on your own ma
- **API keys.** A local vault for keys and accounts, with a connection test, balance for OpenRouter, DeepSeek, SiliconFlow and New API, and export to Claude Code, Codex, Cherry Studio, opencode or a `.env` file.
- **MCP server.** LibreGet's tools exposed over the Model Context Protocol on the local bridge, 37 tools behind the same token the extension uses, with ready-made config snippets for Claude Code, Claude Desktop, Cursor, VS Code, Goose and Codex. See [LibreGet for AI agents](#libreget-for-ai-agents-mcp-server-and-claude-code-plugin). *beta*
-### CTF and analysis (6)
+### CTF and analysis (6)
Six small offline utilities for capture-the-flag puzzles, forensics homework and "what is this file" moments.
@@ -560,7 +560,7 @@ Core plugins are embedded directly into the application binary, eliminating runt
-### Courses
+### Courses
The embedded Courses plugin supports 38 learning platforms, including **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat**, **Coursera**, **Domestika**, **Skillshare**, **Alura**, and **Ebac**. Sign in through a webview inside the app, with saved cookies from the extension, or with account credentials where available. LibreGet lists your purchases, opens the course outline so you can select the sections you want (DRM-protected lectures are skipped and reported), and downloads lessons and attachments with optional continuous numbering.
@@ -568,7 +568,7 @@ The embedded Courses plugin supports 38 learning platforms, including **Hotmart*
Sign in with a QR code or your phone number. Browse every channel and group you belong to, filter by photo, video, document or audio, search files, and download individual media or entire chat archives with a progress list. Media downloads are organized into `{download_dir}/LibreGram/{channel_name}/` with sanitized folder names.
-### Convert
+### Convert
FFmpeg conversions with GPU acceleration where the machine has it: container, codec, resolution, bitrate and compression for video and audio, no internet required.
diff --git a/README.ru.md b/README.ru.md
index 1e7cc1ee..8db3a242 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -196,12 +196,12 @@ sudo pacman -S gst-plugins-good gst-plugins-bad gst-libav # Arch
| Категория | Сайты и форматы |
|---|---|
-| Онлайн-курсы | Hotmart, Udemy, Kiwify, Rocketseat и Meta-Analysis Academy через плагин Courses. Каждый урок, выбор разделов, вложения, продолжение с места остановки. |
-| Видео и аудио | YouTube (видео, плейлисты, каналы, трансляции с начала, главы, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VOD, клипы, трансляции), Vimeo, Bluesky, Threads, Pinterest, Douyin |
+| Онлайн-курсы | Hotmart, Udemy, Kiwify, Rocketseat и Meta-Analysis Academy через плагин Courses. Каждый урок, выбор разделов, вложения, продолжение с места остановки. |
+| Видео и аудио | YouTube (видео, плейлисты, каналы, трансляции с начала, главы, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VOD, клипы, трансляции), Vimeo, Bluesky, Threads, Pinterest, Douyin |
| Bilibili, с входом в аккаунт | 4K, HDR, Dolby Vision, Hi-Res без потерь и Dolby Atmos в соответствии с вашей подпиской. Комментарии данмаку в виде XML, ASS или JSON, файлы NFO для Kodi и Jellyfin, свои шаблоны имён, 11 типов URL, включая bangumi, курсы, избранное, «посмотреть позже» и историю |
-| Галереи изображений | Целые галереи и профили с 250+ сайтов через gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono и другие) |
-| Массово | Вставьте много ссылок или загрузите `.txt`, скачивайте целые сабреддиты, профили Reddit и X, профили Instagram и Pinterest, альбомы Facebook |
-| Файлы и передача | Файлы `.torrent` и magnet-ссылки со встроенным BitTorrent-клиентом, прямые файлы по HTTP, манифесты HLS и DASH и передача от человека к человеку между двумя установками LibreGet по короткому коду-слову |
+| Галереи изображений | Целые галереи и профили с 250+ сайтов через gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono и другие) |
+| Массово | Вставьте много ссылок или загрузите `.txt`, скачивайте целые сабреддиты, профили Reddit и X, профили Instagram и Pinterest, альбомы Facebook |
+| Файлы и передача | Файлы `.torrent` и magnet-ссылки со встроенным BitTorrent-клиентом, прямые файлы по HTTP, манифесты HLS и DASH и передача от человека к человеку между двумя установками LibreGet по короткому коду-слову |
| Telegram | Фото, видео, файлы и аудио из любого канала или группы, где вы состоите, через плагин Telegram |
Настройки, которые задаются один раз: качество по умолчанию, формат только аудио (MP3, M4A, Opus, FLAC или WAV), языки и формат субтитров (SRT, VTT, ASS, встроенные или отдельным файлом), встраивание обложки и метаданных, шаблон имени файла, папки по платформам, пропуск существующих файлов, разбиение по главам, ограничение скорости, число одновременных загрузок, прокси. Правила отправляют канал или хост в выбранную папку и качество, не спрашивая снова. Отслеживаемые каналы проверяются в фоне и могут скачивать новые ролики автоматически с уведомлением в трее.
@@ -293,7 +293,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Настоящая обложка.** Кадры на отметках 25, 50 и 75 %, которые уже есть на CDN, вместо кликбейтной обложки.
- **Принудительно H.264.** Переключатель в расширении для браузера, который держит YouTube на H.264 вместо VP9 и AV1, — для машин, которые тормозят на новых кодеках.
-### Речь и субтитры (8)
+### Речь и субтитры (8)
- **Распознать речь.** Аудио или видео в субтитры через whisper.cpp, офлайн. Модели скачиваются по запросу, ускорение Metal на macOS.
- **Текст в речь.** Естественные голоса из Microsoft Edge, бесплатно, с синхронизированным файлом субтитров.
@@ -302,7 +302,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Клонирование голоса**, **Проектирование голоса** и **Выделение вокала** через установленный на вашей машине VoiceStudio. *бета*
- **Диктовка.** Нажмите глобальную комбинацию, говорите — и whisper напечатает текст там, где стоит курсор. *бета*
-### Видеомонтаж (14)
+### Видеомонтаж (14)
- **Вырезать клип.** Выберите видео на диске и вырежьте фрагмент. Результат попадёт в очередь загрузок.
- **Конвертировать.** Смените контейнер, кодек или разрешение либо сожмите файл через плагин Convert.
@@ -318,7 +318,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Запись экрана.** Экран и системный звук через FFmpeg, плюс буфер повтора, сохраняющий то, что только что произошло. *бета*
- **Редактор таймлайна.** *в планах*
-### Аудио (2)
+### Аудио (2)
- **Нормализация громкости.** Двухпроходный EBU R128 — звук попадёт на уровень, которого ждут стриминг, подкасты или вещание.
- **Подавление шума.** Шипение, шум вентилятора и комнаты убираются из записи — ничего скачивать не нужно.
@@ -410,7 +410,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Темы и цвета.** Настройте клиент Spotify темами Spicetify. *бета*
- **Расширения.** Устанавливайте расширения Spicetify и пользовательские приложения из его Marketplace. *бета*
-### Музыка (3)
+### Музыка (3)
- **Плейлист в M3U.** Сопоставьте экспортированный плейлист со своими аудиофайлами и запишите `.m3u8` и `.pls` для любого локального плеера.
- **Синхронизированные тексты.** Загрузите тексты песен из LRCLIB и сохраните `.lrc` рядом с каждым треком.
@@ -425,13 +425,13 @@ Firefox: **Настройки → Плагины → Расширение для
- **Сообщения.** Просмотрите историю переписки и сохраните её как локальную страницу.
- **Оценка профиля.** Офлайн-проверка полноты профиля со списком того, чего не хватает.
-### Игры (3)
+### Игры (3)
- **Альбом Switch.** Импортируйте скриншоты и клипы с SD-карты Switch — с именами по игре и дате.
- **Организатор клипов.** Разложите записи Game Bar, ShadowPlay, OBS и Steam по папкам для каждой игры.
- **Запустится на Linux?** Уровень ProtonDB для одной игры или всей вашей библиотеки Steam.
-### PDF (13)
+### PDF (13)
- **Объединить.** Соедините несколько PDF в один в нужном вам порядке.
- **Разделить.** Извлеките страницы или разбейте PDF на части.
@@ -447,7 +447,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Безопасный PDF.** Пересоберите PDF из пикселей, удалив скрипты и формы.
- **PDF в Markdown.** Чистый Markdown с заголовками, списками и таблицами — готовый к вставке в LLM.
-### Документы (5)
+### Документы (5)
- **SlideShare в PDF.** Каждый слайд в максимальном размере, собранный в один PDF.
- **Экспорт Google Docs.** Публичные Docs, Slides и Sheets в формате PDF, DOCX, PPTX или XLSX.
@@ -455,7 +455,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Галереи изображений.** Целые галереи и профили с 250+ сайтов с помощью gallery-dl.
- **Scribd.** Сохраняйте читаемые книги как PDF через вашу сессию. *в планах*
-### Изображения (9)
+### Изображения (9)
- **Увеличение.** Real-ESRGAN на любом GPU с поддержкой Vulkan, 2x, 3x или 4x. *бета*
- **Изменение размера.** Пакетно по ширине, высоте, вписыванию или процентам, при желании со сменой формата.
@@ -467,7 +467,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Спрайт-лист.** Нарежьте лист на кадры, соберите кадры обратно вместе с атласом или измените размер папки по правилу.
- **OCR.** Скопируйте текст из изображений и слайдов. *бета*
-### Система (10, пункты только для Windows отмечены)
+### Система (10, пункты только для Windows отмечены)
- **Очистка кэшей.** Временные файлы, логи и кэши приложений по правилам для каждой операционной системы. Вы просматриваете список, прежде чем что-то удалится.
- **Анализ диска.** Что занимает место: карта-дерево и самые большие файлы, с кнопкой отправки в корзину.
@@ -480,7 +480,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **Очистка реестра.** Осиротевшие записи, с резервной копией `.reg` перед удалением. Windows. *бета*
- **Обновление ПО.** Обновляйте программы пакетно через winget, Chocolatey и Scoop. Windows. *бета*
-### Файлы (5)
+### Файлы (5)
- **Дубликаты.** Найдите одинаковые файлы по хешу и безопасно освободите место.
- **Массовое переименование.** Регулярные выражения, счётчики и смена регистра с предпросмотром перед применением.
@@ -488,20 +488,20 @@ Firefox: **Настройки → Плагины → Расширение для
- **Поиск файлов.** Мгновенный поиск через Everything на Windows, Spotlight на macOS или fd на Linux.
- **Предотвращение сна.** Не давайте компьютеру уснуть во время долгих задач.
-### Загрузки (2)
+### Загрузки (2)
- **Ускоренная загрузка.** Большие файлы в 16 соединений, докачка и контрольная сумма через aria2.
- **Манифест HLS / DASH.** Вставьте `.m3u8` или `.mpd` с Referer и cookie. FFmpeg сохранит MP4.
-### Автоматизация (1)
+### Автоматизация (1)
- **Авто-кликер.** Кликайте с точно заданной скоростью, с глобальной горячей клавишей, лимитами и случайными диапазонами. Windows, macOS и Linux. *бета*
-### Телефон (1)
+### Телефон (1)
- **Отправить на телефон.** Файлы, ссылки и текст на сопряжённое устройство KDE Connect.
-### ИИ (6)
+### ИИ (6)
- **Сравнение цен.** Стоимость одной и той же модели у разных провайдеров, с ценами из LiteLLM и models.dev.
- **Расходы на ИИ.** Сколько LibreGet потратил на ИИ — по дням, моделям и задачам, из локального журнала.
@@ -510,7 +510,7 @@ Firefox: **Настройки → Плагины → Расширение для
- **API-ключи.** Локальное хранилище ключей и аккаунтов с проверкой соединения, балансом для OpenRouter, DeepSeek, SiliconFlow и New API и экспортом в Claude Code, Codex, Cherry Studio, opencode или файл `.env`.
- **MCP-сервер.** Инструменты LibreGet, открытые по Model Context Protocol через локальный мост: 37 инструментов за тем же токеном, что использует расширение, с готовыми фрагментами конфигурации для Claude Code, Claude Desktop, Cursor, VS Code, Goose и Codex. Смотрите [LibreGet для ИИ-агентов](#libreget-для-ии-агентов-mcp-сервер-и-плагин-для-claude-code). *бета*
-### CTF и анализ (6)
+### CTF и анализ (6)
Шесть небольших офлайн-утилит для задач capture-the-flag, домашних работ по форензике и моментов «что это за файл».
@@ -559,7 +559,7 @@ Firefox: **Настройки → Плагины → Расширение для
-### Courses
+### Courses
Войдите в **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat** или **Meta-Analysis Academy** через окно браузера внутри приложения, с cookies, сохранёнными расширением, или по email и паролю там, где платформа это позволяет. LibreGet покажет ваши покупки, откроет оглавление курса, чтобы отметить нужные разделы (с подсказкой, сколько уроков защищено DRM и будет пропущено), и скачает все уроки и вложения, при желании со сквозной нумерацией. Hotmart использует актуальный вход через OIDC, так что всё работает после смены авторизации в 2026 году; бесплатные курсы и курсы, выдаваемые вне Hotmart Club, тоже показываются в списке.
@@ -567,7 +567,7 @@ Firefox: **Настройки → Плагины → Расширение для
Войдите по QR-коду или номеру телефона. Просматривайте все каналы и группы, где вы состоите, фильтруйте по фото, видео, документам или аудио, ищите файлы и скачивайте один элемент или весь чат со списком прогресса.
-### Convert
+### Convert
Конвертация через FFmpeg с GPU-ускорением, если оно есть: контейнер, кодек, разрешение, битрейт и сжатие видео и аудио, без интернета.
diff --git a/README_pt_br.md b/README_pt_br.md
index 0d7f1ec1..80fdb699 100644
--- a/README_pt_br.md
+++ b/README_pt_br.md
@@ -173,12 +173,12 @@ O LibreGet tem extratores nativos para as plataformas que as pessoas mais usam e
| Categoria | Sites e formatos |
|---|---|
-| Cursos online | Hotmart, Udemy, Kiwify, Rocketseat e Meta-Analysis Academy pelo plugin Courses. Todas as aulas, escolha de seções, anexos, continuar de onde parou. |
-| Vídeo e áudio | YouTube (vídeos, playlists, canais, live desde o início, capítulos, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clipes, ao vivo), Vimeo, Bluesky, Threads, Pinterest, Douyin |
+| Cursos online | Hotmart, Udemy, Kiwify, Rocketseat e Meta-Analysis Academy pelo plugin Courses. Todas as aulas, escolha de seções, anexos, continuar de onde parou. |
+| Vídeo e áudio | YouTube (vídeos, playlists, canais, live desde o início, capítulos, SponsorBlock), Instagram, TikTok, X/Twitter, Reddit, Twitch (VODs, clipes, ao vivo), Vimeo, Bluesky, Threads, Pinterest, Douyin |
| Bilibili, logado | 4K, HDR, Dolby Vision, Hi-Res sem perdas e Dolby Atmos conforme sua assinatura. Danmaku em XML, ASS ou JSON, arquivos NFO para Kodi e Jellyfin, modelos de nome, 11 tipos de URL incluindo bangumi, cursos, favoritos, assistir depois e histórico |
-| Galerias de imagens | Galerias e perfis inteiros de mais de 250 sites via gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono e outros) |
-| Em lote | Cole vários links ou carregue um `.txt`, baixe subreddits inteiros, perfis do Reddit e do X, perfis do Instagram e do Pinterest |
-| Arquivos e transferência | Arquivos `.torrent` e magnets com cliente BitTorrent embutido, arquivos HTTP diretos, manifestos HLS e DASH, e transferência direta entre duas instalações do LibreGet com um código curto de palavras |
+| Galerias de imagens | Galerias e perfis inteiros de mais de 250 sites via gallery-dl (DeviantArt, Pixiv, ArtStation, Flickr, Tumblr, Imgur, Kemono e outros) |
+| Em lote | Cole vários links ou carregue um `.txt`, baixe subreddits inteiros, perfis do Reddit e do X, perfis do Instagram e do Pinterest |
+| Arquivos e transferência | Arquivos `.torrent` e magnets com cliente BitTorrent embutido, arquivos HTTP diretos, manifestos HLS e DASH, e transferência direta entre duas instalações do LibreGet com um código curto de palavras |
| Telegram | Fotos, vídeos, arquivos e áudios de qualquer canal ou grupo em que você esteja, pelo plugin Telegram |
Opções que você define uma vez e esquece: qualidade padrão, formato de áudio (MP3, M4A, Opus, FLAC ou WAV), idiomas e formato de legenda (SRT, VTT, ASS, embutida ou ao lado), thumbnail e metadados embutidos, modelo de nome de arquivo, organizar por plataforma, pular arquivos existentes, dividir por capítulos, limite de velocidade, downloads simultâneos, proxy. Regras mandam um canal ou host para a pasta e a qualidade que você escolher sem perguntar de novo. Canais seguidos são verificados em segundo plano e podem baixar novos vídeos automaticamente, com notificação na bandeja.
@@ -260,7 +260,7 @@ Legenda de status: sem marca significa pronta, **beta** significa que funciona m
- **Thumbnail real.** Os frames que a CDN já tem em 25, 50 e 75 por cento, em vez da capa clickbait.
- **Forçar H.264.** Um interruptor na extensão do navegador que mantém o YouTube em H.264 em vez de VP9 e AV1, para máquinas que engasgam com codecs novos.
-### Fala e legendas (8)
+### Fala e legendas (8)
- **Transcrever.** Áudio ou vídeo para legendas com whisper.cpp, offline. Modelos baixam sob demanda, aceleração Metal no macOS.
- **Texto para fala.** Vozes naturais do Microsoft Edge, grátis, com arquivo de legenda sincronizado.
@@ -269,7 +269,7 @@ Legenda de status: sem marca significa pronta, **beta** significa que funciona m
- **Clonar voz**, **Criar voz** e **Isolar vocais** por uma instalação do VoiceStudio na sua máquina. *beta*
- **Ditado.** Aperte um atalho global, fale, e o whisper digita o texto onde o cursor está. *beta*
-### Edição de vídeo (6)
+### Edição de vídeo (6)
- **Cortar trecho.** Escolha um vídeo no disco e corte um pedaço. O resultado cai na fila de downloads.
- **Converter.** Troque contêiner, codec ou resolução, ou comprima, pelo plugin Convert.
@@ -341,7 +341,7 @@ Funciona sem login para tudo que é público. Cookies só são necessários para
- **Temas e cores.** Personalize o cliente do Spotify com temas do Spicetify. *beta*
- **Extensões.** Instale extensões e apps do Marketplace do Spicetify. *beta*
-### PDF (6)
+### PDF (6)
- **Juntar.** Una vários PDFs em um, na ordem que quiser.
- **Dividir.** Extraia páginas ou quebre um PDF em partes.
@@ -350,7 +350,7 @@ Funciona sem login para tudo que é público. Cookies só são necessários para
- **OCR.** Torne PDFs escaneados pesquisáveis. *beta*
- **PDF seguro.** Reconstrua um PDF a partir de pixels para remover scripts e formulários.
-### Documentos (5)
+### Documentos (5)
- **SlideShare para PDF.** Todos os slides no maior tamanho, montados em um PDF.
- **Exportar Google Docs.** Docs, Slides e Sheets públicos em PDF, DOCX, PPTX ou XLSX.
@@ -358,29 +358,29 @@ Funciona sem login para tudo que é público. Cookies só são necessários para
- **Galerias de imagens.** Galerias e perfis inteiros de mais de 250 sites com gallery-dl.
- **Scribd.** Salve livros legíveis em PDF usando a sua própria sessão. *planejada*
-### Imagens (3)
+### Imagens (3)
- **Upscale.** Real-ESRGAN em qualquer GPU Vulkan, 2x, 3x ou 4x. *beta*
- **Redimensionar imagens.** Em lote por largura, altura, encaixe ou porcentagem, convertendo o formato se quiser.
- **OCR.** Copie o texto de imagens e slides. *beta*
-### Arquivos (4)
+### Arquivos (4)
- **Duplicados.** Encontre arquivos idênticos por hash e libere espaço com segurança.
- **Renomear em lote.** Regex, contadores e troca de caixa com prévia antes de aplicar.
- **Encontrar arquivos.** Busca instantânea com Everything no Windows, Spotlight no macOS ou fd no Linux.
- **Manter acordado.** Impeça o computador de dormir durante trabalhos longos.
-### Downloads (2)
+### Downloads (2)
- **Download acelerado.** Arquivos grandes com 16 conexões, retomada e checksum via aria2.
- **Manifesto HLS / DASH.** Cole um `.m3u8` ou `.mpd` com Referer e cookie. O FFmpeg salva um MP4.
-### Celular (1)
+### Celular (1)
- **Enviar para o celular.** Arquivos, links e texto para um dispositivo KDE Connect pareado.
-### Sistema (9, itens só para Windows marcados)
+### Sistema (9, itens só para Windows marcados)
- **Limpar caches.** Temporários, logs e caches de apps com regras por sistema. Você revisa a lista antes de qualquer coisa ser apagada.
- **Analisador de disco.** O que ocupa espaço, em treemap e na lista dos maiores arquivos, com botão de mandar para a lixeira.
@@ -392,11 +392,11 @@ Funciona sem login para tudo que é público. Cookies só são necessários para
- **Limpador de registro.** Entradas órfãs, com backup `.reg` antes de remover. Windows. *beta*
- **Atualizador de programas.** Atualize programas em lote via winget, Chocolatey e Scoop. Windows. *beta*
-### Automação (1)
+### Automação (1)
- **Auto clicker.** Clique na velocidade exata que você definir, com atalho global, limites e intervalos aleatórios. Windows, macOS e Linux. *beta*
-### IA (6)
+### IA (6)
- **Comparar preços.** O custo do mesmo modelo em vários provedores, com preços do LiteLLM e do models.dev.
- **Gastos com IA.** Quanto o LibreGet gastou com IA, por dia, modelo e tarefa, a partir de um registro local.
@@ -417,7 +417,7 @@ Plugins são bibliotecas Rust separadas, carregadas na inicialização. O LibreG
-### Courses
+### Courses
Entre na **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat** ou **Meta-Analysis Academy** por uma janela de navegador dentro do app, com cookies salvos pela extensão, ou com e-mail e senha onde a plataforma permite. O LibreGet lista suas compras, abre o sumário do curso para você marcar as seções que quer (avisando quantas aulas têm DRM e serão puladas) e baixa todas as aulas e anexos, com numeração contínua se quiser. A Hotmart usa o fluxo de login OIDC atual, então continua funcionando depois da mudança de autenticação de 2026, e cursos gratuitos e cursos entregues fora do Hotmart Club também aparecem na lista.
@@ -425,7 +425,7 @@ Entre na **Hotmart**, **Udemy**, **Kiwify**, **Rocketseat** ou **Meta-Analysis A
Entre com QR code ou número de telefone. Navegue por todos os canais e grupos em que está, filtre por foto, vídeo, documento ou áudio, busque arquivos e baixe um item ou o chat inteiro com lista de progresso.
-### Convert
+### Convert
Conversões com FFmpeg e aceleração por GPU quando a máquina tem: contêiner, codec, resolução, bitrate e compressão de vídeo e áudio, sem internet.
diff --git a/README_zh_CN.md b/README_zh_CN.md
index 3b0257b6..5cc147a2 100644
--- a/README_zh_CN.md
+++ b/README_zh_CN.md
@@ -173,12 +173,12 @@ LibreGet 为最常用的平台写了原生提取器,其余的交给 [yt-dlp](h
| 类别 | 网站与格式 |
|---|---|
-| 在线课程 | 通过 Courses 插件支持 Hotmart、Udemy、Kiwify、Rocketseat 和 Meta-Analysis Academy。全部课时、章节选择、附件、从上次位置继续。 |
-| 视频与音频 | YouTube(视频、播放列表、频道、从头录直播、章节、SponsorBlock)、Instagram、TikTok、X/Twitter、Reddit、Twitch(录像、剪辑、直播)、Vimeo、Bluesky、Threads、Pinterest、抖音 |
+| 在线课程 | 通过 Courses 插件支持 Hotmart、Udemy、Kiwify、Rocketseat 和 Meta-Analysis Academy。全部课时、章节选择、附件、从上次位置继续。 |
+| 视频与音频 | YouTube(视频、播放列表、频道、从头录直播、章节、SponsorBlock)、Instagram、TikTok、X/Twitter、Reddit、Twitch(录像、剪辑、直播)、Vimeo、Bluesky、Threads、Pinterest、抖音 |
| 哔哩哔哩,登录后 | 按你的会员等级提供 4K、HDR、杜比视界、Hi-Res 无损和杜比全景声。弹幕导出为 XML、ASS 或 JSON,为 Kodi 和 Jellyfin 生成 NFO,自定义命名模板,支持 11 种链接类型,包括番剧、课程、收藏夹、稍后再看和历史记录 |
-| 图片画廊 | 通过 gallery-dl 下载 250+ 网站的整个画廊和主页(DeviantArt、Pixiv、ArtStation、Flickr、Tumblr、Imgur、Kemono 等) |
-| 批量 | 粘贴多条链接或载入 `.txt`,下载整个 subreddit、Reddit 和 X 的主页、Instagram 和 Pinterest 的主页 |
-| 文件与传输 | 用内置 BitTorrent 客户端下载 `.torrent` 和磁力链接,HTTP 直链,HLS 和 DASH 清单,以及两台装了 LibreGet 的电脑之间用一串短口令互传文件 |
+| 图片画廊 | 通过 gallery-dl 下载 250+ 网站的整个画廊和主页(DeviantArt、Pixiv、ArtStation、Flickr、Tumblr、Imgur、Kemono 等) |
+| 批量 | 粘贴多条链接或载入 `.txt`,下载整个 subreddit、Reddit 和 X 的主页、Instagram 和 Pinterest 的主页 |
+| 文件与传输 | 用内置 BitTorrent 客户端下载 `.torrent` 和磁力链接,HTTP 直链,HLS 和 DASH 清单,以及两台装了 LibreGet 的电脑之间用一串短口令互传文件 |
| Telegram | 通过 Telegram 插件下载你所在的任何频道或群组里的照片、视频、文件和音频 |
设置一次就不用再管的选项:默认清晰度、纯音频格式(MP3、M4A、Opus、FLAC 或 WAV)、字幕语言和格式(SRT、VTT、ASS,内嵌或外挂)、封面和元数据嵌入、文件名模板、按平台分文件夹、跳过已有文件、按章节切分、限速、并发数、代理。规则可以把某个频道或域名固定送到指定文件夹和清晰度,不再每次询问。关注的频道会在后台检查,可以自动下载新视频并在托盘通知。
@@ -260,7 +260,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
- **真实截图。** CDN 已有的 25%、50%、75% 位置画面帖,而不是标题党封面。
- **强制 H.264。** 浏览器扩展里的一个开关,让 YouTube 保持使用 H.264 而不是 VP9 和 AV1,给新编码播放卡顿的机器用。
-### 语音与字幕(8)
+### 语音与字幕(8)
- **转写。** 用 whisper.cpp 离线把音频或视频转成字幕。模型按需下载,macOS 上用 Metal 加速。
- **文字转语音。** 微软 Edge 的自然语音,免费,附带同步字幕文件。
@@ -269,7 +269,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
- **声音克隆**、**声音设计** 和 **人声分离**,通过本机安装的 VoiceStudio 完成。*beta*
- **听写。** 按下全局快捷键说话,whisper 把文字直接输入到光标所在处。*beta*
-### 视频编辑(6)
+### 视频编辑(6)
- **剪片段。** 选一个本地视频,剪出一段。结果进入下载队列。
- **转换。** 通过 Convert 插件更换容器、编码、分辨率或压缩。
@@ -341,7 +341,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
- **主题与配色。** 用 Spicetify 主题定制 Spotify 客户端。*beta*
- **扩展。** 从 Spicetify Marketplace 安装扩展和自定义应用。*beta*
-### PDF(6)
+### PDF(6)
- **合并。** 按你选的顺序把多个 PDF 合成一个。
- **拆分。** 提取页面,或把 PDF 拆成几份。
@@ -350,7 +350,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
- **OCR。** 让扫描版 PDF 可以搜索。*beta*
- **安全 PDF。** 从像素重建 PDF,去掉脚本和表单。
-### 文档(5)
+### 文档(5)
- **SlideShare 转 PDF。** 每一页以最大尺寸抓取,合成一个 PDF。
- **Google 文档导出。** 公开的 Docs、Slides、Sheets 导出为 PDF、DOCX、PPTX 或 XLSX。
@@ -358,29 +358,29 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
- **图片画廊。** 通过 gallery-dl 下载 250+ 网站的整个画廊和主页。
- **Scribd。** 用你自己的会话把可阅读的书存成 PDF。*计划中*
-### 图片(3)
+### 图片(3)
- **超分放大。** 在任何 Vulkan GPU 上用 Real-ESRGAN 放大 2 倍、3 倍或 4 倍。*beta*
- **批量缩放。** 按宽、高、适配或百分比批量缩放,可顺带转换格式。
- **OCR。** 从图片和幻灯片里把文字复制出来。*beta*
-### 文件(4)
+### 文件(4)
- **重复文件。** 按哈希找出完全相同的文件,安全释放空间。
- **批量重命名。** 正则、计数器和大小写转换,应用前有预览。
- **查找文件。** 即时搜索:Windows 上用 Everything,macOS 上用 Spotlight,Linux 上用 fd。
- **保持唤醒。** 长任务期间阻止电脑休眠。
-### 下载(2)
+### 下载(2)
- **加速下载。** 用 aria2 以 16 个连接下载大文件,支持续传和校验。
- **HLS / DASH 清单。** 粘贴 `.m3u8` 或 `.mpd`,附上 Referer 和 Cookie,FFmpeg 保存为 MP4。
-### 手机(1)
+### 手机(1)
- **发送到手机。** 把文件、链接和文字发到已配对的 KDE Connect 设备。
-### 系统(9,仅 Windows 的项目已标注)
+### 系统(9,仅 Windows 的项目已标注)
- **清理缓存。** 按各系统的规则清理临时文件、日志和应用缓存。删除前先给你看清单。
- **磁盘分析。** 用树状图和最大文件列表看清空间去哪了,一键移到废纸篓。
@@ -392,11 +392,11 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
- **注册表清理。** 清理孤立项,删除前先备份 `.reg`。Windows。*beta*
- **软件更新器。** 通过 winget、Chocolatey 和 Scoop 批量更新程序。Windows。*beta*
-### 自动化(1)
+### 自动化(1)
- **自动点击器。** 按你设定的速度点击,支持全局快捷键、次数上限和随机间隔。Windows、macOS 和 Linux。*beta*
-### AI(6)
+### AI(6)
- **比较价格。** 同一模型在不同服务商的价格,数据来自 LiteLLM 和 models.dev。
- **AI 花费。** LibreGet 在 AI 上花了多少,按天、模型和任务统计,来自本地账本。
@@ -417,7 +417,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
-### Courses
+### Courses
通过应用内的浏览器窗口登录 **Hotmart**、**Udemy**、**Kiwify**、**Rocketseat** 或 **Meta-Analysis Academy**,也可以使用扩展保存的 Cookie,或在平台允许时直接用邮箱和密码。LibreGet 列出你购买的课程,打开课程大纲让你勾选想要的章节(并告诉你有多少课时受 DRM 保护、会被跳过),然后下载全部课时和附件,需要的话可以连续编号。Hotmart 使用当前的 OIDC 登录流程,所以在 Hotmart 2026 年更换认证方式之后仍然可用,免费课程和在 Hotmart Club 之外交付的课程也会列出来。
@@ -425,7 +425,7 @@ Tools 是 LibreGet 里长到下载之外的那部分。每个方块是一项工
用二维码或手机号登录。浏览你所在的所有频道和群组,按照片、视频、文档或音频筛选,搜索文件,下载单个条目或整个聊天并显示进度列表。
-### Convert
+### Convert
FFmpeg 转换,机器支持时使用 GPU 加速:视频和音频的容器、编码、分辨率、码率和压缩,无需联网。
diff --git a/browser-extension/chrome/src/detect.js b/browser-extension/chrome/src/detect.js
index 4e4c854e..9060c863 100644
--- a/browser-extension/chrome/src/detect.js
+++ b/browser-extension/chrome/src/detect.js
@@ -57,6 +57,7 @@ function detectPlatform(url) {
if (matchesHost(host, "vimeo.com")) return "vimeo";
if (matchesHost(host, "udemy.com")) return "udemy";
if (matchesHost(host, "bilibili.com") || host === "b23.tv") return "bilibili";
+ if (host === "docs.google.com") return "gdocs";
return null;
}
@@ -90,6 +91,8 @@ function detectContentType(platform, url) {
return parseUdemy(segments);
case "bilibili":
return parseBilibili(segments);
+ case "gdocs":
+ return parseGdocs(segments);
default:
return "unknown";
}
@@ -265,6 +268,20 @@ function parseBilibili(segments) {
return segments[0] === "video" && segments[1] ? "video" : "unknown";
}
+function parseGdocs(segments) {
+ if (
+ (segments[0] === "presentation" || segments[0] === "document" || segments[0] === "spreadsheets") &&
+ segments[1] === "d" &&
+ segments[2]
+ ) {
+ if (segments[2] === "e") {
+ return segments[3] ? "post" : "unknown";
+ }
+ return "post";
+ }
+ return "unknown";
+}
+
function matchesHost(host, domain) {
return host === domain || host.endsWith(`.${domain}`);
}
diff --git a/browser-extension/chrome/tests/detect.test.mjs b/browser-extension/chrome/tests/detect.test.mjs
index d0986639..73595361 100644
--- a/browser-extension/chrome/tests/detect.test.mjs
+++ b/browser-extension/chrome/tests/detect.test.mjs
@@ -341,3 +341,15 @@ test("Bilibili: b23.tv short link", () => {
test("Bilibili: homepage is unknown", () => {
assertUnsupported("https://www.bilibili.com/", "bilibili", "unknown");
});
+
+// ── Google Docs / Slides / Sheets ────────────────────────────────────────
+
+test("Google Slides: standard presentation and pubembed", () => {
+ assertSupported("https://docs.google.com/presentation/d/1AbC_d-e/edit#slide=1", "gdocs", "post");
+ assertSupported(
+ "https://docs.google.com/presentation/d/e/2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz/pubembed?start=false",
+ "gdocs",
+ "post"
+ );
+ assertUnsupported("https://docs.google.com/presentation/u/0/", "gdocs", "unknown");
+});
diff --git a/browser-extension/firefox/src/detect.js b/browser-extension/firefox/src/detect.js
index 4e4c854e..9060c863 100644
--- a/browser-extension/firefox/src/detect.js
+++ b/browser-extension/firefox/src/detect.js
@@ -57,6 +57,7 @@ function detectPlatform(url) {
if (matchesHost(host, "vimeo.com")) return "vimeo";
if (matchesHost(host, "udemy.com")) return "udemy";
if (matchesHost(host, "bilibili.com") || host === "b23.tv") return "bilibili";
+ if (host === "docs.google.com") return "gdocs";
return null;
}
@@ -90,6 +91,8 @@ function detectContentType(platform, url) {
return parseUdemy(segments);
case "bilibili":
return parseBilibili(segments);
+ case "gdocs":
+ return parseGdocs(segments);
default:
return "unknown";
}
@@ -265,6 +268,20 @@ function parseBilibili(segments) {
return segments[0] === "video" && segments[1] ? "video" : "unknown";
}
+function parseGdocs(segments) {
+ if (
+ (segments[0] === "presentation" || segments[0] === "document" || segments[0] === "spreadsheets") &&
+ segments[1] === "d" &&
+ segments[2]
+ ) {
+ if (segments[2] === "e") {
+ return segments[3] ? "post" : "unknown";
+ }
+ return "post";
+ }
+ return "unknown";
+}
+
function matchesHost(host, domain) {
return host === domain || host.endsWith(`.${domain}`);
}
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 5657baa4..5124c3bb 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -228,6 +228,18 @@ dependencies = [
"rustversion",
]
+[[package]]
+name = "arrayref"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
+
+[[package]]
+name = "arrayvec"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"
+
[[package]]
name = "assert_cfg"
version = "0.1.0"
@@ -1389,6 +1401,15 @@ dependencies = [
"libc",
]
+[[package]]
+name = "core_maths"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30"
+dependencies = [
+ "libm",
+]
+
[[package]]
name = "cpubits"
version = "0.1.1"
@@ -1507,7 +1528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a"
dependencies = [
"quote",
- "syn 2.0.117",
+ "syn 3.0.3",
]
[[package]]
@@ -1615,6 +1636,12 @@ version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06"
+[[package]]
+name = "data-url"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"
+
[[package]]
name = "dbus"
version = "0.9.12"
@@ -2086,6 +2113,15 @@ version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59"
+[[package]]
+name = "euclid"
+version = "0.22.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "event-listener"
version = "2.5.3"
@@ -2223,6 +2259,12 @@ dependencies = [
"zlib-rs",
]
+[[package]]
+name = "float-cmp"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
+
[[package]]
name = "fnv"
version = "1.0.7"
@@ -2241,6 +2283,29 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
+[[package]]
+name = "fontconfig-parser"
+version = "0.5.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646"
+dependencies = [
+ "roxmltree",
+]
+
+[[package]]
+name = "fontdb"
+version = "0.22.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3a6f9af55fb97ad673fb7a69533eb2f967648a06fa21f8c9bb2cd6d33975716"
+dependencies = [
+ "fontconfig-parser",
+ "log",
+ "memmap2",
+ "slotmap",
+ "tinyvec",
+ "ttf-parser",
+]
+
[[package]]
name = "foreign-types"
version = "0.3.2"
@@ -2610,6 +2675,16 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "gif"
+version = "0.13.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b"
+dependencies = [
+ "color_quant",
+ "weezl 0.1.12",
+]
+
[[package]]
name = "gif"
version = "0.14.2"
@@ -3417,8 +3492,8 @@ dependencies = [
"bytemuck",
"byteorder-lite",
"color_quant",
- "gif",
- "image-webp",
+ "gif 0.14.2",
+ "image-webp 0.2.4",
"moxcms",
"num-traits",
"png 0.18.1",
@@ -3427,6 +3502,16 @@ dependencies = [
"zune-jpeg 0.5.15",
]
+[[package]]
+name = "image-webp"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904"
+dependencies = [
+ "byteorder-lite",
+ "quick-error",
+]
+
[[package]]
name = "image-webp"
version = "0.2.4"
@@ -3437,6 +3522,12 @@ dependencies = [
"quick-error",
]
+[[package]]
+name = "imagesize"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285"
+
[[package]]
name = "indexmap"
version = "1.9.3"
@@ -3787,6 +3878,17 @@ dependencies = [
"zeroize",
]
+[[package]]
+name = "kurbo"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62"
+dependencies = [
+ "arrayvec",
+ "euclid",
+ "smallvec",
+]
+
[[package]]
name = "lazy_static"
version = "1.5.0"
@@ -3885,6 +3987,12 @@ dependencies = [
"windows-link 0.2.1",
]
+[[package]]
+name = "libm"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
+
[[package]]
name = "libredox"
version = "0.1.12"
@@ -4029,6 +4137,7 @@ dependencies = [
"rand 0.10.2",
"regex",
"reqwest 0.12.28",
+ "resvg",
"rust_xlsxwriter",
"sanitize-filename",
"serde",
@@ -5647,6 +5756,12 @@ dependencies = [
"siphasher",
]
+[[package]]
+name = "pico-args"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
+
[[package]]
name = "pin-project-lite"
version = "0.2.16"
@@ -6278,6 +6393,23 @@ dependencies = [
"web-sys",
]
+[[package]]
+name = "resvg"
+version = "0.44.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a325d5e8d1cebddd070b13f44cec8071594ab67d1012797c121f27a669b7958"
+dependencies = [
+ "gif 0.13.3",
+ "image-webp 0.1.3",
+ "log",
+ "pico-args",
+ "rgb",
+ "svgtypes",
+ "tiny-skia",
+ "usvg",
+ "zune-jpeg 0.4.21",
+]
+
[[package]]
name = "rfd"
version = "0.17.2"
@@ -6304,6 +6436,15 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "rgb"
+version = "0.8.53"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4"
+dependencies = [
+ "bytemuck",
+]
+
[[package]]
name = "ring"
version = "0.17.14"
@@ -6327,6 +6468,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "roxmltree"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
+
[[package]]
name = "rusqlite"
version = "0.32.1"
@@ -6501,6 +6648,24 @@ version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
+[[package]]
+name = "rustybuzz"
+version = "0.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c85d1ccd519e61834798eb52c4e886e8c2d7d698dd3d6ce0b1b47eb8557f1181"
+dependencies = [
+ "bitflags 2.13.1",
+ "bytemuck",
+ "core_maths",
+ "log",
+ "smallvec",
+ "ttf-parser",
+ "unicode-bidi-mirroring",
+ "unicode-ccc",
+ "unicode-properties",
+ "unicode-script",
+]
+
[[package]]
name = "ryu"
version = "1.0.23"
@@ -6995,6 +7160,15 @@ version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2"
+[[package]]
+name = "simplecss"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c"
+dependencies = [
+ "log",
+]
+
[[package]]
name = "siphasher"
version = "1.0.2"
@@ -7017,6 +7191,15 @@ version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
+[[package]]
+name = "slotmap"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038"
+dependencies = [
+ "version_check",
+]
+
[[package]]
name = "smallvec"
version = "1.15.1"
@@ -7124,6 +7307,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
+[[package]]
+name = "strict-num"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
+dependencies = [
+ "float-cmp",
+]
+
[[package]]
name = "string_cache"
version = "0.9.0"
@@ -7202,6 +7394,16 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
+[[package]]
+name = "svgtypes"
+version = "0.15.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"
+dependencies = [
+ "kurbo",
+ "siphasher",
+]
+
[[package]]
name = "swift-rs"
version = "1.0.9"
@@ -7950,6 +8152,32 @@ dependencies = [
"crunchy",
]
+[[package]]
+name = "tiny-skia"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"
+dependencies = [
+ "arrayref",
+ "arrayvec",
+ "bytemuck",
+ "cfg-if",
+ "log",
+ "png 0.17.16",
+ "tiny-skia-path",
+]
+
+[[package]]
+name = "tiny-skia-path"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"
+dependencies = [
+ "arrayref",
+ "bytemuck",
+ "strict-num",
+]
+
[[package]]
name = "tinystr"
version = "0.8.2"
@@ -8397,6 +8625,15 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+[[package]]
+name = "ttf-parser"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a"
+dependencies = [
+ "core_maths",
+]
+
[[package]]
name = "tungstenite"
version = "0.24.0"
@@ -8479,6 +8716,18 @@ version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"
+[[package]]
+name = "unicode-bidi-mirroring"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "64af057ad7466495ca113126be61838d8af947f41d93a949980b2389a118082f"
+
+[[package]]
+name = "unicode-ccc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "260bc6647b3893a9a90668360803a15f96b85a5257b1c3a0c3daf6ae2496de42"
+
[[package]]
name = "unicode-ident"
version = "1.0.24"
@@ -8500,12 +8749,24 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d"
+[[package]]
+name = "unicode-script"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf"
+
[[package]]
name = "unicode-segmentation"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
+[[package]]
+name = "unicode-vo"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94"
+
[[package]]
name = "unicode-width"
version = "0.2.2"
@@ -8567,6 +8828,33 @@ dependencies = [
"url",
]
+[[package]]
+name = "usvg"
+version = "0.44.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7447e703d7223b067607655e625e0dbca80822880248937da65966194c4864e6"
+dependencies = [
+ "base64 0.22.1",
+ "data-url",
+ "flate2",
+ "fontdb",
+ "imagesize",
+ "kurbo",
+ "log",
+ "pico-args",
+ "roxmltree",
+ "rustybuzz",
+ "simplecss",
+ "siphasher",
+ "strict-num",
+ "svgtypes",
+ "tiny-skia-path",
+ "unicode-bidi",
+ "unicode-script",
+ "unicode-vo",
+ "xmlwriter",
+]
+
[[package]]
name = "utf-8"
version = "0.7.6"
@@ -10004,6 +10292,12 @@ dependencies = [
"markup5ever 0.38.0",
]
+[[package]]
+name = "xmlwriter"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
+
[[package]]
name = "xz2"
version = "0.1.7"
diff --git a/src-tauri/libreget-cli/src/commands/common.rs b/src-tauri/libreget-cli/src/commands/common.rs
index 2beb5889..f8b49ed4 100644
--- a/src-tauri/libreget-cli/src/commands/common.rs
+++ b/src-tauri/libreget-cli/src/commands/common.rs
@@ -8,7 +8,7 @@ use libreget_core::core::ytdlp;
use libreget_core::models::media::{DownloadOptions, MediaInfo};
use libreget_core::models::settings::ProxySettings;
use libreget_core::platforms::{
- BilibiliDownloader, BlueskyDownloader, DirectFileDownloader, DouyinDownloader,
+ BilibiliDownloader, BlueskyDownloader, DirectFileDownloader, DouyinDownloader, GdocsDownloader,
GenericYtdlpDownloader, InstagramDownloader, P2pDownloader, PinterestDownloader,
PlatformDownloader, RedditDownloader, ThreadsDownloader, TikTokDownloader,
TwitchClipsDownloader, TwitterDownloader, VimeoDownloader, YouTubeDownloader,
@@ -93,6 +93,7 @@ pub fn core_platform_registry() -> PlatformRegistry {
registry.register(Arc::new(BilibiliDownloader::new()));
registry.register(Arc::new(DouyinDownloader::new()));
registry.register(Arc::new(P2pDownloader::new()));
+ registry.register(Arc::new(GdocsDownloader::new()));
registry.register(Arc::new(DirectFileDownloader::new()));
registry.register(Arc::new(GenericYtdlpDownloader::new()));
registry
diff --git a/src-tauri/libreget-core/Cargo.toml b/src-tauri/libreget-core/Cargo.toml
index 5f8a89c1..082cab9f 100644
--- a/src-tauri/libreget-core/Cargo.toml
+++ b/src-tauri/libreget-core/Cargo.toml
@@ -65,6 +65,8 @@ trash = "5"
enigo = { version = "0.6", default-features = false, features = ["x11rb"] }
fs4 = "1"
image = { version = "0.25", default-features = false, features = ["jpeg", "png", "webp", "gif", "ico"] }
+# Renderizado vectorial SVG (Google Slides / Calameo -> PDF 16:9) em Rust puro.
+resvg = "0.44"
# Tags de audio (ID3/Vorbis/MP4) em Rust puro, sem binario externo.
lofty = "0.25"
# HTML -> Markdown para exportar posts (Substack/Medium), mesmo padrao do pdf-to-markdown.
diff --git a/src-tauri/libreget-core/src/core/dependencies.rs b/src-tauri/libreget-core/src/core/dependencies.rs
index ab982701..1ceca57d 100644
--- a/src-tauri/libreget-core/src/core/dependencies.rs
+++ b/src-tauri/libreget-core/src/core/dependencies.rs
@@ -774,10 +774,15 @@ async fn download_deno() -> anyhow::Result {
tracing::info!("Downloading Deno JS runtime from {}", url);
+ let asset_name = url.rsplit('/').next().unwrap_or("deno.zip");
+ let sums_url = format!("{url}.sha256sum");
+
let client = crate::core::http_client::apply_global_proxy(reqwest::Client::builder())
.timeout(std::time::Duration::from_secs(300))
.build()?;
+ let expected_sha256 = integrity::expected_from_sums_url(&client, &sums_url, asset_name).await?;
+
let response = client.get(url).send().await?;
if !response.status().is_success() {
return Err(anyhow!(
@@ -787,6 +792,7 @@ async fn download_deno() -> anyhow::Result {
}
let bytes = response.bytes().await?;
+ integrity::verify_sha256(&bytes, &expected_sha256, "deno")?;
let data = bytes.to_vec();
let bin_dir_clone = bin_dir.clone();
let deno_name_clone = deno_name.clone();
diff --git a/src-tauri/libreget-core/src/core/tools/gdocs.rs b/src-tauri/libreget-core/src/core/tools/gdocs.rs
index 2f0a549f..9c1e5baa 100644
--- a/src-tauri/libreget-core/src/core/tools/gdocs.rs
+++ b/src-tauri/libreget-core/src/core/tools/gdocs.rs
@@ -11,24 +11,49 @@ pub struct GdocInfo {
pub kind: String,
pub id: String,
pub formats: Vec,
+ #[serde(default)]
+ pub is_published: bool,
}
pub fn parse(url: &str) -> Option {
+ let pub_re = regex::Regex::new(
+ r"docs\.google\.com/(document|presentation|spreadsheets)/d/e/([A-Za-z0-9_-]+)",
+ )
+ .ok()?;
+ if let Some(c) = pub_re.captures(url) {
+ let kind = c[1].to_string();
+ let formats = match kind.as_str() {
+ "presentation" => vec!["pdf", "svg"],
+ "document" => vec!["pdf", "html"],
+ _ => vec!["pdf", "csv"],
+ };
+ return Some(GdocInfo {
+ kind,
+ id: c[2].to_string(),
+ formats: formats.into_iter().map(String::from).collect(),
+ is_published: true,
+ });
+ }
+
let re = regex::Regex::new(
r"docs\.google\.com/(document|presentation|spreadsheets)/d/([A-Za-z0-9_-]+)",
)
.ok()?;
let c = re.captures(url)?;
+ if &c[2] == "e" {
+ return None;
+ }
let kind = c[1].to_string();
let formats = match kind.as_str() {
"document" => vec!["pdf", "docx", "odt", "txt", "epub", "html"],
- "presentation" => vec!["pdf", "pptx", "odp", "txt"],
+ "presentation" => vec!["pdf", "pptx", "odp", "txt", "svg"],
_ => vec!["pdf", "xlsx", "ods", "csv"],
};
Some(GdocInfo {
kind,
id: c[2].to_string(),
formats: formats.into_iter().map(String::from).collect(),
+ is_published: false,
})
}
@@ -68,16 +93,39 @@ pub async fn download(
info.kind
));
}
- let client = super::client()?;
+
+ if info.kind == "presentation" && (info.is_published || format == "svg") {
+ let res = super::gslides::download_presentation(url, format, dest_dir, progress).await?;
+ return Ok(res.output_path);
+ }
+
+ let client = super::gslides::build_google_client(Some(url)).or_else(|_| super::client())?;
let export = export_url(&info, format);
let resp = client.get(&export).send().await?;
- if resp.status().as_u16() == 401 || resp.status().as_u16() == 403 {
+ let status = resp.status();
+ let is_html_redirect = resp
+ .headers()
+ .get(reqwest::header::CONTENT_TYPE)
+ .and_then(|v| v.to_str().ok())
+ .map(|ct| ct.to_ascii_lowercase().starts_with("text/html") && format != "html")
+ .unwrap_or(false);
+
+ if (!status.is_success() || is_html_redirect) && info.kind == "presentation" && format == "pdf"
+ {
+ if let Ok(res) =
+ super::gslides::download_presentation(url, "pdf", dest_dir, progress.clone()).await
+ {
+ return Ok(res.output_path);
+ }
+ }
+
+ if status.as_u16() == 401 || status.as_u16() == 403 {
return Err(anyhow!(
"o arquivo nao e publico; abra no navegador e use Arquivo > Fazer download"
));
}
- if !resp.status().is_success() {
- return Err(anyhow!("Google Docs: HTTP {}", resp.status()));
+ if !status.is_success() {
+ return Err(anyhow!("Google Docs: HTTP {}", status));
}
let name = resp
.headers()
@@ -110,11 +158,21 @@ mod tests {
let i = parse("https://docs.google.com/presentation/d/1AbC_d-e/edit#slide=1").unwrap();
assert_eq!(i.kind, "presentation");
assert_eq!(i.id, "1AbC_d-e");
+ assert!(!i.is_published);
assert!(parse("https://drive.google.com/x").is_none());
assert_eq!(
export_url(&i, "pdf"),
"https://docs.google.com/presentation/d/1AbC_d-e/export?format=pdf"
);
+
+ let pub_i = parse("https://docs.google.com/presentation/d/e/2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz/pubembed?start=false&loop=false").unwrap();
+ assert_eq!(pub_i.kind, "presentation");
+ assert!(pub_i.is_published);
+ assert_eq!(
+ pub_i.id,
+ "2PACX-1vMockDummyId1234567890abcdefghijklmnopqrstuvwxyz"
+ );
+ assert_eq!(pub_i.formats, vec!["pdf".to_string(), "svg".to_string()]);
}
#[test]
diff --git a/src-tauri/libreget-core/src/core/tools/gslides.rs b/src-tauri/libreget-core/src/core/tools/gslides.rs
new file mode 100644
index 00000000..200500c7
--- /dev/null
+++ b/src-tauri/libreget-core/src/core/tools/gslides.rs
@@ -0,0 +1,931 @@
+//! Extractor y compilador vectorial de Google Slides a PDF panorámico (16:9).
+//!
+//! Soporta:
+//! 1. Enlaces publicados en la web (`/presentation/d/e/2PACX-.../pubembed` o `/pub`),
+//! los cuales no disponen de `/export?format=pdf` (devuelven HTTP 404).
+//! 2. Presentaciones restringidas donde `/export?format=pdf` devuelve 401/403 pero el
+//! visor (`/embed` o `/htmlpresent`) entrega las diapositivas en bloques `SK_svgData`.
+//! 3. Compilación local de carpetas de archivos `.svg` ordenados numéricamente (`resvg` +
+//! `tiny-skia` -> PDF 16:9 de `1280 x 720 pt`) y recepción desde el script JS del
+//! navegador a través del `local_bridge`.
+
+use std::collections::{HashMap, HashSet};
+use std::path::{Path, PathBuf};
+use std::sync::{Arc, OnceLock};
+
+use anyhow::{anyhow, Context};
+use base64::Engine;
+use futures::stream::{self, StreamExt};
+use image::codecs::jpeg::JpegEncoder;
+use image::ColorType;
+use regex::Regex;
+use resvg::{tiny_skia, usvg};
+use serde::{Deserialize, Serialize};
+
+pub const SLIDE_WIDTH_PT: f64 = 1280.0;
+pub const SLIDE_HEIGHT_PT: f64 = 720.0;
+
+/// Resolución de rasterizado en píxeles (Full HD 16:9) sobre página física de 1280x720 pt.
+const RENDER_WIDTH_PX: u32 = 1920;
+const RENDER_HEIGHT_PX: u32 = 1080;
+const JPEG_QUALITY: u8 = 92;
+
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct GslidesTarget {
+ pub id: String,
+ pub is_published: bool,
+}
+
+impl GslidesTarget {
+ pub fn viewer_url(&self) -> String {
+ if self.is_published {
+ format!(
+ "https://docs.google.com/presentation/d/e/{}/pubembed?start=false&loop=false",
+ self.id
+ )
+ } else {
+ format!(
+ "https://docs.google.com/presentation/d/{}/embed?start=false&loop=false",
+ self.id
+ )
+ }
+ }
+
+ pub fn htmlpresent_url(&self) -> String {
+ if self.is_published {
+ format!("https://docs.google.com/presentation/d/e/{}/pub", self.id)
+ } else {
+ format!(
+ "https://docs.google.com/presentation/d/{}/htmlpresent",
+ self.id
+ )
+ }
+ }
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct GslidesDownloadResult {
+ pub title: String,
+ pub pages: usize,
+ pub output_path: String,
+ pub format: String,
+}
+
+#[derive(Debug, Clone)]
+pub struct ExtractedPresentation {
+ pub title: String,
+ pub svgs: Vec,
+}
+
+/// Reconoce tanto `/presentation/d/e/2PACX-...` como `/presentation/d/{id}`.
+pub fn parse_gslides_url(url: &str) -> Option {
+ static PUB_RE: OnceLock = OnceLock::new();
+ static DOC_RE: OnceLock = OnceLock::new();
+
+ let pub_re = PUB_RE.get_or_init(|| {
+ Regex::new(r"docs\.google\.com/presentation/d/e/([A-Za-z0-9_-]+)").unwrap()
+ });
+ if let Some(c) = pub_re.captures(url) {
+ return Some(GslidesTarget {
+ id: c[1].to_string(),
+ is_published: true,
+ });
+ }
+
+ let doc_re = DOC_RE
+ .get_or_init(|| Regex::new(r"docs\.google\.com/presentation/d/([A-Za-z0-9_-]+)").unwrap());
+ let c = doc_re.captures(url)?;
+ let id = &c[1];
+ if id == "e" {
+ return None;
+ }
+ Some(GslidesTarget {
+ id: id.to_string(),
+ is_published: false,
+ })
+}
+
+/// Decodifica cadenas literales de JavaScript como las que emite Google Slides
+/// en `SK_svgData = '\x3csvg version\x3d\x221.1\x22 ...'`.
+pub fn unescape_js_string(raw: &str) -> String {
+ let mut out = String::with_capacity(raw.len());
+ let bytes = raw.as_bytes();
+ let mut i = 0;
+ while i < bytes.len() {
+ if bytes[i] == b'\\' && i + 1 < bytes.len() {
+ match bytes[i + 1] {
+ b'x' if i + 3 < bytes.len() => {
+ if let Ok(hex_str) = std::str::from_utf8(&bytes[i + 2..i + 4]) {
+ if let Ok(val) = u8::from_str_radix(hex_str, 16) {
+ out.push(val as char);
+ i += 4;
+ continue;
+ }
+ }
+ }
+ b'u' if i + 5 < bytes.len() => {
+ if let Ok(hex_str) = std::str::from_utf8(&bytes[i + 2..i + 6]) {
+ if let Ok(val) = u32::from_str_radix(hex_str, 16) {
+ if let Some(ch) = char::from_u32(val) {
+ out.push(ch);
+ i += 6;
+ continue;
+ }
+ }
+ }
+ }
+ b'/' => {
+ out.push('/');
+ i += 2;
+ continue;
+ }
+ b'\\' => {
+ out.push('\\');
+ i += 2;
+ continue;
+ }
+ b'\'' => {
+ out.push('\'');
+ i += 2;
+ continue;
+ }
+ b'"' => {
+ out.push('"');
+ i += 2;
+ continue;
+ }
+ b'n' => {
+ out.push('\n');
+ i += 2;
+ continue;
+ }
+ b'r' => {
+ out.push('\r');
+ i += 2;
+ continue;
+ }
+ b't' => {
+ out.push('\t');
+ i += 2;
+ continue;
+ }
+ _ => {}
+ }
+ }
+ // Avanza un carácter UTF-8 válido
+ let rest = &raw[i..];
+ if let Some(ch) = rest.chars().next() {
+ out.push(ch);
+ i += ch.len_utf8();
+ } else {
+ break;
+ }
+ }
+ out
+}
+
+/// Fija explícitamente `width="1280px" height="720px" viewBox="0 0 1280 720"`
+/// en el elemento `