mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2024-11-17 23:46:41 +01:00
Parse channel handles in video descriptions (#3011)
This commit is contained in:
parent
5d1f465bf5
commit
2f01dd4277
@ -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}`
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user