Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
36 changes: 36 additions & 0 deletions websites/0-9/1Flex/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://schemas.premid.app/metadata/1.16",
"apiVersion": 1,
"author": {
"id": "1171471152695214094",
"name": "ownernotfound"
},
"service": "1Flex",
"description": {
"en": "The 1 Stop of Everything, Discover and watch amazing movies and TV shows"
},
"url": "www.1flex.nl",
"regExp": "^https?[:][/][/](www[.])?1flex[.]nl[/]",
"version": "1.0.0",
"logo": "https://i.imgur.com/lZe2Tbj.png",
"thumbnail": "https://i.imgur.com/h7ugqHB.png",
"color": "#E53935",
"category": "videos",
"tags": [
"movies",
"anime",
"tv",
"torrent",
"games",
"livetv",
"sports"
],
"settings": [
{
"id": "privacy",
"title": "Privacy Mode",
"icon": "fas fa-user-secret",
"value": false
}
]
}
177 changes: 177 additions & 0 deletions websites/0-9/1Flex/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
import { ActivityType, Assets } from 'premid'

const presence = new Presence({
clientId: '1452924221742387362',
})

const browsingTimestamp = Math.floor(Date.now() / 1000)

enum ActivityAssets {
Logo = 'https://i.imgur.com/lZe2Tbj.png',
}

