diff --git a/chat/preview/image-dom-mutator.ts b/chat/preview/image-dom-mutator.ts index 7ebcc0a..ffbd387 100644 --- a/chat/preview/image-dom-mutator.ts +++ b/chat/preview/image-dom-mutator.ts @@ -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'])); diff --git a/chat/preview/image-url-mutator.ts b/chat/preview/image-url-mutator.ts index 2bbaf78..2ab0ab3 100644 --- a/chat/preview/image-url-mutator.ts +++ b/chat/preview/image-url-mutator.ts @@ -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> => {