Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
13 changes: 13 additions & 0 deletions websites/Y/YummyAnime/iframe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const iframe = new iFrame()

iframe.on('UpdateData', async () => {
const video = document.querySelector('video')

if (video && !Number.isNaN(video.duration)) {
iframe.send({
duration: video.duration,
currentTime: video.currentTime,
paused: video.paused,
})
}
})
22 changes: 22 additions & 0 deletions websites/Y/YummyAnime/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://schemas.premid.app/metadata/1.16",
"apiVersion": 1,
"author": {
"id": "1045800378228281345",
"name": "harryys"
},
"service": "YummyAnime",
"description": {
"en": "Displays anime you are watching on YummyAnime."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to get a better description? Any official one?

},
"url": "yummyani.me",
"regExp": "^https?://(www\\.)?(site\\.)?(en\\.)?yummyani\\.me/.*",
"version": "1.0.0",
"logo": "https://i.imgur.com/6XnAGga.jpeg",
"thumbnail": "https://i.imgur.com/Z7z6N5g.png",
"color": "#FF5722",
"category": "anime",
"tags": ["anime", "video"],
"iframe": true,
"iFrameRegExp": "kodik"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats not really a regex, expand it a little.

}
127 changes: 127 additions & 0 deletions websites/Y/YummyAnime/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import { ActivityType } from "discord.js";

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.
const presence = new Presence({

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
clientId: "1045800378228281345",
});

let videoData = {
duration: 0,
currentTime: 0,
paused: true,

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
hasData: false,
};

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presence.on("iFrameData", (data: any) => {

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
videoData = { ...data, hasData: true };
});

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presence.on("UpdateData", async () => {
const { pathname } = document.location;

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.
const presenceData: any = {

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.
largeImageKey: "https://i.imgur.com/6XnAGga.jpeg",
largeImageText: "YummyAnime",

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
type: ActivityType.Watching,
};

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (pathname === "/" || pathname === "/index.html") {

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.details = "На главной странице";

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.state = "Выбирает аниме";

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presence.setActivity(presenceData);
return;
}

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

const isAnimePage = document.querySelector(".poster-block");

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (!isAnimePage) {
presenceData.details = "На сайте YummyAnime";

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

const pageTitle = document.querySelector("h1")?.textContent?.trim();

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (pageTitle) {

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
presenceData.state = pageTitle;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else {
delete presenceData.state;
}

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
delete presenceData.startTimestamp;
delete presenceData.endTimestamp;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presence.setActivity(presenceData);
return;
}

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

const titleHeader = document.querySelector("h1");

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (titleHeader) {

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
presenceData.details = titleHeader.textContent?.trim();

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else {
presenceData.details = "Смотрит аниме";
}

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.
const posterImg = document.querySelector(

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
"div.poster-block img",
) as HTMLImageElement;

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.
if (posterImg && posterImg.src) {

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (posterImg.src.startsWith("//")) {

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.
presenceData.largeImageKey = `https:${posterImg.getAttribute("src")}`;

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else if (posterImg.src.startsWith("/")) {

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
presenceData.largeImageKey = `https://site.yummyani.me${posterImg.getAttribute("src")}`;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else {
presenceData.largeImageKey = posterImg.src;
}
}

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
const activeBtn = document.querySelector('div[class*="pQCG"]');
let currentEpisode = "";

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (activeBtn) {

Check failure

Code scanning / ESLint

Newline after if Error

Expect newline after if

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
const text = activeBtn.textContent?.trim();
if (text && !Number.isNaN(Number(text))) currentEpisode = text;
}

if (videoData.hasData) {
if (!videoData.paused) {
// === PLAY ===
presenceData.state = currentEpisode

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
? `Смотрит серию: ${currentEpisode}`
: "Смотрит видео";

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
const now = Date.now();
const remainingMs = (videoData.duration - videoData.currentTime) * 1000;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

presenceData.endTimestamp = now + remainingMs;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
delete presenceData.startTimestamp;
} else {
presenceData.state = currentEpisode

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
? `Серия ${currentEpisode} (Пауза)`
: "На паузе";

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
delete presenceData.startTimestamp;
delete presenceData.endTimestamp;

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
}

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else {

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
const videoElement = document.querySelector("#video");
let isWatchingBlock = false;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (videoElement) {
const rect = videoElement.getBoundingClientRect();
const viewHeight = Math.max(
document.documentElement.clientHeight,

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
window.innerHeight,
);

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (!(rect.bottom < 0 || rect.top - viewHeight >= 0))
isWatchingBlock = true;
}

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
if (currentEpisode && isWatchingBlock) {

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
presenceData.state = `Готовится к просмотру: ${currentEpisode}`;

Check failure

Code scanning / ESLint

Enforce the consistent use of either backticks, double, or single quotes Error

Strings must use singlequote.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else {
presenceData.state = "Читает описание";
}

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
delete presenceData.startTimestamp;
delete presenceData.endTimestamp;
}

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presence.setActivity(presenceData);
});
Loading