Merge pull request #171 from twilight-sparkle-irl/master

Use alternative frontend for YT (No more ads)
This commit is contained in:
mrstallion 2023-05-20 17:40:07 -07:00 committed by GitHub
commit 0a2bafdd24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -140,6 +140,7 @@ export class ImageDomMutator {
/* tslint:disable max-line-length */
this.add('default', this.getBaseJsMutatorScript(['.content video', '.content img', '#video, video', '#image, img']));
this.add('about:blank', '');
this.add('yewtu.be', '');
this.add('e621.net', this.getBaseJsMutatorScript(['video', '#image']));
this.add('e-hentai.org', this.getBaseJsMutatorScript(['video', '#img']));
this.add('gelbooru.com', this.getBaseJsMutatorScript(['video.gelcomVPlayer', '.post-view video', '.contain-push video', '#image']));

View File

@ -33,6 +33,13 @@ export class ImageUrlMutator {
}
protected init(): void {
this.add(
/^http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?=]*)?/,
async(_url: string, match: RegExpMatchArray): Promise<string> => {
const videoId = match[1]
return `https://yewtu.be/embed/${videoId}?autoplay=1`
}
);
this.add(
/^https?:\/\/.*twitter.com\/(.*)/,
async(url: string, match: RegExpMatchArray): Promise<string> => {