presence.on('UpdateData', async () => {
let presenceData: PresenceData = {
largeImageKey: ActivityAssets.Logo,
startTimestamp: browsingTimestamp,
details: 'Unsupported Page',
}

const { pathname } = document.location

const privacy = await presence.getSetting<boolean>('privacy')

if (privacy) {
presenceData.details = 'Watching 1Flex'
presence.setActivity(presenceData)
return
}

const pages: Record<string, PresenceData> = {
'/': {
details: 'Viewing HomePage',
smallImageKey: Assets.Viewing,
},
'/tv-shows': {
details: 'Browsing TV Shows',
smallImageKey: Assets.Viewing,
},
'/movies': {
details: 'Browsing Movies',
smallImageKey: Assets.Viewing,
},
'/manga-read': {
details: 'Reading Manga',
smallImageKey: Assets.Viewing,
},
'/live-tv': {
details: 'Browsing Live TV',
smallImageKey: Assets.Viewing,
},
'/sports': {
details: 'Watching Live Sports',
smallImageKey: Assets.Viewing,
},
'/torrent': {
details: 'Browsing Torrents',
smallImageKey: Assets.Viewing,
},
'/my-list': {
details: 'Checking My List',
smallImageKey: Assets.Viewing,
},
'/browse-by-languages': {
details: 'Browsing Content By Language',
smallImageKey: Assets.Viewing,
},
}

for (const [path, data] of Object.entries(pages)) {
if (pathname === path) {
presenceData = {
...presenceData,
...data,
type: ActivityType.Watching,
}
}
}

if (pathname === '/play') {
const params = new URLSearchParams(location.search)
const type = params.get('type')
if (type === 'movie') {
presenceData.type = ActivityType.Watching
presenceData.details = '1Flex'
const title = document.querySelector('h3.text-white.font-bold')?.textContent?.trim() || 'Unknown Movie'
const year = document.querySelector('.text-zinc-400 span')?.textContent?.trim() || 'N/A'
const runtime = document.querySelectorAll('.text-zinc-400 span')[1]?.textContent?.replace('min', '')?.trim() || 'N/A'
const rating = document.querySelector('.text-yellow-500 + span')?.textContent?.trim() ||'N/A'

Check failure

Code scanning / ESLint

Require spacing around infix operators Error

Operator '||' must be spaced.
const poster = document.querySelector('img.object-cover.rounded-lg')?.getAttribute('src')
presenceData.name = title
presenceData.state = `⭐ ${rating} 🕒 ${runtime} mins 🗓️ ${year}`
if (poster) presenceData.largeImageKey = poster

Check failure

Code scanning / ESLint

Newline after if Error

Expect newline after if
presenceData.smallImageKey = ActivityAssets.Logo
}

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2.
if (type === 'tv') {
presenceData.type = ActivityType.Watching
const params = new URLSearchParams(location.search)
const season = params.get('season') || '?'
const episode = params.get('episode') || '?'
const activeEpisode = document.querySelector('[data-episode].bg-gradient-to-r') || document.querySelector(`[data-episode="${episode}"]`)
const episodeTitle = activeEpisode?.querySelector('.font-semibold')?.textContent?.trim() || `Episode ${episode}`
let runtime = 'N/A'
const metaElements = activeEpisode?.querySelectorAll('.text-xs, .text-sm')
metaElements?.forEach(el => {

Check failure

Code scanning / ESLint

Require parentheses around arrow function arguments Error

Expected parentheses around arrow function argument having a body with curly braces.
const text = el.textContent || ''
if (text.includes('min')) {

Check failure

Code scanning / ESLint

Disallow trailing whitespace at the end of lines Error

Trailing spaces not allowed.
runtime = text.match(/(\d+)\s*min/i)?.[1] || 'N/A'
}
})
const episodeImage = activeEpisode?.querySelector('img')?.getAttribute('src')
const showPoster = document.querySelector('img.object-cover.rounded-lg')?.getAttribute('src')
presenceData.details = 'Watching TV Show'
presenceData.name = episodeTitle
presenceData.state = `S${season} • E${episode} — ${episodeTitle} (${runtime}m)`
presenceData.largeImageKey = episodeImage || showPoster
presenceData.smallImageKey = ActivityAssets.Logo
}

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 6.
}

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.

if (pathname.includes('/search')) {
presenceData.details = `Searching for Content`
const query = document.querySelector('input')?.getAttribute('value')
if (query) {
presenceData.state = `Query: ${query}`
}
presenceData.smallImageKey = Assets.Search
}

if (location.pathname === '/manga' && location.search.includes('q=')) {
presenceData.details = 'Searching for Manga'

const query = document.querySelector('input')?.value
if (query) {
presenceData.state = `Query: ${query}`
}

presenceData.smallImageKey = Assets.Search
}
else if (location.pathname === '/manga') {
presenceData.details = 'Browsing Manga'
presenceData.smallImageKey = Assets.Viewing
}

if (location.pathname === '/games' && location.search.includes('q=')) {
presenceData.details = 'Searching for Game'

const query = document.querySelector('input')?.value
if (query) {
presenceData.state = `Query: ${query}`
}

presenceData.smallImageKey = Assets.Search
}
else if (location.pathname === '/games') {
presenceData.details = 'Browsing Games'
presenceData.smallImageKey = Assets.Viewing
}

if (location.pathname === '/torrent' && location.search.includes('q=')) {
presenceData.details = 'Searching for Torrents'

const query = document.querySelector('input')?.value
if (query) {
presenceData.state = `Query: ${query}`
}

presenceData.smallImageKey = Assets.Search
}
else if (location.pathname === '/torrent') {
presenceData.details = 'Browsing Torrents'
presenceData.smallImageKey = Assets.Viewing
}

if (presenceData.details)
presence.setActivity(presenceData)
else presence.setActivity()
})
6 changes: 1 addition & 5 deletions websites/0-9/1Shows/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"url": "www.1shows.nl",
"regExp": "^https?[:][/][/](www[.])?1shows[.]nl[/]",
"version": "1.1.2",
"version": "1.1.3",
"logo": "https://cdn.rcd.gg/PreMiD/websites/0-9/1Shows/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/0-9/1Shows/assets/thumbnail.png",
"color": "#121212",
Expand All @@ -22,10 +22,6 @@
"tv"
],
"settings": [
{
"id": "lang",
"multiLanguage": true
},
{
"id": "privacy",
"title": "Privacy Mode",
Expand Down
18 changes: 7 additions & 11 deletions websites/0-9/1Shows/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,27 @@ presence.on('UpdateData', async () => {

const pages: Record<string, PresenceData> = {
'/': {
details: 'Viewing HomePage 🏠',
details: 'Viewing HomePage',
smallImageKey: Assets.Viewing,
},
'/profile': {
details: 'Viewing Profile 👤',
details: 'Viewing Profile',
smallImageKey: Assets.Viewing,
},
'/tv': {
details: 'Browsing TV Shows 📺',
smallImageKey: Assets.Viewing,
},
'/search': {
details: 'Browsing Search 🔎',
details: 'Browsing TV Shows',
smallImageKey: Assets.Viewing,
},
'/livetv': {
details: 'Browsing Live TV 📶',
details: 'Browsing Live TV',
smallImageKey: Assets.Viewing,
},
'/sports': {
details: 'Live Sports',
details: 'Browsing Live Sports',
smallImageKey: Assets.Viewing,
},
'/games': {
details: 'Browsing Games 🎮',
details: 'Playing Games',
smallImageKey: Assets.Viewing,
},
}
Expand Down Expand Up @@ -176,7 +172,7 @@ presence.on('UpdateData', async () => {
}

if (pathname.includes('/search')) {
presenceData.details = `Searching for Movies/TvShows 🔎`
presenceData.details = `Searching for Content`
const query = document.querySelector('input')?.getAttribute('value')
if (query) {
presenceData.state = `Query: ${query}`
Expand Down
2 changes: 1 addition & 1 deletion websites/E/Enma/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"url": "enma.lol",
"regExp": "^https?[:][/][/]([a-z0-9-]+[.])*enma[.]lol[/]",
"version": "1.0.1",
"version": "1.0.2",
"logo": "https://cdn.rcd.gg/PreMiD/websites/E/Enma/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/E/Enma/assets/thumbnail.png",
"color": "#121212",
Expand Down
28 changes: 16 additions & 12 deletions websites/E/Enma/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,51 +23,55 @@
case pathname === '/search':
presenceData.details = `Searching...`
presenceData.state = `Query : ${decodeURIComponent(new URLSearchParams(search).get('keyword') || '').replace(/\b\w/g, c => c.toUpperCase())}`
presenceData.smallImageKey = Assets.Search
break
case pathname.includes('/genre/'):
presenceData.details = `Browsing Genre`
presenceData.state = `${pathname.split('/')[2]}`
break
case pathname.includes('/watch/'): {
presenceData.details = document.querySelector('p.text-\\[26px\\]')?.textContent?.trim()
const coverArt = document.querySelector<HTMLDivElement>('div.flex.flex-col.gap-y-4.items-start.ml-8')?.querySelector<HTMLImageElement>('img')?.src
const slug = pathname.split('/watch/')[1]?.split('?')[0]
let title = slug

Check failure

Code scanning / ESLint

Require `const` declarations for variables that are never reassigned after declared Error

'title' is never reassigned. Use 'const' instead.
?.replace(/-\d+$/, '')
?.replace(/-/g, ' ')
?.replace(/\b\w/g, c => c.toUpperCase())
presenceData.details = title || 'Watching Anime'
const episodeNumber = document.querySelector<HTMLDivElement>('div.bg-\\[\\#1E90FF\\]')?.querySelector('span')?.textContent
presenceData.state = `Episode ${episodeNumber}`
presenceData.largeImageKey = coverArt ?? ActivityAssets.Logo
presenceData.smallImageKey = ActivityAssets.Logo
presenceData.largeImageKey = ActivityAssets.Logo
break
}
case pathname.includes('/az-list'):
presenceData.details = `Viewing AZ List: ${pathname.split('/')[2]}`
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
case pathname === '/movie':
presenceData.details = 'Browsing movies...'
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
case pathname === '/tv':
presenceData.details = 'Browsing TV series...'
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
case pathname === '/ova':
presenceData.details = 'Browsing OVAs...'
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
case pathname === '/ona':
presenceData.details = 'Browsing ONAs...'
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
case pathname === '/special':
presenceData.details = 'Browsing specials...'
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
case pathname === '/recently-updated':
presenceData.details = 'Browsing recently updated anime...'
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
case pathname === '/recently-added':
presenceData.details = 'Browsing recently added anime...'
presenceData.smallImageKey = Assets.Search
presenceData.smallImageKey = Assets.Viewing
break
default:
presenceData.details = 'Browsing Enma...'
Expand Down
32 changes: 32 additions & 0 deletions websites/F/FlickyStream/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://schemas.premid.app/metadata/1.16",
"apiVersion": 1,
"author": {
"id": "1428056065840255027",
"name": "ahmanitsucks"
},
"service": "FlickyStream",
"description": {
"en": "A streaming platform for movies, TV shows, and anime."
},
"url": "flickystream.ru",
"regExp": "^https?[:][/][/](www[.])?flickystream[.]ru[/]",
"version": "1.0.0",
"logo": "https://i.imgur.com/M4LL1F8.png",
"thumbnail": "https://i.imgur.com/87Bezq3.png",
"color": "#E53935",
"category": "videos",
"tags": [
"movies",
"anime",
"tv"
],
"settings": [
{
"id": "privacy",
"title": "Privacy Mode",
"icon": "fas fa-user-secret",
"value": false
}
]
}
Loading
Loading