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

fix primary links #78

Merged
merged 2 commits into from
May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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