Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
fix primary links (#78)
Browse files Browse the repository at this point in the history
* fix primary links

* remove space
  • Loading branch information
ChunkyProgrammer authored May 24, 2022
1 parent bc360a3 commit e80df44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/youtube-grabber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e80df44

Please sign in to comment.