diff --git a/app/youtube-grabber.js b/app/youtube-grabber.js index 6a052b5..8320b30 100644 --- a/app/youtube-grabber.js +++ b/app/youtube-grabber.js @@ -28,8 +28,10 @@ class YoutubeGrabber { if (typeof headerLinks !== 'undefined') { const channelHeaderLinksData = headerLinks.channelHeaderLinksRenderer links.primaryLinks = channelHeaderLinksData.primaryLinks.map(x => { + const url = x.navigationEndpoint.urlEndpoint.url + const match = url.match('&q=(.*)') return { - url: decodeURIComponent(x.navigationEndpoint.urlEndpoint.url.match('&q=(.*)')[1]), + url: match === null ? url : decodeURIComponent(match[1]), icon: x.icon.thumbnails[0].url, title: x.title.simpleText }