Skip to content

Commit 17eabc7

Browse files
committed
ggpht/googleusercontent image resizer
1 parent 474adf2 commit 17eabc7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ggpht.com/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const S = /(yt\d+.(?:ggpht|googleusercontent).com.+)s\d+-c/;
2+
3+
// default size to 4096px
4+
if (!location.href.includes("4096")) {
5+
const dest = location.href.replace(S, "$1-s4096-c");
6+
location.href = dest;
7+
}

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ switch (location.host) {
2626
case "build.opensuse.org":
2727
case "youtube.com":
2828
target = domain;
29+
default: {
30+
if (/(ggpht|googleusercontent).com$/.test(domain)) {
31+
target = "ggpht.com";
32+
}
33+
}
2934
}
3035
}
3136
}

0 commit comments

Comments
 (0)