Skip to content

Commit fbc4e21

Browse files
authored
fix(Nebula): bug where video details weren't showing (#10462)
* fix(Nebula): update video page selectors fix bug where reliance on aria-label="video description" caused no video details to show. removed the `aria-label="video description"` container and query `main h1` and `main h2` directly for video title and channel name. * chore(Nebula): update contributors and version number
1 parent 3ec49a2 commit fbc4e21

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

websites/N/Nebula/metadata.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
"id": "189690228292845568",
66
"name": "angelolz"
77
},
8+
"contributors": [
9+
{
10+
"id": "791491962620346420",
11+
"name": "DiaDuckk"
12+
}
13+
],
814
"service": "Nebula",
915
"description": {
1016
"en": "Nebula is the home of smart, thoughtful videos, podcasts, and classes from your favorite creators."
1117
},
1218
"url": "nebula.tv",
1319
"regExp": "^https?[:][/][/]([a-z0-9-]+[.])*nebula[.]tv[/]",
14-
"version": "1.1.0",
20+
"version": "1.1.1",
1521
"logo": "https://cdn.rcd.gg/PreMiD/websites/N/Nebula/assets/logo.png",
1622
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/N/Nebula/assets/thumbnail.jpeg",
1723
"color": "#67bef5",

websites/N/Nebula/presence.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,30 +87,22 @@ function getVideoDetails(
8787
href: string,
8888
): void {
8989
const videoElement = document.querySelector('video')
90-
const videoDescriptionLabel = '[aria-label=\'video description\']'
9190

92-
presenceData.details = document
93-
.querySelector(videoDescriptionLabel)
94-
?.querySelector('h1')
95-
?.textContent
96-
presenceData.state = document
97-
.querySelector(videoDescriptionLabel)
98-
?.querySelector('h2')
99-
?.textContent
91+
presenceData.details = document.querySelector('main h1')?.textContent
92+
presenceData.state = document.querySelector('main h2')?.textContent
10093

10194
if (showButtons) {
95+
const channelLink = document.querySelector('main h2')?.closest('a')?.getAttribute('href')
96+
?? document.querySelector('main h2')?.parentElement?.querySelector('a')?.getAttribute('href')
97+
10298
presenceData.buttons = [
10399
{
104100
label: 'Watch Video',
105101
url: href,
106102
},
107103
{
108104
label: 'View Channel',
109-
url: getRootUrl()
110-
+ document
111-
.querySelector(videoDescriptionLabel)
112-
?.querySelector('a')
113-
?.getAttribute('href'),
105+
url: getRootUrl() + channelLink,
114106
},
115107
]
116108
}

0 commit comments

Comments
 (0)