Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 85f7a3c7d1 | |||
| 75ea37c213 | |||
| 812fb41a11 |
+170
@@ -0,0 +1,170 @@
|
||||
<div align="center">
|
||||
<h1>MediaGo</h1>
|
||||
<a href="https://downloader.caorushizi.cn/en/guides.html?form=github">Quick Start</a>
|
||||
<span> • </span>
|
||||
<a href="https://downloader.caorushizi.cn/en?form=github">Website</a>
|
||||
<span> • </span>
|
||||
<a href="https://downloader.caorushizi.cn/en/documents.html?form=github">Docs</a>
|
||||
<span> • </span>
|
||||
<a href="https://github.com/caorushizi/mediago/discussions">Discussions</a>
|
||||
<span> • </span>
|
||||
<a href="https://discord.gg/yxWBVRWGqM">Discord</a>
|
||||
<span> • </span>
|
||||
<a href="https://www.reddit.com/r/MediaGo_Studio/">Reddit</a>
|
||||
<br>
|
||||
|
||||
<a href="https://github.com/caorushizi/mediago/blob/master/README.zh.md">中文</a>
|
||||
<span> • </span>
|
||||
<a href="https://github.com/caorushizi/mediago/blob/master/README.jp.md">日本語</a>
|
||||
<span> • </span>
|
||||
<a href="https://github.com/caorushizi/mediago/blob/master/README.it.md">Italiano</a>
|
||||
<br>
|
||||
|
||||
<img alt="GitHub Downloads (all assets, all releases)" src="https://img.shields.io/github/downloads/caorushizi/mediago/total">
|
||||
<img alt="GitHub Downloads (all assets, latest release)" src="https://img.shields.io/github/downloads/caorushizi/mediago/latest/total">
|
||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/caorushizi/mediago">
|
||||
<img alt="GitHub forks" src="https://img.shields.io/github/forks/caorushizi/mediago">
|
||||
<img alt="GitCode" src="https://gitcode.com/caorushizi/mediago/star/badge.svg">
|
||||
<br>
|
||||
|
||||
<a href="https://trendshift.io/repositories/11083" target="_blank">
|
||||
<img src="https://trendshift.io/api/badge/repositories/11083" alt="caorushizi%2Fmediago | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/>
|
||||
</a>
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
A cross-platform video downloader with built-in sniffing — point it at a
|
||||
page, pick what you want, and save. No packet capture, no browser
|
||||
extensions to configure, no fiddling with command-line tools.
|
||||
|
||||
The app UI currently ships with English, Simplified Chinese, and Italian.
|
||||
|
||||
## ✨ What's inside
|
||||
|
||||
### 🌐 Browser extension for Chrome / Edge
|
||||
|
||||
See something you want on any site → click the extension → send it to
|
||||
MediaGo. Detects video resources automatically, shows the count on the
|
||||
toolbar badge, works with most mainstream video platforms including
|
||||
YouTube, Bilibili and more. Ships bundled with the Desktop app — open
|
||||
**Settings → More Settings → Browser extension directory** to find the
|
||||
install folder.
|
||||
|
||||
### 🎬 YouTube and 1000+ sites
|
||||
|
||||
Powered by yt-dlp under the hood. Supports YouTube, Twitter/X, Instagram,
|
||||
Reddit and [over a thousand more video sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).
|
||||
|
||||
### 🦞 AI assistants can download for you — OpenClaw Skill
|
||||
|
||||
Using Claude Code, Cursor or another AI coding assistant? Install the
|
||||
MediaGo skill and just say _"please download this video: <url>"_.
|
||||
The AI handles the rest.
|
||||
|
||||
```shell
|
||||
npx clawhub@latest install mediago
|
||||
```
|
||||
|
||||
### 🔌 Works with other tools
|
||||
|
||||
MediaGo exposes a full HTTP API — scripts, automation tools and other
|
||||
apps can create download tasks, query progress and manage the list
|
||||
directly. The browser extension uses this same API to talk to the desktop
|
||||
app; anyone else can tap in too.
|
||||
|
||||
### 🎞️ Built-in format conversion
|
||||
|
||||
After a download finishes, convert it to another format or quality
|
||||
without leaving MediaGo. No more opening a separate tool for ffmpeg.
|
||||
|
||||
### 🐳 One-line Docker deployment
|
||||
|
||||
Headless install on your server, then access the web UI from anywhere on
|
||||
the same network:
|
||||
|
||||
```shell
|
||||
docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago caorushizi/mediago:3.5.0
|
||||
```
|
||||
|
||||
Available on [Docker Hub](https://hub.docker.com/r/caorushizi/mediago) and GHCR (`ghcr.io/caorushizi/mediago`) — same image, pick whichever registry is faster for you. Supports both Intel / AMD (amd64) and ARM (arm64). On the desktop build,
|
||||
MediaGo listens on both `127.0.0.1` and your LAN IP out of the box, so
|
||||
phones and tablets on the same Wi-Fi can open the web UI too.
|
||||
|
||||
## 📷 Screenshots
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 📥 Download
|
||||
|
||||
### v3.5.0 (stable)
|
||||
|
||||
- [Windows — installer](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-win32-x64-3.5.0.exe)
|
||||
- [Windows — portable](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-portable-win32-x64-3.5.0.exe)
|
||||
- [macOS — Apple Silicon (arm64)](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-darwin-arm64-3.5.0.dmg)
|
||||
- [macOS — Intel (x64)](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-darwin-x64-3.5.0.dmg)
|
||||
- [Linux (deb)](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-linux-amd64-3.5.0.deb)
|
||||
- [**Docker Hub**](https://hub.docker.com/r/caorushizi/mediago): `docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago caorushizi/mediago:3.5.0`
|
||||
- **GHCR**: `docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago ghcr.io/caorushizi/mediago:3.5.0`
|
||||
|
||||
Browsing older releases? See the [GitHub Releases page](https://github.com/caorushizi/mediago/releases).
|
||||
|
||||
### 🪄 One-click Docker deployment via BT Panel
|
||||
|
||||
1. Install [BT Panel](https://www.bt.cn/new/download.html?r=dk_mediago) using the official script.
|
||||
2. Log in to the panel, click **Docker** in the sidebar and finish the
|
||||
Docker service setup (just follow the prompts).
|
||||
3. Find **MediaGo** in the app store, click **Install**, configure your
|
||||
domain, and you're done.
|
||||
|
||||
## 📝 What's new in v3.5.0
|
||||
|
||||
- **🌐 Browser extension** — sniff videos on any site, send to MediaGo
|
||||
in one click
|
||||
- **🎬 YouTube + 1000+ sites** — powered by yt-dlp
|
||||
- **🦞 OpenClaw Skill** — download videos via AI coding assistants
|
||||
- **🔌 HTTP API** — integrate with scripts, automation and third-party tools
|
||||
- **🎞️ In-app format conversion** — choose output format and quality
|
||||
- **🐳 Simpler Docker deployment** — mount a single folder, multi-arch images on GHCR
|
||||
- **⚡ Faster startup** — backend rewrite, lower memory footprint, built-in video player
|
||||
|
||||
## 🛠️ Built with
|
||||
|
||||
[](https://react.dev/)
|
||||
[](https://www.electronjs.org)
|
||||
[](https://vitejs.dev)
|
||||
[](https://www.typescriptlang.org/)
|
||||
[](https://tailwindcss.com)
|
||||
[](https://ui.shadcn.com/)
|
||||
[](https://go.dev/)
|
||||
[](https://ant.design)
|
||||
|
||||
## 🙏 Acknowledgements
|
||||
|
||||
- [N_m3u8DL-RE](https://github.com/nilaoda/N_m3u8DL-RE)
|
||||
- [BBDown](https://github.com/nilaoda/BBDown)
|
||||
- [yt-dlp](https://github.com/yt-dlp/yt-dlp)
|
||||
- [aria2](https://aria2.github.io/)
|
||||
- [mediago-core](https://github.com/caorushizi/mediago-core)
|
||||
|
||||
## ⚖️ Disclaimer
|
||||
|
||||
> **This project is for educational and research purposes only. Do not use it for any commercial or illegal purposes.**
|
||||
>
|
||||
> 1. All code and functionality provided by this project are intended solely as a reference for learning about streaming media technologies. Users must comply with the laws and regulations of their jurisdiction.
|
||||
> 2. Any content downloaded using this project remains the property of its original copyright holders. Users should delete downloaded content within 24 hours or obtain proper authorization.
|
||||
> 3. The developers of this project are not responsible for any actions taken by users, including but not limited to downloading copyrighted content or impacting third-party platforms.
|
||||
> 4. Using this project for mass scraping, disrupting platform services, or any activity that infringes upon the legitimate rights of others is strictly prohibited.
|
||||
> 5. By using this project you acknowledge that you have read and agree to this disclaimer. If you do not agree, stop using the project and delete it immediately.
|
||||
|
||||
---
|
||||
|
||||
> Building from source? See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||
>
|
||||
> Translating MediaGo? See [TRANSLATION.md](./TRANSLATION.md).
|
||||
@@ -1,10 +1,16 @@
|
||||
<!-- WEHUB_ZH_README -->
|
||||
> [!NOTE]
|
||||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||||
> [English](./README.en.md) · [原始项目](https://github.com/mediago-dev/mediago) · [上游 README](https://github.com/mediago-dev/mediago/blob/HEAD/README.md)
|
||||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||||
|
||||
<div align="center">
|
||||
<h1>MediaGo</h1>
|
||||
<a href="https://downloader.caorushizi.cn/en/guides.html?form=github">Quick Start</a>
|
||||
<a href="https://downloader.caorushizi.cn/guides.html?form=github">快速开始</a>
|
||||
<span> • </span>
|
||||
<a href="https://downloader.caorushizi.cn/en?form=github">Website</a>
|
||||
<a href="https://downloader.caorushizi.cn?form=github">官网</a>
|
||||
<span> • </span>
|
||||
<a href="https://downloader.caorushizi.cn/en/documents.html?form=github">Docs</a>
|
||||
<a href="https://downloader.caorushizi.cn/documents.html?form=github">文档</a>
|
||||
<span> • </span>
|
||||
<a href="https://github.com/caorushizi/mediago/discussions">Discussions</a>
|
||||
<span> • </span>
|
||||
@@ -13,7 +19,7 @@
|
||||
<a href="https://www.reddit.com/r/MediaGo_Studio/">Reddit</a>
|
||||
<br>
|
||||
|
||||
<a href="https://github.com/caorushizi/mediago/blob/master/README.zh.md">中文</a>
|
||||
<a href="https://github.com/caorushizi/mediago/blob/master/README.md">English</a>
|
||||
<span> • </span>
|
||||
<a href="https://github.com/caorushizi/mediago/blob/master/README.jp.md">日本語</a>
|
||||
<span> • </span>
|
||||
@@ -34,107 +40,87 @@
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
A cross-platform video downloader with built-in sniffing — point it at a
|
||||
page, pick what you want, and save. No packet capture, no browser
|
||||
extensions to configure, no fiddling with command-line tools.
|
||||
跨平台视频下载器,内置嗅探 —— 打开网页、选一下想要的资源、保存完事。不用抓包、不用折腾浏览器插件、不用面对命令行。
|
||||
|
||||
The app UI currently ships with English, Simplified Chinese, and Italian.
|
||||
应用界面目前内置中文、英文和意大利语。
|
||||
|
||||
## ✨ What's inside
|
||||
## ✨ 主打功能
|
||||
|
||||
### 🌐 Browser extension for Chrome / Edge
|
||||
### 🌐 浏览器扩展(Chrome / Edge)
|
||||
|
||||
See something you want on any site → click the extension → send it to
|
||||
MediaGo. Detects video resources automatically, shows the count on the
|
||||
toolbar badge, works with most mainstream video platforms including
|
||||
YouTube, Bilibili and more. Ships bundled with the Desktop app — open
|
||||
**Settings → More Settings → Browser extension directory** to find the
|
||||
install folder.
|
||||
浏览网页时遇到想下的视频 → 点扩展图标 → 一键发到 MediaGo。自动识别页面里的可下载资源,工具栏图标显示检测到的数量,主流视频网站(包括 YouTube、Bilibili 等)都能覆盖。扩展随桌面端安装包一起打包,在 **设置 → 更多设置 → 浏览器扩展目录** 就能找到安装文件夹。
|
||||
|
||||
### 🎬 YouTube and 1000+ sites
|
||||
### 🎬 支持 YouTube 和 1000+ 站点
|
||||
|
||||
Powered by yt-dlp under the hood. Supports YouTube, Twitter/X, Instagram,
|
||||
Reddit and [over a thousand more video sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).
|
||||
底层用的是 yt-dlp。支持 YouTube、Twitter/X、Instagram、Reddit 等 [一千多个视频站点](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)。
|
||||
|
||||
### 🦞 AI assistants can download for you — OpenClaw Skill
|
||||
### 🦞 让 AI 助手帮你下载 —— OpenClaw Skill
|
||||
|
||||
Using Claude Code, Cursor or another AI coding assistant? Install the
|
||||
MediaGo skill and just say _"please download this video: <url>"_.
|
||||
The AI handles the rest.
|
||||
在用 Claude Code、Cursor 等 AI 编程助手?装上 MediaGo Skill 后直接跟 AI 说"帮我下载这个视频:<链接>"就行,剩下的交给 AI。
|
||||
|
||||
```shell
|
||||
npx clawhub@latest install mediago
|
||||
```
|
||||
|
||||
### 🔌 Works with other tools
|
||||
### 🔌 可以和其他工具联动
|
||||
|
||||
MediaGo exposes a full HTTP API — scripts, automation tools and other
|
||||
apps can create download tasks, query progress and manage the list
|
||||
directly. The browser extension uses this same API to talk to the desktop
|
||||
app; anyone else can tap in too.
|
||||
MediaGo 提供一整套 HTTP 接口 —— 脚本、自动化工具、其他 App 都能直接调用 MediaGo 创建下载任务、查询进度、管理列表。浏览器扩展就是通过这套接口和桌面端对话的,你也可以接入自己的工作流。
|
||||
|
||||
### 🎞️ Built-in format conversion
|
||||
### 🎞️ 内置格式转换
|
||||
|
||||
After a download finishes, convert it to another format or quality
|
||||
without leaving MediaGo. No more opening a separate tool for ffmpeg.
|
||||
下载完成后可以直接在 MediaGo 里转换格式、选画质,不用再打开别的软件。
|
||||
|
||||
### 🐳 One-line Docker deployment
|
||||
### 🐳 Docker 一键部署
|
||||
|
||||
Headless install on your server, then access the web UI from anywhere on
|
||||
the same network:
|
||||
服务器端一条命令部署,局域网内任意设备都能打开 Web 界面:
|
||||
|
||||
```shell
|
||||
docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago caorushizi/mediago:3.5.0
|
||||
```
|
||||
|
||||
Available on [Docker Hub](https://hub.docker.com/r/caorushizi/mediago) and GHCR (`ghcr.io/caorushizi/mediago`) — same image, pick whichever registry is faster for you. Supports both Intel / AMD (amd64) and ARM (arm64). On the desktop build,
|
||||
MediaGo listens on both `127.0.0.1` and your LAN IP out of the box, so
|
||||
phones and tablets on the same Wi-Fi can open the web UI too.
|
||||
在 [Docker Hub](https://hub.docker.com/r/caorushizi/mediago) 和 GHCR(`ghcr.io/caorushizi/mediago`)上同步发布 —— 同一份镜像,哪个源更快用哪个。支持 Intel / AMD (amd64) 和 ARM (arm64) 两种架构。桌面版同时监听 `127.0.0.1` 和局域网 IP,同一个 Wi-Fi 下的手机、平板可以直接打开 Web 界面。
|
||||
|
||||
## 📷 Screenshots
|
||||
## 📷 软件截图
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
## 📥 Download
|
||||
## 📥 下载
|
||||
|
||||
### v3.5.0 (stable)
|
||||
### v3.5.0(正式版)
|
||||
|
||||
- [Windows — installer](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-win32-x64-3.5.0.exe)
|
||||
- [Windows — portable](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-portable-win32-x64-3.5.0.exe)
|
||||
- [Windows — 安装版](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-win32-x64-3.5.0.exe)
|
||||
- [Windows — 便携版](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-portable-win32-x64-3.5.0.exe)
|
||||
- [macOS — Apple Silicon (arm64)](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-darwin-arm64-3.5.0.dmg)
|
||||
- [macOS — Intel (x64)](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-darwin-x64-3.5.0.dmg)
|
||||
- [Linux (deb)](https://github.com/caorushizi/mediago/releases/download/v3.5.0/mediago-community-setup-linux-amd64-3.5.0.deb)
|
||||
- [**Docker Hub**](https://hub.docker.com/r/caorushizi/mediago): `docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago caorushizi/mediago:3.5.0`
|
||||
- **GHCR**: `docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago ghcr.io/caorushizi/mediago:3.5.0`
|
||||
- [**Docker Hub**](https://hub.docker.com/r/caorushizi/mediago):`docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago caorushizi/mediago:3.5.0`
|
||||
- **GHCR**:`docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago ghcr.io/caorushizi/mediago:3.5.0`
|
||||
|
||||
Browsing older releases? See the [GitHub Releases page](https://github.com/caorushizi/mediago/releases).
|
||||
查看历史版本请移步 [GitHub Releases](https://github.com/caorushizi/mediago/releases)。
|
||||
|
||||
### 🪄 One-click Docker deployment via BT Panel
|
||||
### 🪄 宝塔面板一键部署 Docker
|
||||
|
||||
1. Install [BT Panel](https://www.bt.cn/new/download.html?r=dk_mediago) using the official script.
|
||||
2. Log in to the panel, click **Docker** in the sidebar and finish the
|
||||
Docker service setup (just follow the prompts).
|
||||
3. Find **MediaGo** in the app store, click **Install**, configure your
|
||||
domain, and you're done.
|
||||
1. 安装宝塔面板,前往 [宝塔面板官网](https://www.bt.cn/new/download.html?r=dk_mediago) 选择正式版的脚本下载安装
|
||||
2. 登录宝塔面板,在菜单栏中点击 **Docker**,首次进入会提示安装 Docker 服务,点击立即安装并按提示完成
|
||||
3. 在应用商店中找到 **MediaGo**,点击安装,配置域名等基本信息即可
|
||||
|
||||
## 📝 What's new in v3.5.0
|
||||
## 📝 v3.5.0 更新要点
|
||||
|
||||
- **🌐 Browser extension** — sniff videos on any site, send to MediaGo
|
||||
in one click
|
||||
- **🎬 YouTube + 1000+ sites** — powered by yt-dlp
|
||||
- **🦞 OpenClaw Skill** — download videos via AI coding assistants
|
||||
- **🔌 HTTP API** — integrate with scripts, automation and third-party tools
|
||||
- **🎞️ In-app format conversion** — choose output format and quality
|
||||
- **🐳 Simpler Docker deployment** — mount a single folder, multi-arch images on GHCR
|
||||
- **⚡ Faster startup** — backend rewrite, lower memory footprint, built-in video player
|
||||
- **🌐 浏览器扩展**:任意网站一键嗅探视频、一键发到 MediaGo
|
||||
- **🎬 YouTube + 1000+ 站点**:集成 yt-dlp
|
||||
- **🦞 OpenClaw Skill**:通过 AI 编程助手下载视频
|
||||
- **🔌 开放 HTTP 接口**:接入脚本、自动化工具和其他应用
|
||||
- **🎞️ 内置格式转换**:选输出格式和画质
|
||||
- **🐳 Docker 部署简化**:挂载一个目录即可,多架构镜像已迁至 GHCR
|
||||
- **⚡ 启动更快**:后端重写,资源占用更低,内置视频播放器
|
||||
|
||||
## 🛠️ Built with
|
||||
## 🛠️ 技术栈
|
||||
|
||||
[](https://react.dev/)
|
||||
[](https://www.electronjs.org)
|
||||
@@ -145,7 +131,7 @@ Browsing older releases? See the [GitHub Releases page](https://github.com/caoru
|
||||
[](https://go.dev/)
|
||||
[](https://ant.design)
|
||||
|
||||
## 🙏 Acknowledgements
|
||||
## 🙏 鸣谢
|
||||
|
||||
- [N_m3u8DL-RE](https://github.com/nilaoda/N_m3u8DL-RE)
|
||||
- [BBDown](https://github.com/nilaoda/BBDown)
|
||||
@@ -153,18 +139,21 @@ Browsing older releases? See the [GitHub Releases page](https://github.com/caoru
|
||||
- [aria2](https://aria2.github.io/)
|
||||
- [mediago-core](https://github.com/caorushizi/mediago-core)
|
||||
|
||||
## ⚖️ Disclaimer
|
||||
## ⚖️ 免责声明
|
||||
|
||||
> **This project is for educational and research purposes only. Do not use it for any commercial or illegal purposes.**
|
||||
> **本项目仅供学习和研究使用,请勿用于任何商业或非法用途。**
|
||||
>
|
||||
> 1. All code and functionality provided by this project are intended solely as a reference for learning about streaming media technologies. Users must comply with the laws and regulations of their jurisdiction.
|
||||
> 2. Any content downloaded using this project remains the property of its original copyright holders. Users should delete downloaded content within 24 hours or obtain proper authorization.
|
||||
> 3. The developers of this project are not responsible for any actions taken by users, including but not limited to downloading copyrighted content or impacting third-party platforms.
|
||||
> 4. Using this project for mass scraping, disrupting platform services, or any activity that infringes upon the legitimate rights of others is strictly prohibited.
|
||||
> 5. By using this project you acknowledge that you have read and agree to this disclaimer. If you do not agree, stop using the project and delete it immediately.
|
||||
> 1. 本项目提供的所有代码和功能仅作为学习流媒体技术的参考,使用者需自行遵守所在地区的法律法规。
|
||||
> 2. 使用本项目下载的任何内容,其版权归原始内容所有者所有。使用者应在下载后 24 小时内删除,或取得版权方授权。
|
||||
> 3. 本项目开发者不对使用者的任何行为承担责任,包括但不限于:下载受版权保护的内容、对第三方平台造成的影响等。
|
||||
> 4. 禁止将本项目用于大规模抓取、破坏平台服务或任何侵犯他人合法权益的行为。
|
||||
> 5. 使用本项目即表示您已阅读并同意本免责声明。如不同意,请立即停止使用并删除本项目。
|
||||
|
||||
---
|
||||
|
||||
> Building from source? See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||
> 想从源码构建?见 [CONTRIBUTING.md](./CONTRIBUTING.md)(英文)。
|
||||
>
|
||||
> Translating MediaGo? See [TRANSLATION.md](./TRANSLATION.md).
|
||||
> 想为 MediaGo 做翻译?见 [TRANSLATION.md](./TRANSLATION.md)(英文)。
|
||||
|
||||
尾注: 感谢[吾爱破解论坛](https://www.52pojie.cn/)
|
||||
lp_Zain@www.52pojie.cn
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# WeHub 来源说明
|
||||
|
||||
- 原始项目:`mediago-dev/mediago`
|
||||
- 原始仓库:https://github.com/mediago-dev/mediago
|
||||
- 导入方式:上游默认分支的最新快照
|
||||
- 原作者、版权和许可证信息以原始仓库及本仓库 LICENSE 为准
|
||||
- 本文件仅用于记录来源,不代表 WeHub 是原项目作者
|
||||
@@ -116,7 +116,6 @@ export default class ElectronApp {
|
||||
const handlers: Record<string, (v: any) => void> = {
|
||||
theme: (v) => {
|
||||
nativeTheme.themeSource = v;
|
||||
this.webviewService.refreshBottomCornerRadius();
|
||||
},
|
||||
useProxy: (v) => {
|
||||
this.webviewService.setProxy(v, this.configCache.get("proxy"));
|
||||
|
||||
@@ -6,7 +6,6 @@ import { i18n } from "../core/i18n";
|
||||
import {
|
||||
type Event,
|
||||
type HandlerDetails,
|
||||
nativeTheme,
|
||||
session,
|
||||
WebContentsView,
|
||||
} from "electron";
|
||||
@@ -29,10 +28,6 @@ import { SniffingHelper, type SourceParams } from "./sniffing-helper.service";
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const preload = require.resolve("@mediago/electron-preload");
|
||||
const BROWSER_VIEW_BOTTOM_RADIUS = 8;
|
||||
const BROWSER_VIEW_DARK_SHELL_BACKGROUND = "#141415";
|
||||
const BROWSER_VIEW_MAIN_SHELL_BACKGROUND = "#F4F7FA";
|
||||
const BROWSER_VIEW_WINDOW_SHELL_BACKGROUND = "#EBF0F5";
|
||||
|
||||
@injectable()
|
||||
@provide()
|
||||
@@ -41,7 +36,6 @@ export default class WebviewService {
|
||||
private blocker?: ElectronBlocker;
|
||||
private defaultSession: string;
|
||||
private viewShow = false;
|
||||
private bottomRadiusCssKey?: string;
|
||||
|
||||
constructor(
|
||||
@inject(MainWindow)
|
||||
@@ -62,7 +56,6 @@ export default class WebviewService {
|
||||
|
||||
this.sniffingHelper.start(privacy);
|
||||
this.sniffingHelper.on("source", this.onSource);
|
||||
nativeTheme.on("updated", this.onNativeThemeUpdated);
|
||||
|
||||
this.setDefaultSession(privacy, true);
|
||||
this.setProxy(useProxy, proxy);
|
||||
@@ -106,7 +99,6 @@ export default class WebviewService {
|
||||
if (!this.view) return;
|
||||
const pageInfo = this.getPageInfo();
|
||||
this.sniffingHelper.update(pageInfo);
|
||||
void this.injectBottomCornerRadius();
|
||||
this.window?.webContents.send("browser:domReady", pageInfo);
|
||||
};
|
||||
|
||||
@@ -158,10 +150,6 @@ export default class WebviewService {
|
||||
this.window?.webContents.send("browser:sourceDetected", item);
|
||||
};
|
||||
|
||||
onNativeThemeUpdated = () => {
|
||||
this.refreshBottomCornerRadius();
|
||||
};
|
||||
|
||||
getPageInfo() {
|
||||
if (!this.view) {
|
||||
throw new Error(i18n.t("browserViewNotFound"));
|
||||
@@ -193,7 +181,6 @@ export default class WebviewService {
|
||||
if (!this.view) return;
|
||||
this.window?.contentView.addChildView(this.view);
|
||||
this.viewShow = true;
|
||||
void this.injectBottomCornerRadius();
|
||||
}
|
||||
|
||||
hide() {
|
||||
@@ -354,88 +341,10 @@ export default class WebviewService {
|
||||
return this.view.webContents.capturePage();
|
||||
}
|
||||
|
||||
refreshBottomCornerRadius() {
|
||||
void this.injectBottomCornerRadius();
|
||||
}
|
||||
|
||||
sendToWindow(channel: string, ...args: unknown[]) {
|
||||
this.window?.webContents.send(channel, ...args);
|
||||
}
|
||||
|
||||
private getBottomCornerBackgroundColor() {
|
||||
if (nativeTheme.shouldUseDarkColors) {
|
||||
return BROWSER_VIEW_DARK_SHELL_BACKGROUND;
|
||||
}
|
||||
|
||||
if (this.browserWindow.window) {
|
||||
return BROWSER_VIEW_WINDOW_SHELL_BACKGROUND;
|
||||
}
|
||||
|
||||
return BROWSER_VIEW_MAIN_SHELL_BACKGROUND;
|
||||
}
|
||||
|
||||
private getBottomCornerRadiusCss() {
|
||||
const radius = BROWSER_VIEW_BOTTOM_RADIUS;
|
||||
const backgroundColor = this.getBottomCornerBackgroundColor();
|
||||
|
||||
return `
|
||||
:root::before,
|
||||
:root::after {
|
||||
content: "";
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: ${radius}px;
|
||||
height: ${radius}px;
|
||||
pointer-events: none;
|
||||
z-index: 2147483647;
|
||||
}
|
||||
|
||||
:root::before {
|
||||
left: 0;
|
||||
background: radial-gradient(
|
||||
circle at top right,
|
||||
transparent ${radius - 0.5}px,
|
||||
${backgroundColor} ${radius}px
|
||||
);
|
||||
}
|
||||
|
||||
:root::after {
|
||||
right: 0;
|
||||
background: radial-gradient(
|
||||
circle at top left,
|
||||
transparent ${radius - 0.5}px,
|
||||
${backgroundColor} ${radius}px
|
||||
);
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
private async injectBottomCornerRadius() {
|
||||
if (!this.view || this.view.webContents.isDestroyed()) return;
|
||||
|
||||
try {
|
||||
const { webContents } = this.view;
|
||||
if (this.bottomRadiusCssKey) {
|
||||
await webContents
|
||||
.removeInsertedCSS(this.bottomRadiusCssKey)
|
||||
.catch(() => {
|
||||
// The previous key may belong to a document that has already navigated.
|
||||
});
|
||||
this.bottomRadiusCssKey = undefined;
|
||||
}
|
||||
|
||||
this.bottomRadiusCssKey = await webContents.insertCSS(
|
||||
this.getBottomCornerRadiusCss(),
|
||||
{ cssOrigin: "user" },
|
||||
);
|
||||
} catch (error) {
|
||||
this.logger.error(
|
||||
"[Webview] failed to inject bottom corner radius CSS",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private removeViewListeners() {
|
||||
if (!this.view) return;
|
||||
const { webContents } = this.view;
|
||||
@@ -457,7 +366,6 @@ export default class WebviewService {
|
||||
this.window?.contentView.removeChildView(this.view);
|
||||
}
|
||||
this.view = null;
|
||||
this.bottomRadiusCssKey = undefined;
|
||||
}
|
||||
|
||||
async clearCache() {
|
||||
|
||||
Reference in New Issue
Block a user