飞牛影视 添加 VideoTogether 脚本操作记录
1. 进入网页目录
cd /usr/local/apps/@appcenter/trim.media/static
2. 备份原始文件
sudo cp index.html index.html.bak
3. 在 </body> 前插入脚本
sudo sed -i '/<\/body>/i <script src="https:\/\/fastly.jsdelivr.net\/gh\/VideoTogether\/VideoTogether@latest\/release\/extension.website.user.js"><\/script>' index.html
4. 验证插入成功
grep -i "VideoTogether" index.html
预期输出:
<script src="https://fastly.jsdelivr.net/gh/VideoTogether/VideoTogether@latest/release/extension.website.user.js"></script>
5. 使修改生效
- 强制刷新浏览器:
Ctrl+F5(Windows)或 Cmd+Shift+R(Mac)
- 若未生效,重启服务:
sudo systemctl restart trim-media
# 或手动重启
sudo pkill trim-media && sudo /usr/local/apps/@appcenter/trim.media/trim-media &
6. 回滚方法(如果出错)
sudo cp index.html.bak index.html
核心文件路径:/usr/local/apps/@appcenter/trim.media/static/index.html