-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from himanshu8443/feature
Feature
- Loading branch information
Showing
26 changed files
with
549 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import axios from 'axios'; | ||
import {headers} from '../headers'; | ||
import {Post} from '../types'; | ||
|
||
export const guardahdGetSearchPosts = async function ( | ||
searchQuery: string, | ||
page: number, | ||
providerValue: string, | ||
signal: AbortSignal, | ||
): Promise<Post[]> { | ||
try { | ||
if (page > 1) { | ||
return []; | ||
} | ||
const catalog: Post[] = []; | ||
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI( | ||
searchQuery, | ||
)}.json`; | ||
const res2 = await axios.get(url2, {headers, signal}); | ||
const data2 = res2.data; | ||
data2?.metas.map((result: any) => { | ||
const title = result?.name || ''; | ||
const id = result?.imdb_id || result?.id; | ||
const image = result?.poster; | ||
const type = result?.type; | ||
if (id) { | ||
catalog.push({ | ||
title: title, | ||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`, | ||
image: image, | ||
}); | ||
} | ||
}); | ||
return catalog; | ||
} catch (err) { | ||
console.error('AutoEmbed error ', err); | ||
return []; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {ProviderType} from '../../Manifest'; | ||
import {guardahdCatalog, guardahdGenresList} from '../guardahd/guardahdCatalog'; | ||
import {allGetPost} from '../autoEmbed/allGetPost'; | ||
import {guardahdGetSearchPosts} from '../guardahd/guardahdGetPosts'; | ||
import {ridoGetInfo} from './ridoGetMeta'; | ||
import {ridoGetStream} from './ridoGetSream'; | ||
|
||
export const ridoMovies: ProviderType = { | ||
catalog: guardahdCatalog, | ||
genres: guardahdGenresList, | ||
GetMetaData: ridoGetInfo, | ||
GetHomePosts: allGetPost, | ||
GetStream: ridoGetStream, | ||
GetSearchPosts: guardahdGetSearchPosts, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import axios from 'axios'; | ||
import {EpisodeLink, Info, Link} from '../types'; | ||
import {getBaseUrl} from '../getBaseUrl'; | ||
|
||
export const ridoGetInfo = async function (link: string): Promise<Info> { | ||
try { | ||
console.log('all', link); | ||
const res = await axios.get(link); | ||
const data = res.data; | ||
const meta = { | ||
title: '', | ||
synopsis: '', | ||
image: '', | ||
imdbId: data?.meta?.imdb_id || '', | ||
type: data?.meta?.type || 'movie', | ||
}; | ||
|
||
const baseUrl = await getBaseUrl('ridomovies'); | ||
let slug = ''; | ||
try { | ||
const res2 = await axios.get( | ||
baseUrl + '/core/api/search?q=' + meta.imdbId, | ||
); | ||
const data2 = res2.data; | ||
console.log('all', data2); | ||
slug = data2?.data?.items[0]?.fullSlug; | ||
if (!slug || meta?.type === 'series') { | ||
return { | ||
title: '', | ||
synopsis: '', | ||
image: '', | ||
imdbId: data?.meta?.imdb_id || '', | ||
type: meta?.type || 'movie', | ||
linkList: [], | ||
}; | ||
} | ||
} catch (err) { | ||
console.error('ridoGetInfo', err); | ||
return { | ||
title: '', | ||
synopsis: '', | ||
image: '', | ||
imdbId: meta?.imdbId || '', | ||
type: meta?.type || 'movie', | ||
linkList: [], | ||
}; | ||
} | ||
|
||
const links: Link[] = []; | ||
let directLinks: EpisodeLink[] = []; | ||
let season = new Map(); | ||
if (meta.type === 'series') { | ||
data?.meta?.videos?.map((video: any) => { | ||
if (video?.season <= 0) return; | ||
if (!season.has(video?.season)) { | ||
season.set(video?.season, []); | ||
} | ||
|
||
season.get(video?.season).push({ | ||
title: 'Episode ' + video?.episode, | ||
type: 'series', | ||
link: JSON.stringify({ | ||
season: video?.id?.split(':')[1], | ||
episode: video?.id?.split(':')[2], | ||
type: data?.meta?.type, | ||
slug: slug, | ||
baseUrl: baseUrl, | ||
}), | ||
}); | ||
}); | ||
const keys = Array.from(season.keys()); | ||
keys.sort(); | ||
keys.map(key => { | ||
directLinks = season.get(key); | ||
links.push({ | ||
title: `Season ${key}`, | ||
directLinks: directLinks, | ||
}); | ||
}); | ||
} else { | ||
console.log('all meta Mv🔥🔥', meta); | ||
links.push({ | ||
title: data?.meta?.name as string, | ||
directLinks: [ | ||
{ | ||
title: 'Movie', | ||
type: 'movie', | ||
link: JSON.stringify({ | ||
type: data?.meta?.type, | ||
slug: slug, | ||
baseUrl: baseUrl, | ||
}), | ||
}, | ||
], | ||
}); | ||
} | ||
return { | ||
...meta, | ||
linkList: links, | ||
}; | ||
} catch (err) { | ||
console.error('ridoGetInfo', err); | ||
return { | ||
title: '', | ||
synopsis: '', | ||
image: '', | ||
imdbId: '', | ||
type: 'movie', | ||
linkList: [], | ||
}; | ||
} | ||
}; |
Oops, something went wrong.