Skip to content

Commit 2f01dd4

Browse files
authored
Parse channel handles in video descriptions (#3011)
1 parent 5d1f465 commit 2f01dd4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/renderer/views/Watch/Watch.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,14 @@ export default Vue.extend({
904904
} else {
905905
// Some YouTube URLs don't have the urlEndpoint so we handle them here
906906

907-
const path = part.navigationEndpoint.commandMetadata.webCommandMetadata.url
908-
return `https://www.youtube.com${path}`
907+
const { browseEndpoint, commandMetadata: { webCommandMetadata } } = part.navigationEndpoint
908+
// channel handle
909+
if (webCommandMetadata.webPageType === 'WEB_PAGE_TYPE_CHANNEL' && part.text.startsWith('@')) {
910+
return `<a href="https://www.youtube.com/channel/${browseEndpoint.browseId}">${part.text}</a>`
911+
} else {
912+
const path = webCommandMetadata.url
913+
return `https://www.youtube.com${path}`
914+
}
909915
}
910916
},
911917

0 commit comments

Comments
 (0)