diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ea95d2..5f3fb72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.21.2 +* Fixed image previews for `imgur.io`, `gifdeliverynetwork.com`, and `rule34.us` + ## 1.21.1 * Fixed a bug that skipped resolving profiles from channel ads * Non-binary genders are now considered mismatches against straight, gay, and bi orientations diff --git a/chat/preview/image-dom-mutator.ts b/chat/preview/image-dom-mutator.ts index c4e0554..7ebcc0a 100644 --- a/chat/preview/image-dom-mutator.ts +++ b/chat/preview/image-dom-mutator.ts @@ -175,6 +175,7 @@ export class ImageDomMutator { this.add('shadbase.com', this.getBaseJsMutatorScript(['#comic video', '#comic img', 'video', 'img'])); this.add('instagram.com', this.getBaseJsMutatorScript(['article video', 'article img', 'video', 'img'])); this.add('rule34video.com', this.getBaseJsMutatorScript(['video'], true, [], false, true)); + this.add('rule34.us', this.getBaseJsMutatorScript(['.content_push video', '.content_push img'])); this.add( 'pornhub.com', diff --git a/chat/preview/image-url-mutator.ts b/chat/preview/image-url-mutator.ts index 6b4c426..44861b3 100644 --- a/chat/preview/image-url-mutator.ts +++ b/chat/preview/image-url-mutator.ts @@ -68,6 +68,16 @@ export class ImageUrlMutator { } ); + this.add( + /^https?:\/\/(www.|v3.)?gifdeliverynetwork.com\/([a-z0-9A-Z]+)/, + async(_url: string, match: RegExpMatchArray): Promise<string> => { + const redgifId = match[2]; + + // Redgifs is correct + return `https://www.redgifs.com/ifr/${redgifId}?controls=0&hd=1`; + } + ); + this.add( /^https?:\/\/(www.|v3.)?redgifs.com\/watch\/([a-z0-9A-Z]+)/, async(_url: string, match: RegExpMatchArray): Promise<string> => { @@ -123,10 +133,10 @@ export class ImageUrlMutator { this.add( - /^https?:\/\/((m|www).)?imgur.com\/gallery\/([a-zA-Z0-9]+)/, + /^https?:\/\/((m|www).)?imgur.(com|io)\/gallery\/([a-zA-Z0-9]+)/, async(url: string, match: RegExpMatchArray): Promise<string> => { // Imgur Gallery - const galleryId = match[3]; + const galleryId = match[4]; try { const result = await Axios.get( @@ -159,10 +169,10 @@ export class ImageUrlMutator { ); this.add( - /^https?:\/\/((m|www).)?imgur.com\/a\/([a-zA-Z0-9]+)/, + /^https?:\/\/((m|www).)?imgur.(com|io)\/a\/([a-zA-Z0-9]+)/, async(url: string, match: RegExpMatchArray): Promise<string> => { // Imgur Album - const albumId = match[3]; + const albumId = match[4]; try { const result = await Axios.get( @@ -196,10 +206,10 @@ export class ImageUrlMutator { // must be AFTER gallery & album test this.add( - /^https?:\/\/((m|www).)?imgur.com\/([a-zA-Z0-9]+)/, + /^https?:\/\/((m|www).)?imgur.(com|io)\/([a-zA-Z0-9]+)/, async(url: string, match: RegExpMatchArray): Promise<string> => { // Single Imgur Image - const imageId = match[3]; + const imageId = match[4]; try { const result = await Axios.get(