Commit 7bd09cab35

7bd09cab35787a95e0f0c4766675ae989cfd38ea

parent: b4ea0ef019

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-10-25 16:14 UTC

stremio

Layout: unified · split

docs/.vitepress/configs/constants.ts +10 −1
@@ -296,6 +296,14 @@ export const homeCards: HomeCard[] = [
296 link: '/ext/seanime', 296 link: '/ext/seanime',
297 section: 'Extensions' 297 section: 'Extensions'
298 }, 298 },
299 {
300 id: 'ext-stremio',
301 icon: ':lucide-puzzle:',
302 title: 'Stremio',
303 details: 'Movies & Series',
304 link: '/ext/stremio',
305 section: 'Extensions'
306 },
299 { 307 {
300 id: 'glossary-general', 308 id: 'glossary-general',
301 icon: ':lucide-book-open:', 309 icon: ':lucide-book-open:',
@@ -595,7 +603,8 @@ export const sidebar: DefaultTheme.Sidebar = [
595 items: [ 603 items: [
596 { text: 'Hayase', link: '/ext/hayase' }, 604 { text: 'Hayase', link: '/ext/hayase' },
597 { text: 'Mangayomi', link: '/ext/mangayomi' }, 605 { text: 'Mangayomi', link: '/ext/mangayomi' },
598 { text: 'Seanime', link: '/ext/seanime' } 606 { text: 'Seanime', link: '/ext/seanime' },
607 { text: 'Stremio', link: '/ext/stremio' }
599 ] 608 ]
600 } 609 }
601 ] 610 ]
docs/.vitepress/theme/components/extrepo/AddonInstallMenu.vue added +120
@@ -0,0 +1,120 @@
1<script setup lang="ts">
2import { computed } from 'vue'
3import { stremioSoftwareHref, stremioWebHref } from './install'
4import type { RepoSite } from './types'
5
6const props = defineProps<{
7 site: RepoSite & { repoName?: string }
8}>()
9
10const manifestUrl = computed(() => props.site.installUrl ?? '')
11
12const softwareHref = computed(() => stremioSoftwareHref(manifestUrl.value))
13const webHref = computed(() => stremioWebHref(manifestUrl.value))
14const configureHref = computed(() => props.site.configureUrl ?? null)
15</script>
16
17<template>
18 <VTooltip
19 theme="vp-tooltip"
20 placement="bottom-end"
21 :distance="6"
22 class="ext-addon-install"
23 >
24 <button
25 type="button"
26 class="ext-site-install-btn"
27 aria-haspopup="true"
28 :aria-label="`Install ${site.name}`"
29 >
30 <span class="i-lucide:download" />
31 </button>
32 <template #popper>
33 <div class="ext-install-menu">
34 <a class="ext-install-option" :href="softwareHref">
35 <span class="i-lucide:monitor-down" />
36 <span class="ext-install-option-label">Software</span>
37 </a>
38 <a
39 class="ext-install-option"
40 :href="webHref"
41 target="_blank"
42 rel="noopener noreferrer"
43 >
44 <span class="i-lucide:globe" />
45 <span class="ext-install-option-label">Web</span>
46 </a>
47 <a
48 v-if="configureHref"
49 class="ext-install-option"
50 :href="configureHref"
51 target="_blank"
52 rel="noopener noreferrer"
53 >
54 <span class="i-lucide:settings-2" />
55 <span class="ext-install-option-label">Configure</span>
56 </a>
57 </div>
58 </template>
59 </VTooltip>
60</template>
61
62<style scoped>
63.ext-addon-install {
64 flex-shrink: 0;
65 align-self: stretch;
66 display: flex;
67}
68.ext-site-install-btn {
69 flex-shrink: 0;
70 display: flex;
71 align-items: center;
72 justify-content: center;
73 width: 32px;
74 height: 100%;
75 padding: 0;
76 border-radius: 8px;
77 border: 1px solid var(--vp-button-brand-border);
78 background-color: var(--vp-button-brand-bg);
79 color: var(--vp-button-brand-text);
80 cursor: pointer;
81 transition: filter 0.2s, border-color 0.2s;
82}
83.ext-site-install-btn:hover {
84 filter: brightness(1.08);
85 border-color: var(--vp-button-brand-hover-border);
86}
87.ext-site-install-btn span {
88 font-size: 15px;
89}
90.ext-install-menu {
91 display: flex;
92 flex-direction: column;
93 min-width: 150px;
94 padding: 4px;
95 border-radius: 10px;
96 border: 1px solid var(--vp-c-divider);
97 background-color: var(--vp-c-bg-elv);
98 box-shadow: var(--vp-shadow-3, 0 4px 16px rgba(0, 0, 0, 0.3));
99}
100.ext-install-option {
101 display: flex;
102 align-items: center;
103 gap: 8px;
104 padding: 7px 10px;
105 border-radius: 7px;
106 color: var(--vp-c-text-1) !important;
107 font-size: 13px;
108 font-weight: 500;
109 text-decoration: none !important;
110 white-space: nowrap;
111 transition: background-color 0.15s;
112}
113.ext-install-option:hover {
114 background-color: var(--vp-c-bg-soft);
115}
116.ext-install-option > span:first-child {
117 color: var(--vp-c-brand-1);
118 font-size: 15px;
119}
120</style>
docs/.vitepress/theme/components/extrepo/SiteCell.vue +8 −1
@@ -1,5 +1,6 @@
1<script setup lang="ts"> 1<script setup lang="ts">
2import { computed } from 'vue' 2import { computed } from 'vue'
3import AddonInstallMenu from './AddonInstallMenu.vue'
3import { langFlagClass, ratingIcon, ratingTitle } from './helpers' 4import { langFlagClass, ratingIcon, ratingTitle } from './helpers'
4import { hasSiteCopyButton } from './install' 5import { hasSiteCopyButton } from './install'
5import LazyIcon from './LazyIcon.vue' 6import LazyIcon from './LazyIcon.vue'
@@ -21,6 +22,10 @@ const copyTarget = computed(() => {
21 return soraMatch ? soraMatch[1] : value 22 return soraMatch ? soraMatch[1] : value
22}) 23})
23 24
25const isStremioAddon = computed(() =>
26 props.scheme === 'stremio' && Boolean(props.site.installUrl)
27)
28
24async function copyInstallUrl() { 29async function copyInstallUrl() {
25 const value = copyTarget.value 30 const value = copyTarget.value
26 if (!value) return 31 if (!value) return
@@ -55,6 +60,7 @@ async function copyInstallUrl() {
55 @mouseleave="hideTooltip" 60 @mouseleave="hideTooltip"
56 /> 61 />
57 <span 62 <span
63 v-if="!isStremioAddon"
58 class="ext-site-lang" 64 class="ext-site-lang"
59 :class="langFlagClass(site.lang)" 65 :class="langFlagClass(site.lang)"
60 :aria-label="site.lang" 66 :aria-label="site.lang"
@@ -66,8 +72,9 @@ async function copyInstallUrl() {
66 site.author ?? site.repoName 72 site.author ?? site.repoName
67 }}</span> 73 }}</span>
68 </component> 74 </component>
75 <AddonInstallMenu v-if="isStremioAddon" :site="site" />
69 <a 76 <a
70 v-if="site.installUrl" 77 v-else-if="site.installUrl"
71 class="ext-site-install-btn" 78 class="ext-site-install-btn"
72 :href="site.installUrl" 79 :href="site.installUrl"
73 :aria-label="`Install ${site.name}`" 80 :aria-label="`Install ${site.name}`"
docs/.vitepress/theme/components/extrepo/install.ts +9 −1
@@ -53,7 +53,7 @@ const MANUAL_ONLY_SCHEMES = new Set(['manual', 'shosetsu'])
53const NO_INSTALL_SCHEMES = new Set(['seanime']) 53const NO_INSTALL_SCHEMES = new Set(['seanime'])
54 54
55// Schemes with no install or copy action 55// Schemes with no install or copy action
56const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'sora', 'echo']) 56const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'sora', 'echo', 'stremio'])
57 57
58const NO_COPY_SCHEMES = new Set(['suwatte', 'echo']) 58const NO_COPY_SCHEMES = new Set(['suwatte', 'echo'])
59 59
@@ -94,6 +94,14 @@ export function copyValue(scheme: string, indexUrl: string): string {
94 return indexUrl 94 return indexUrl
95} 95}
96 96
97export function stremioSoftwareHref(manifestUrl: string): string {
98 return `stremio://${manifestUrl.replace(/^[a-z]+:\/\//i, '')}`
99}
100
101export function stremioWebHref(manifestUrl: string): string {
102 return `https://web.stremio.com/#/addons?addon=${manifestUrl}`
103}
104
97export function mangayomiHref(repo: Repo, variant: RepoVariant): string { 105export function mangayomiHref(repo: Repo, variant: RepoVariant): string {
98 const params: string[] = [] 106 const params: string[] = []
99 if (repo.repoName) { 107 if (repo.repoName) {
docs/.vitepress/theme/components/extrepo/types.ts +1
@@ -29,6 +29,7 @@ export interface RepoSite {
29 installUrl?: string 29 installUrl?: string
30 author?: string 30 author?: string
31 copyUrl?: string 31 copyUrl?: string
32 configureUrl?: string
32} 33}
33 34
34export interface MatchedSite extends RepoSite { 35export interface MatchedSite extends RepoSite {
docs/ext/extensionRepos/parsers.ts +34
@@ -212,6 +212,18 @@ export interface SoraAuthorRepo {
212 indexUrl: string 212 indexUrl: string
213} 213}
214 214
215interface StremioAddon {
216 name?: string
217 icon?: string | null
218 manifestUrl: string
219 configureUrl?: string | null
220 nsfw?: boolean
221}
222
223interface StremioCollection {
224 addons?: StremioAddon[]
225}
226
215interface EchoExtension { 227interface EchoExtension {
216 id: string 228 id: string
217 type: string 229 type: string
@@ -591,6 +603,21 @@ function toRepoDataHayase(extensions: HayaseExtension[]): RepoSite[] {
591 return sites 603 return sites
592} 604}
593 605
606function toRepoDataStremio(index: StremioCollection): RepoSite[] {
607 return (index.addons ?? [])
608 .filter((addon) => addon.manifestUrl)
609 .map((addon): RepoSite => ({
610 name: addon.name ?? addon.manifestUrl,
611 lang: 'all',
612 icon: addon.icon ?? '',
613 url: '',
614 rating: addon.nsfw ? 'nsfw' : 'safe',
615 installUrl: addon.manifestUrl,
616 copyUrl: addon.manifestUrl,
617 configureUrl: addon.configureUrl ?? undefined
618 }))
619}
620
594function toRepoDataMangayomi(sources: MangayomiSource[]): RepoSite[] { 621function toRepoDataMangayomi(sources: MangayomiSource[]): RepoSite[] {
595 const seen = new Set<string>() 622 const seen = new Set<string>()
596 const sites: RepoSite[] = [] 623 const sites: RepoSite[] = []
@@ -1001,6 +1028,13 @@ async function toRepoData(
1001 let suwatteV6: boolean | undefined 1028 let suwatteV6: boolean | undefined
1002 let suwatteListUrl: string | undefined 1029 let suwatteListUrl: string | undefined
1003 1030
1031 if (
1032 json && typeof json === 'object' &&
1033 Array.isArray((json as StremioCollection).addons)
1034 ) {
1035 return { sites: toRepoDataStremio(json as StremioCollection) }
1036 }
1037
1004 if ( 1038 if (
1005 json && typeof json === 'object' && !Array.isArray(json) && 1039 json && typeof json === 'object' && !Array.isArray(json) &&
1006 'extensionList' in (json as Record<string, unknown>) 1040 'extensionList' in (json as Record<string, unknown>)
docs/ext/extensionRepos/stremio.data.ts added +10
@@ -0,0 +1,10 @@
1import { type ExtensionRepoData, loadScheme } from './shared'
2
3export declare const data: ExtensionRepoData
4
5export default {
6 watch: ['../../**/*.md'],
7 async load(): Promise<ExtensionRepoData> {
8 return loadScheme('stremio')
9 }
10}
docs/ext/index.md +3
@@ -82,4 +82,7 @@ og:
82 <Card title="Seanime" href="/ext/seanime"> 82 <Card title="Seanime" href="/ext/seanime">
83 Anime, Manga, Novels & others 83 Anime, Manga, Novels & others
84 </Card> 84 </Card>
85 <Card title="Stremio" href="/ext/stremio">
86 Anime, Live Action & others
87 </Card>
85</Deck> 88</Deck>
docs/ext/stremio.md added +16
@@ -0,0 +1,16 @@
1---
2title: Stremio Extension Repos
3customDescription: Extension collections for Stremio
4feedback: no
5og:
6 image: /embed/extension.png
7---
8# Stremio
9
10::: extrepo {scheme=stremio, manual}
11
12== Stremio Addons
13- url: https://stremio-addons.net
14- raw: https://kotatsu-83g.pages.dev/stremio/stremio-addons.json
15
16:::