From 0f3d18390b9e55cc9fdd5bfde835b4d03703ec7b Mon Sep 17 00:00:00 2001 From: Aurelien David Date: Thu, 4 Aug 2022 13:53:43 +0200 Subject: [PATCH] youtube: handle non-latin characters in channel name --- manifest.json | 2 +- rsspreview.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 177a1da..d0233e8 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "RSSPreview", - "version": "3.17", + "version": "3.18", "author": "Aurelien David", "homepage_url": "https://github.com/aureliendavid/rsspreview", diff --git a/rsspreview.js b/rsspreview.js index c640349..4709f5f 100644 --- a/rsspreview.js +++ b/rsspreview.js @@ -388,9 +388,10 @@ function findYouTubeFeeds() { // YouTube's canonical channel URLs look like /channel/AlphaNumericID // It also supports named channels of the form /c/MyChannelName + // Match also on '%' to handle non-latin character codes // Match on both of these to autodetect channel feeds on either URL - let idPattern = /channel\/([a-zA-Z0-9_-]+)/; - let namePattern = /(?:c|user)\/[a-zA-Z0-9_-]+/; + let idPattern = /channel\/([a-zA-Z0-9%_-]+)/; + let namePattern = /(?:c|user)\/[a-zA-Z0-9%_-]+/; let urlPattern = new RegExp(`${idPattern.source}|${namePattern.source}`); if (document.URL.match(urlPattern)) { let feeds = {};