forked from Maasea/sgmodule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eng.YouTube.Enhance.sgmodule
22 lines (18 loc) · 2.05 KB
/
eng.YouTube.Enhance.sgmodule
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!name=Youtube (Music) Enhance
#!desc=Applicable to Youtube & Youtube Music
#!arguments=Block upload button:true,Block clip button:true,Subtitle translation language:off,Lyrics translation language:zh-Hans,Script execution engine:jsc,Enable debug mode:false
#!arguments-desc=- Block parameters: [true, false] \n- Translation parameters: [language code, off] \n- Script engine: [auto, jsc, webview]\n\n1. Language codes follow Google Translate Languages Codes, fill in 'off' to disable translation\n2. Recommended to use jsc engine, but you can still switch to webview to experience new Surge features\n3. Enable debug mode to output more logs
# > Note
# Youtube picture-in-picture and background playback are turned off separately in the client
# - Settings -> General -> Picture-in-Picture
# - Settings -> Background Play and Download -> Background Play
[Rule]
AND,((DOMAIN-SUFFIX,googlevideo.com), (PROTOCOL,UDP)),REJECT
AND,((DOMAIN,youtubei.googleapis.com), (PROTOCOL,UDP)),REJECT
[Script]
youtube.request = type=http-request,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|reel\/reel_watch_sequence|get_watch),requires-body=1,max-size=-1,binary-body-mode=1,engine={{{Script execution engine}}},script-path=https://raw.githubusercontent.com/icenoir/sgmodule/master/Script/Youtube/dist/youtube.request.preview.js
youtube.response = type=http-response,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting|get_watch),requires-body=1,max-size=-1,binary-body-mode=1,engine={{{Script execution engine}}},script-path=https://raw.githubusercontent.com/icenoir/sgmodule/master/Script/Youtube/dist/youtube.response.preview.js,argument="{"lyricLang":"{{{Lyrics translation language}}}","captionLang":"off","blockUpload":{{{Block upload button}}},"blockImmersive":{{{Block clip button}}},"debug":{{{Enable debug mode}}}}"
[Map Local]
^https?:\/\/[\w-]+\.googlevideo\.com\/initplayback.+&oad data-type=text data=""
[MITM]
hostname = %APPEND% *.googlevideo.com, youtubei.googleapis.com