YouTube icon indicating copy to clipboard operation
YouTube copied to clipboard

[Doc]关于apple tv YouTube双语字幕启用的简易妥协方式 (Kodi/Yattee)

Open karelrooted opened this issue 2 years ago • 2 comments

使用了一段时间该双语字幕插件后,youtube体验上升了很多,创意值得赞扬!

在apple tv上调试了一段时间,该平台YouTube强制ssl pin, 没有能开启的方式

可以使用kodi + YouTube add-on 的简易妥协方式(或者invidious+yattee,见评论)

该方式缺点:

  1. 目前最高分辨率只到1080p
  2. kodi需每隔7天重新签名一次(如果有苹果开发者账号则无需)

启用步骤:

  1. 安装kodi: https://kodi.wiki/view/HOW-TO:Install_Kodi_on_Apple_TV_4_and_5_(HD_and_4K)

    • 请注意在合成出ipa文件后,需解压,并在 ./Payload/Kodi.app/AppData/AppHome/system/certs/cacert.pem 可信任根证书文件的最后添加mitm证书(证书的格式需为pem,crt转pem命令: openssl x509 -in ssl.crt -out ssl.pem)
    • 修改完cacert.pem后,重新压缩成zip,并重命名为ipa
    • 重新使用iOS app signer签名上面的ipa合成出最终安装到apple tv上的kodi app
  2. google启用api key,oauth client

    • 增加api key: https://console.cloud.google.com/apis/credentials
    • 增加oauth client: https://console.cloud.google.com/apis/credentials
    • 增加oauth应用测试账号: https://console.cloud.google.com/apis/credentials/consent (添加kodi要登入的youtube账号至测试用户)
  3. kodi YouTube 设置开启字幕,配置api key,oauth client,登入

  4. Enjoy!

karelrooted avatar Oct 18 '23 17:10 karelrooted

使用了如上方式后,遵循了google官方的规则,但是依然无法使用喜欢列表,历史记录等功能,和没登入也没什么区别,如果不在意遵循官方的方式的话,可以考虑使用invidious+Yattee

  1. 安装invidious
git clone https://github.com/iv-org/invidious
cd invidious && docker-compose up
docker-compose cp invidious:/etc/ssl/certs/ca-certificates.crt ./ca-certificates.crt
openssl x509 -in surge.crt -out surge.pem  (需替换为surge实际的mitm证书)
cat surge.pem >> ./ca-certificates.crt
docker-compose cp ca-certificates.crt invidious:/etc/ssl/certs/ca-certificates.crt
  1. 安装Yattee
  • Yattee默认有上架appstore,但是目前的版本暂时不支持字幕功能(见 https://github.com/yattee/yattee/issues/526#issuecomment-1785728153)
  • 暂时需要用最新的prerelease版本 :https://github.com/yattee/yattee/releases/download/1.5.1-169/Yattee-1.5.1-iOS.ipa
  • 安装步骤同上面的kodi,也是需要每隔7天重新签名一次,等官方修复了bug就不需要了

karelrooted avatar Nov 01 '23 12:11 karelrooted

写了一个脚本简化了每隔7天重签及重新安装的步骤 (使用了fastlane和apple configurator的cfgutil 命令行工具):

bash <(curl -L -s https://raw.githubusercontent.com/karelrooted/resignipa/main/resignipa.sh -i ~/kodi.ipa -s "Apple Development: [email protected] (T6SL8W599A)" -p "tvOS Team Provisioning Profile: com.xxxx.kodi" -d Livingroom-AppleTV

签名证书等变量可以通过一次交互模式运行获取:

bash <(curl -L -s https://raw.githubusercontent.com/karelrooted/resignipa/main/resignipa.sh -i ~/kodi.ipa

脚本地址 : https://github.com/karelrooted/resignipa

karelrooted avatar Nov 01 '23 12:11 karelrooted