maasea / sgmodule Goto Github PK
View Code? Open in Web Editor NEWsurge module
surge module
一直转圈播放不了 关了模块又可以
ios系统,shdowrocket软件利用sriptHub订阅的该模块,系统设置中的字幕默认开启为关闭,但是使用过该模块后字幕一直是默认开启的状态,尝试过将argument中的captionLang设置为off,问题依然存在,求解
The request is https://youtubei.googleapis.com/youtubei/v1/browse?key=AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc&retry=1
and the produced result body is undefined when processing request.
The request body dump is here https://github.com/FrontMage/web3d/releases/download/1.0.0/reqbody.dump
主页面广告是完全有效,就是视频开头广告偶尔可以偶尔不行
多谢🙏
一段时间前,忽然这个模组就不太好用了,以为是youtube更新的正常情况,过阵子会好.但是并没有.
于是看了下commit发现一直在更新,作者并没有弃坑, 并且翻阅issues发现我的情况好像有点特殊.
于是来汇报一下.
经过多次删除重装YouTube测试, 每次本模组失效时,可以在最近请求里发现一条 MitM Failed的请求,目标地址为以下其中之一:
rr1---sn-najern7k.googlevideo.com:443
rr2---sn-najern7k.googlevideo.com:443
rr3---sn-najern7k.googlevideo.com:443
rr4---sn-najern7k.googlevideo.com:443
后续针对该url的请求也会出现,大部分正常,MitM Failed的情况则随机出现,
但似乎MitM Failed和广告出现又没有正相关,很奇怪.
按Surge官方说法提示Mitm Failed时表明youtube正使用SSL Pinning机制阻止MITM,似乎无解了.
以上即我最近遇到的情况,感谢作者做出这样一个方便好用的项目.
祝安好!
There are no descriptions about the proto
files. How to get theme and use them in different sections. It seems that the .proto
files are not related to Youtube messages or maybe I am in a wrong way. Please help thank you.
currently youtubeads can't see the video and it rotates loading but still loads the comments and the videos just can't be viewed
偶尔会出现点开视频,视频在正常播放但是视频下面的评论,推荐视频都无法加载出来的情况,重启YouTube后恢复正常
因为脚本改的貌似不太稳定,我是美区自带这个功能,所以怎样去除脚本里的PIP播放?要是太麻烦的话就不用了,多谢。
Sorry that i am using QX but found this sgmodule is really useful, i used Resource Parser to convert this sgmodule for QX but found an error this morning.
Resource parser result with invalid Line ^https?:VVI\w-]+.googlevideo)...
it works perfect before but since today.
understand this is not for Quantumult X, so this is just for an report, hope that there will be one similar plugin specific for QX someday
去YT广告脚本开发者您好,先说句客气话,感谢您的付出让网络上很多人都受惠了,虽然您的脚本说只在Surge下测试过,不保证其他客户端,但由于Maasea在YT去广告脚本的名气实在是太大,全网找到的几乎也都是您的脚本,所以有问题只能冒昩请教了。
我所遇到的问题是,YT App主页的广告,视频开始前的五秒广告,视频里的广告,也能去得干净,但我从主页点击一个视频后,会显示一个广告,这个广告在小火箭里,无论怎么弄也弄不掉,之前是没有这个问题的:
我小火箭是用这个脚本:
#!url=https://whatshub.top/module/YouTubeAd.sgmodule
#!name = YouTube去广告
#!desc =支持pip,后台播放
#!author = Maasea
#!homepage=https://whatshub.top
#!icon = https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube.png
[Rule]
AND,((DOMAIN-SUFFIX,googlevideo.com), (PROTOCOL,UDP)),REJECT
AND,((DOMAIN,youtubei.googleapis.com), (PROTOCOL,UDP)),REJECT
[URL Rewrite]
(^https?:\/\/[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+?)&ctier=L(&.+?),ctier,(.+) $1$2$3 302
^https?:\/\/[\w-]+\.googlevideo\.com\/(?!(dclk_video_ads|videoplayback\?)).+&oad _ reject-200
^https?:\/\/(www|s)\.youtube\.com\/api\/stats\/ads _ reject-200
^https?:\/\/(www|s)\.youtube\.com\/(pagead|ptracking) _ reject-200
^https?:\/\/s\.youtube\.com\/api\/stats\/qoe\?adcontext _ reject-200
[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-path=https://raw.githubusercontent.com/Maasea/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-path=https://raw.githubusercontent.com/Maasea/sgmodule/master/Script/Youtube/dist/youtube.response.preview.js,argument="{"lyricLang":"{{{歌词翻译语言}}}","captionLang":"{{{字幕翻译语言}}}","blockUpload":{{{屏蔽上传按钮}}},"blockImmersive":{{{屏蔽选段按钮}}},"debug":{{{启用调试模式}}}}"
[MITM]
hostname = %APPEND% -redirector*.googlevideo.com,*.googlevideo.com,www.youtube.com,s.youtube.com,youtubei.googleapis.com
但我用QX,用另一个重写脚本,(但对比过跟小火箭的脚本好像没什么不同),但却能把那个广告去掉,不知道是什么原因,所以上来开个issue告知一下。
QX使用這個腳本:
########################################
#应用名称: Youtube Block AD
#脚本作者: @DivineEngine, @app2smile, @Maasea, @VirgilClyne
#更新时间: 2024-05-12
#使用说明: 用于视频、瀑布流、搜索、播放页、短视频及贴片广告、视频自动PIP、后台播放、自动翻译,不适用允许 UDP 转发的节点及 Premium
#使用说明: 如果视频广告仍然存在,请在QuantumultX配置文件的[general]下添加 udp_drop_list=443
#隐藏技能: 点开Youtube视频的瞬间,退出APP,即可无PIP播放,适合单纯听音频的用户
#通知频道: https://t.me/ddgksf2021
#原始仓库: https://github.com/DivineEngine
#原始仓库: https://github.com/Maasea
#原始仓库: https://github.com/app2smile
#重写地址: https://github.com/ddgksf2013/Rewrite/raw/master/AdBlock/YoutubeAds.conf
########################################
hostname = -redirector*.googlevideo.com,*.googlevideo.com,www.youtube.com,s.youtube.com,youtubei.googleapis.com
# ======= 视频广告请求 ======= #
(^https?:\/\/[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+?)&ctier=L(&.+?),ctier,(.+) url 302 $1$2$3
^https?:\/\/[\w-]+\.googlevideo\.com\/(?!(dclk_video_ads|videoplayback\?)).+&oad url reject-200
# ======= 视频PIP|后台播放|瀑布流|搜索页|播放页|短视频|贴片广告 ======= #
^https?:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|reel\/reel_watch_sequence|get_watch) url script-request-body https://raw.githubusercontent.com/Maasea/sgmodule/master/Script/Youtube/dist/youtube.request.preview.js
^https?:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting|get_watch) url script-response-body https://raw.githubusercontent.com/Maasea/sgmodule/master/Script/Youtube/dist/youtube.response.preview.js
所以现在的情况是,QX能去得干净,小火箭有一个广告去不掉,但我平时用小火箭的情况会比较多,所以希望能够解决到。
对您的关注先表达感谢,希望后续脚本能解决这个问题。
无其他规则、脚本、重写冲突 仅YoutubeAds.sgmodule
v1/player
request
POST /youtubei/v1/player?key=AIzaSyB-63vXXXXXhKuerbB2N_l7Kwwcxj6yUAc&id=IxBsXXXXXB4&t=43XXXXX3-E795-436B-9030-E969B742197D HTTP/2
:authority: youtubei.googleapis.com
content-type: application/x-protobuf
accept: */*
x-youtube-client-version: 18.39.1
authorization: Bearer ya29.a0AfB_byAViljPYnxCyJ-2jBlz9lhfrBhszHC3N1jzTwE4X3d5CaJGjw0J7vDyUAOARXqYofPqxMas9j9CzZ0t2zkmM1sS4C7sWJC6rEbsWoGeXXXXXLgSYaEalBxDKOjhBOYeOHiyy-fmIN5SiUTol8Mtyqw_TX5bdE4j83oc8aDr0Q7pLxTsN-YDR_XCkX8FNpZOV61Cci9to1WQaz18WGASd-Ao5E74EB1em5E3_nB8mm4H6sT_GBVY50QCYm1b-kofEWrfhAGMv1n3etXUyt0Qm0Nfa0utuRMH_gDsC9AFJ1tTLSAyy3D3rAl0WthK2zxVi7tFqNjEaCgYKAd0SARESFQGOcNnCQWr74CZ5Pn2XXqUBjr8Yng0339
x-youtube-client-name: 5
accept-language: zh-CN,zh-Hans;q=0.9
accept-encoding: gzip, deflate, br
cache-control: no-cache
content-length: 3378
user-agent: com.google.ios.youtube/18.39.1 (iPhone16,2; U; CPU iOS 17_0_2 like Mac OS X; zh-Hans)
x-goog-api-format-version: 2
x-goog-visitor-id: CgtJVWdqa3JTQmQtbyixpNqoBjIICgJVUXXXXXA6CiCQgpeZkMaki2U%3D
response
HTTP/2 200
content-type: application/x-protobuf
content-disposition: attachment
vary: Origin
vary: X-Origin
vary: Referer
content-encoding: br
date: Tue, 03 Oct 2023 11:29:36 GMT
server: scaffolding on HTTPServer2
content-length: 69936
x-xss-protection: 0
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
request
POST /youtubei/v1/next?key=AIzaSyB-63vXXXXXhKuerbB2N_l7Kwwcxj6yUAc HTTP/2
:authority: youtubei.googleapis.com
content-type: application/x-protobuf
accept: */*
x-youtube-client-version: 18.39.1
authorization: Bearer ya29.a0AfB_byAViljPYnxCyJ-2jBlz9lhfrBhszHC3N1jzTwE4X3d5CaJGjw0J7vDyUAOARXqYofPqxMas9j9CzZ0t2zkmM1sS4C7sWJC6rEbsWoGeXXXXXLgSYaEalBxDKOjhBOYeOHiyy-fmIN5SiUTol8Mtyqw_TX5bdE4j83oc8aDr0Q7pLxTsN-YDR_XCkX8FNpZOV61Cci9to1WQaz18WGASd-Ao5E74EB1em5E3_nB8mm4H6sT_GBVY50QCYm1b-kofEWrfhAGMv1n3etXUyt0Qm0Nfa0utuRMH_gDsC9AFJ1tTLSAyy3D3rAl0WthK2zxVi7tFqNjEaCgYKAd0SARESFQGOcNnCQWr74CZ5Pn2XXqUBjr8Yng0339
x-youtube-client-name: 5
accept-language: zh-CN,zh-Hans;q=0.9
accept-encoding: gzip, deflate, br
cache-control: no-cache
content-length: 3270
user-agent: com.google.ios.youtube/18.39.1 (iPhone16,2; U; CPU iOS 17_0_2 like Mac OS X; zh-Hans)
x-goog-api-format-version: 2
x-goog-visitor-id: CgtJVWdqa3JTQmQtbyixpNqoBjIICgJVUXXXXXA6CiCQgpeZkMaki2U%3D
response
HTTP/2 200
content-type: application/x-protobuf
content-disposition: attachment
vary: Origin
vary: X-Origin
vary: Referer
content-encoding: br
date: Tue, 03 Oct 2023 11:29:36 GMT
server: scaffolding on HTTPServer2
content-length: 253689
x-xss-protection: 0
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
1、在23/6/6更新的新sgmodule包括[YoutubeAds.Beta.sgmodule]和[YoutubeAds.sgmodule]版本和新[youtube.beta.js][youtube.request.beta.js][youtube.response.beta.js]脚本对shadowrocket软件无法兼容。
2、旧版本的[youtube.js]由于仓库修改了文件位置从[YouTube/youtube.js]到[YouTube/dist/youtube.js]目录故导致文件无法刷新,或者脚本版本错乱,这会导致app内所有内容不加载,或者脚本失效无法使用。 解决方案: 使用第三方备份的脚本, 并且手动修改js文件的地址, 目前旧版本还没有失效, 还可以正常使用, 如果某些时候不能拦截广告,搭配这个脚本。
希望不久的将来能适配QuanX
最近油管玩命治理屏蔽广告的,这个代码算是坚持的久一点了的,别人的早都不能用了。
而且今天iOS更新,surge也更新,也说不上是哪的问题。。没有生成日志,代码也正常运行。
这谷歌确实抽风,我个人用三年的IP给我送中了…关键是我啥也没干而且别的软件都没事,唯独谷歌给我搞了,真是跳出一道墙谁成想还有墙。
1.YouTube music歌词在屏蔽广告后的歌曲无法点击和滚动使用,会被锁定(点击下一曲按钮时才会复现,貌似是云控的,降级YouTube music也无效)。
2.YouTube&YouTube music的Airplay投射在屏蔽广告后有概率无法正常播放,会被暂停,必须手动点击播放(自动播放的时候会出现,手机端本地播放不受影响)。
3.YouTube music的升级页面和按钮没有被屏蔽,YouTube的页面广告没有被屏蔽, 我还有一台没有升级YouTube&YouTube music的手机是可以屏蔽的。
最后:也不知道是不是和小火箭有关,Surge实在太贵了,所以麻烦大佬测试一下是不是兼容性问题。
例如我需要视频字幕自动翻译为简体中文,不需要移除上传和选段按钮,arguments=后面的参数改如何填写呢?
我尝试过
arguments=屏蔽上传按钮:False,屏蔽选段按钮:False,目标翻译语言:zh-CN
argument="{"targetLang":"{{{zh-CN}}}","blockUpload":{{{False}}},"immersive":{{{False}}}}"
argument=targetLang:zh-CN,blockUpload:False,immersive:False
都不生效,播放英文视频默认还是英文字幕。
系统:iOS16.6.1
Surge版本:5.3.8
模块:Youtube (Music) Enhance
Youtube版本:18.49.3
个人偏爱使用VirgilClyne 的 YouTube双语模块,但和Youtube (Music) Enhance搭配使用会有问题(单独使用双语模块看视频时cc字幕会自动打开,搭配使用看视频就自动关闭了)
Qx下使用你的脚本 首页瀑布流广告和搜索广告会失效 播放器广告成功
Qx会报错
2022/10/24 13:05:12:177 <error> [JS Console]: A JavaScript exception occurred.
2022/10/24 13:05:12:183 <error> [JS Console]: Exception A JavaScript exception occurred
可以适配一下吗
我在 Surge for tvOS 上打开模块貌似不生效,不知道原理是不是一样的,还是就不通用呢?
大佬你好,可以添加对Apple TV上面YouTube的去广告支持吗?谢谢!
用surge看YouTube只会匹配response的代码,所以没有影响,但是YouTube studio会同时匹配request的代码,主页就加载不出来了。我把request删掉了只用response好像也没啥影响,不知道那个代码是做什么用的。不知道是不是bug啊,就是说一下……
youtubeads模块安装就不需要youtubeplayer模块了吧
ios17.2 shadowrocket2.2.41(2093) youtube18.49.3
尝试REJECT-200 和RECJECT-IMG均有广告,且广告播放完后视频无法正常播放 提示出错重试
经尝试 进度条拉到缓存外的时候同样会提示出错重试
请问有什么解决方法嘛
#!name = YouTube去广告
#!desc =支持pip,后台播放
#!author = Maasea
#!homepage=https://whatshub.top
#!icon = https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube.png
[Rule]
AND,((DOMAIN-SUFFIX,googlevideo.com), (PROTOCOL,UDP)),REJECT
AND,((DOMAIN,youtubei.googleapis.com), (PROTOCOL,UDP)),REJECT
[URL Rewrite]
(^https?:\/\/[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+?)&ctier=L(&.+?),ctier,(.+) $1$2$3 302
^https?:\/\/[\w-]+\.googlevideo\.com\/(?!(dclk_video_ads|videoplayback\?)).+&oad _ reject-200
^https?:\/\/(www|s)\.youtube\.com\/api\/stats\/ads _ reject-200
^https?:\/\/(www|s)\.youtube\.com\/(pagead|ptracking) _ reject-200
^https?:\/\/s\.youtube\.com\/api\/stats\/qoe\?adcontext _ reject-200
[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-path=https://raw.githubusercontent.com/Maasea/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-path=https://raw.githubusercontent.com/Maasea/sgmodule/master/Script/Youtube/dist/youtube.response.preview.js,argument="{"lyricLang":"{{{歌词翻译语言}}}","captionLang":"{{{字幕翻译语言}}}","blockUpload":{{{屏蔽上传按钮}}},"blockImmersive":{{{屏蔽选段按钮}}},"debug":{{{启用调试模式}}}}"
[MITM]
hostname = %APPEND% -redirector*.googlevideo.com,*.googlevideo.com,www.youtube.com,s.youtube.com,youtubei.googleapis.com
I took another source to adapt to Shadowrocket but the js link is still there but what I'm wondering is that it has removed the ads but pip and background play don't seem to work, can you read it and understand why? help me!
播放去广告和画中画失效
翻看之前议题的好像是被灰度了?还是新版本全面铺开了…
YT能支持tvOS吗?
在搜索列表中观看一个视频后,会出现列表里某个视频打不开的问题,点击没反应,只有点击视频主的头像进入频道才能看。我不确定是代码的问题还是app的问题。
还有一点,我的ip被谷歌定位到**了,然后画中画偶尔会失效。
您的模块我用qx通过资源解析器转到qx去不了广告,小火箭效果完美,求qx的版本。
No video is shown when the YouTube module is loaded
升级ios17后 两个YouTube去广告插件都会产生内容不加载的情况
你好,如题,目前是 zh-Hans,可以调整为 English (auto-generated) 么?不知道怎么弄,每次都要点击下,感觉挺麻烦的
请问能支持解锁SharePlay同播共享吗 也是Premium的功能 不知道要不要经过服务器验证
油管视频的url貌似发生了部分改变,但是某些视频的pip功能失效。
Hi, I've been trying to implement a surge alternative, when trying to process browse
request with nodejs, I found that this browse request will throw Error: illegal tag: field no 3 wire type 7
.
It seems that the protobuf types are mismatched, potentially causing the first ad when opening a video not to be blocked.
Here is the code I use to process the request:
const fs = require("fs");
var store = {};
var e = null;
var $persistentStore = {
read: (key) => {
return store[key];
},
write: (value, key) => {
store[key] = value;
return true;
},
};
const res = fs.readFileSync(
"./tp-dump-request-https___youtubei.googleapis.com_youtubei_v1_browse"
);
const req = fs.readFileSync(
"./tp-dump-request-https___youtubei.googleapis.com_youtubei_v1_browse"
);
var $request = {
url: "https://youtubei.googleapis.com/youtubei/v1/browse?key=AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc&retry=1",
body: new Uint8Array(req),
};
var $response = {
url: "https://youtubei.googleapis.com/youtubei/v1/browse?key=AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc&retry=1",
body: new Uint8Array(res),
};
var v = null;
var $done = (obj) => {
console.log("=======", obj);
v = obj;
};
console.log("Before eval");
eval(fs.readFileSync("./youtube.request.beta.js").toString());
console.log("After eval");
console.log("Result: ", v);
Can you help me with why the video's first ad is still showing up?
I have tried many ways such as deleting and reinstalling, changing many different accounts (including new accounts) but the script still does not work. I wonder if YouTube's new update caused your script to have this problem? I hope you update it, thank you <3
如题,用的小火箭,pip 和后台播放很少会生效,页面没有广告,翻译功能也好使,偶尔没有中文简体翻译。首次观看视频会有一次广告。
参考大佬的脚本自制的小火箭模块。
https://raw.githubusercontent.com/CraKeyBoy/Script/main/YouTubeAd.sgmodule
也帮忙看看有什么不对的地方、万分感谢🙏
小火箭用的去广告配置
https://johnshall.github.io/Shadowrocket-ADBlock-Rules-Forever/sr_top500_banlist_ad.conf
目前用的youtube 版本是 18.32.2
Hi, I'm trying to build my own surge alternative, so I would like to support as much surge rules as I can, but when I'm trying to use these rules, I don't know how to implement them
[Rule]
AND,((DOMAIN-SUFFIX,googlevideo.com), (PROTOCOL,UDP)),REJECT
AND,((DOMAIN,youtubei.googleapis.com), (PROTOCOL,UDP)),REJECT
Other rules and functions are implemented, but without these two I still get some ads when playing video
Can you plz help me understand what these rules do? Thx!
Can you share me the script setting auto quality 1080p or 2K to add into youtube.js?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.