Skip to content

Commit

Permalink
Parse channel handles in video descriptions (#3011)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Dec 31, 2022
1 parent 5d1f465 commit 2f01dd4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,14 @@ export default Vue.extend({
} else {
// Some YouTube URLs don't have the urlEndpoint so we handle them here

const path = part.navigationEndpoint.commandMetadata.webCommandMetadata.url
return `https://www.youtube.com${path}`
const { browseEndpoint, commandMetadata: { webCommandMetadata } } = part.navigationEndpoint
// channel handle
if (webCommandMetadata.webPageType === 'WEB_PAGE_TYPE_CHANNEL' && part.text.startsWith('@')) {
return `<a href="https://www.youtube.com/channel/${browseEndpoint.browseId}">${part.text}</a>`
} else {
const path = webCommandMetadata.url
return `https://www.youtube.com${path}`
}
}
},

Expand Down

0 comments on commit 2f01dd4

Please sign in to comment.