Skip to content

Commit 686b7c5

Browse files
committed
perf: YouTube_<<n
- 去除`<<n`损耗性能写法
1 parent f3b1e6f commit 686b7c5

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

src/apps/com.google.android.youtube.ts

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export default defineGkdApp({
3737
rules: [
3838
{
3939
matches:
40-
'@[desc="关闭广告面板" || desc="Close ad panel"] <<n [vid="panel_header"]',
40+
'@[desc="关闭广告面板" || desc="Close ad panel"][clickable=true] - ImageView <<3 FrameLayout < [vid="panel_header"][visibleToUser=true]',
4141
snapshotUrls: [
4242
'https://i.gkd.li/i/13797491',
43-
'https://i.gkd.li/i/13705106',
43+
'https://i.gkd.li/i/13705106', // 纯id?
4444
'https://i.gkd.li/i/14784199',
4545
],
4646
},
@@ -49,21 +49,34 @@ export default defineGkdApp({
4949
{
5050
key: 3,
5151
name: '全屏广告-会员广告',
52+
fastQuery: true,
53+
activityIds:
54+
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
5255
rules: [
5356
{
54-
fastQuery: true,
55-
activityIds:
56-
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
57+
key: 0,
58+
name: '视频',
5759
matches:
58-
'[!(getChild(0).getChild(0).desc="Image attachment")] + @[desc="不用了,谢谢" || desc="关闭" || desc="我暂时不要" || desc="Close" || desc="No thanks"][visibleToUser=true] <<n [vid="bottom_ui_container" || vid="custom"]',
60+
'[!(getChild(0).getChild(0).desc="Image attachment")] + @[desc="不用了,谢谢" || desc="关闭" || desc="我暂时不要" || desc="Close" || desc="No thanks"][visibleToUser=true] <3 ViewGroup <<(-n+8) [vid="bottom_ui_container" || vid="custom"]',
5961
snapshotUrls: [
6062
'https://i.gkd.li/i/13797512',
61-
'https://i.gkd.li/i/18017075',
62-
'https://i.gkd.li/i/18549944',
6363
'https://i.gkd.li/i/19578085',
6464
'https://i.gkd.li/i/25865404',
6565
],
66-
excludeSnapshotUrls: 'https://i.gkd.li/i/21978683',
66+
// excludeSnapshotUrls: 'https://i.gkd.li/i/21978683',
67+
exampleUrls: 'https://e.gkd.li/1292c8c9-26e3-4053-bec4-e5ebe50cde8e',
68+
},
69+
{
70+
key: 1,
71+
name: '开屏', // 疑似开屏,但有可能不是
72+
matches:
73+
'[!(getChild(0).getChild(0).desc="Image attachment")] + @[desc="不用了,谢谢" || desc="关闭" || desc="我暂时不要" || desc="Close" || desc="No thanks"][visibleToUser=true] -n ImageView < * < [vid="custom"]',
74+
snapshotUrls: [
75+
'https://i.gkd.li/i/18017075',
76+
'https://i.gkd.li/i/18549944',
77+
],
78+
// excludeSnapshotUrls: 'https://i.gkd.li/i/21978683',
79+
exampleUrls: 'https://e.gkd.li/11cdf5b2-97a8-42f0-a2eb-dc1cb2c98ac1',
6780
},
6881
],
6982
},
@@ -93,7 +106,7 @@ export default defineGkdApp({
93106
activityIds:
94107
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
95108
matches:
96-
'@Button[desc^="翻译成"||desc^="Translate to"][clickable=true][visibleToUser=true] <<n [vid="results" || vid="section_list"]',
109+
'@Button[desc^="翻译成"||desc^="Translate to"][clickable=true][visibleToUser=true] -n [desc^="@"] <<3 ViewGroup -n * < [vid="results" || vid="section_list"]',
97110
exampleUrls: 'https://e.gkd.li/e9d6eaa8-9fbf-4b16-8f0c-50239597c687',
98111
snapshotUrls: [
99112
'https://i.gkd.li/i/17068544', // 翻译前
@@ -153,11 +166,9 @@ export default defineGkdApp({
153166
activityIds:
154167
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
155168
matches:
156-
'[desc="更多选项"] + @ImageView[clickable=true][width<100 && height<100] <<n [vid="panel_header"]',
157-
snapshotUrls: [
158-
'https://i.gkd.li/i/23787178',
159-
'https://i.gkd.li/i/25461943', // 误触(已修复)
160-
],
169+
'@ImageView[clickable=true][index=parent.childCount.minus(1)] - [desc="更多选项"] < ViewGroup[childCount=2] < * < [vid="panel_header"]',
170+
snapshotUrls: 'https://i.gkd.li/i/23787178',
171+
excludeSnapshotUrls: 'https://i.gkd.li/i/25461943', // 误触(已修复)
161172
},
162173
],
163174
},
@@ -171,7 +182,7 @@ export default defineGkdApp({
171182
activityIds:
172183
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
173184
matches:
174-
'@[vid="overflow_button"][clickable=true] <<n [vid="collapsible_ad_cta_overlay_container"]',
185+
'[vid="layout_container"] >n LinearLayout > GridLayout > [vid="overflow_button"][index=parent.childCount.minus(1)][clickable=true][visibleToUser=true]',
175186
snapshotUrls: 'https://i.gkd.li/i/23790199',
176187
},
177188
{
@@ -199,9 +210,9 @@ export default defineGkdApp({
199210
activityIds:
200211
'com.google.android.apps.youtube.app.watchwhile.MainActivity',
201212
matches:
202-
'Button[childCount=3] < @ViewGroup[clickable=true][visibleToUser=true] <<n [vid="section_list"]',
213+
'Button[childCount=3] < @ViewGroup[clickable=true][visibleToUser=true] -n ViewGroup < [vid="section_list"]',
203214
snapshotUrls: [
204-
'https://i.gkd.li/i/25462396',
215+
'https://i.gkd.li/i/25462396', // 中文
205216
'https://i.gkd.li/i/25466817', // En
206217
],
207218
},

0 commit comments

Comments
 (0)