Skip to content

Commit 511eb43

Browse files
authored
fix(niconico): update selectors for channel name and group name in activity data (#10451)
1 parent e689a46 commit 511eb43

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

websites/N/niconico/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"seiga.nicovideo.jp"
2222
],
2323
"regExp": "^https?[:][/][/](www|live|seiga)[.]nicovideo[.]jp[/]",
24-
"version": "1.5.1",
24+
"version": "1.5.2",
2525
"logo": "https://cdn.rcd.gg/PreMiD/websites/N/niconico/assets/logo.png",
2626
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/N/niconico/assets/thumbnail.jpg",
2727
"color": "#272727",

websites/N/niconico/presence.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ presence.on('UpdateData', async () => {
6161
[presenceData.startTimestamp, presenceData.endTimestamp] = getTimestampsFromMedia(video)
6262
}
6363
else if (pathname.startsWith('/watch/')) {
64-
const ownerElement = document.querySelector(
64+
const ownerElement = document.querySelectorAll(
6565
'a[data-anchor-area="video_information"]:not(:has(div))',
66-
)
66+
).item(1)
6767
const imageElement = document.querySelector('meta[property="og:image"]')
6868

6969
presenceData.details = document.querySelector('main h1')?.textContent
@@ -161,8 +161,8 @@ presence.on('UpdateData', async () => {
161161
)?.textContent ?? ''
162162
presenceData.state = `${
163163
(
164-
document.querySelector('[class^=\'___channel-name-anchor___\']')
165-
?? document.querySelector('[class^=\'___group-name-anchor___\']')
164+
document.querySelector('a.label')
165+
?? document.querySelector('a.channel-name-anchor')
166166
)?.textContent
167167
} - ${pathname.match(/lv\d+/)?.[0]}`
168168
presenceData.smallImageKey = Assets.Live

0 commit comments

Comments
 (0)