Skip to content

Commit

Permalink
feat(TwitCasting): add streaming and profile implementation (#8858)
Browse files Browse the repository at this point in the history
  • Loading branch information
mallusrgreatv2 authored Nov 4, 2024
1 parent 44e3b25 commit 62842ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion websites/T/TwitCasting/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"url": "twitcasting.tv",
"regExp": "([a-z0-9]+[.])?twitcasting[.]tv",
"version": "1.0.14",
"version": "1.0.15",
"logo": "https://cdn.rcd.gg/PreMiD/websites/T/TwitCasting/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/T/TwitCasting/assets/thumbnail.png",
"color": "#0280FC",
Expand Down
16 changes: 16 additions & 0 deletions websites/T/TwitCasting/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,22 @@ presence.on("UpdateData", async () => {
else if (pathname.includes("/mybacks")) {
presenceData.details = strings.viewTheir;
presenceData.state = strings.followList;
} else if (document.querySelector("video[src]")) {
presenceData.details = strings.watchingLive;
presenceData.state = `${document
.querySelector(".tw-player-page-title-title h2")
.textContent.trim()} - ${
document.querySelector("span.tw-live-author__info-username-inner")
.textContent
}`;
presenceData.type = ActivityType.Watching;
} else if (document.querySelector(".tw-user-nav2")) {
presenceData.details = strings.viewProfile;
presenceData.state = `${document
.querySelector(".tw-user-nav2-name")
.textContent.trim()} (${document
.querySelector(".tw-user-nav2-screen-id")
.textContent.trim()})`;
}
if (!showTimestamps) {
delete presenceData.startTimestamp;
Expand Down

0 comments on commit 62842ee

Please sign in to comment.