Skip to content

Commit

Permalink
youtube: handle non-latin characters in channel name
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliendavid committed Aug 4, 2022
1 parent 8aae6d1 commit 0f3d183
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down
5 changes: 3 additions & 2 deletions rsspreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down

0 comments on commit 0f3d183

Please sign in to comment.