mirror of
https://github.com/aureliendavid/rsspreview.git
synced 2025-08-22 19:28:39 +00:00
youtube: handle non-latin characters in channel name
This commit is contained in:
parent
8aae6d1b4a
commit
0f3d18390b
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "RSSPreview",
|
"name": "RSSPreview",
|
||||||
"version": "3.17",
|
"version": "3.18",
|
||||||
"author": "Aurelien David",
|
"author": "Aurelien David",
|
||||||
"homepage_url": "https://github.com/aureliendavid/rsspreview",
|
"homepage_url": "https://github.com/aureliendavid/rsspreview",
|
||||||
|
|
||||||
|
@ -388,9 +388,10 @@
|
|||||||
function findYouTubeFeeds() {
|
function findYouTubeFeeds() {
|
||||||
// YouTube's canonical channel URLs look like /channel/AlphaNumericID
|
// YouTube's canonical channel URLs look like /channel/AlphaNumericID
|
||||||
// It also supports named channels of the form /c/MyChannelName
|
// 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
|
// Match on both of these to autodetect channel feeds on either URL
|
||||||
let idPattern = /channel\/([a-zA-Z0-9_-]+)/;
|
let idPattern = /channel\/([a-zA-Z0-9%_-]+)/;
|
||||||
let namePattern = /(?:c|user)\/[a-zA-Z0-9_-]+/;
|
let namePattern = /(?:c|user)\/[a-zA-Z0-9%_-]+/;
|
||||||
let urlPattern = new RegExp(`${idPattern.source}|${namePattern.source}`);
|
let urlPattern = new RegExp(`${idPattern.source}|${namePattern.source}`);
|
||||||
if (document.URL.match(urlPattern)) {
|
if (document.URL.match(urlPattern)) {
|
||||||
let feeds = {};
|
let feeds = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user