From 2eddb77b746c891818f18d63baaa0c537cce8bd7 Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Mon, 3 Apr 2023 17:24:36 +0200 Subject: [PATCH] Fix some youtube videos not being added, add additional filter tag to example --- .env.EXAMPLE | 2 +- src/lib/server/timeline.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.EXAMPLE b/.env.EXAMPLE index 729f514..205710f 100644 --- a/.env.EXAMPLE +++ b/.env.EXAMPLE @@ -1,4 +1,4 @@ -HASHTAG_FILTER = ichlausche,music,musik,nowplaying,tunetuesday +HASHTAG_FILTER = ichlausche,music,musik,nowplaying,tunetuesday,nowlistening URL_FILTER = song.link,album.link,spotify.com,music.apple.com,bandcamp.com YOUTUBE_API_KEY = CHANGE_ME VERBOSE = false diff --git a/src/lib/server/timeline.ts b/src/lib/server/timeline.ts index 7d6af5f..f462c33 100644 --- a/src/lib/server/timeline.ts +++ b/src/lib/server/timeline.ts @@ -3,7 +3,7 @@ import type { Post, Tag, TimelineEvent } from '$lib/mastodon/response'; import { savePost } from '$lib/server/db'; import { WebSocket } from "ws"; -const YOUTUBE_REGEX = new RegExp(/https?:\/\/(www\.)?youtu((be.com\/.*v=)|(\.be\/))(?[a-zA-Z_0-9-]+)/gm); +const YOUTUBE_REGEX = new RegExp(/https?:\/\/(www\.)?youtu((be.com\/.*?v=)|(\.be\/))(?[a-zA-Z_0-9-]+)/gm); export class TimelineReader { private static _instance: TimelineReader;