Skip to content

Commit

Permalink
Merge pull request #196 from himanshu8443/feature
Browse files Browse the repository at this point in the history
Version 2.5.14
  • Loading branch information
Zenda-Cross authored Jan 17, 2025
2 parents 6d17ff5 + ea902b6 commit c227e12
Show file tree
Hide file tree
Showing 33 changed files with 1,171 additions and 434 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ android {
applicationId "com.vega"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 97
versionName "2.5.13"
versionCode 100
versionName "2.5.14"
}
signingConfigs {
release {
Expand Down
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
]
],
"slug": "vega",
"version": "2.5.13",
"version": "2.5.14",
"sdkVersion": "51.0.0",
"android": {
"minSdkVersion": 24,
"package": "com.vega",
"versionCode": 97
"versionCode": 100
},
"platforms": ["ios", "android"]
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vega",
"version": "2.5.13",
"version": "2.5.14",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
77 changes: 42 additions & 35 deletions src/components/SeasonList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,39 +71,6 @@ const SeasonList = ({

const {addItem} = useWatchHistoryStore(state => state);

useEffect(() => {
const fetchList = async () => {
if (!ActiveSeason?.episodesLink) {
return;
}
setEpisodeLoading(true);
try {
const cacheEpisodes = await MmmkvCache.getItem(
ActiveSeason.episodesLink,
);
if (cacheEpisodes) {
setEpisodeList(JSON.parse(cacheEpisodes as string));
// console.log('cache', JSON.parse(cacheEpisodes as string));
setEpisodeLoading(false);
}
const episodes = manifest[providerValue].GetEpisodeLinks
? await manifest[providerValue].GetEpisodeLinks(
ActiveSeason.episodesLink,
)
: [];
if (episodes.length === 0) return;
MmmkvCache.setItem(ActiveSeason.episodesLink, JSON.stringify(episodes));
// console.log(episodes);
setEpisodeList(episodes);
setEpisodeLoading(false);
} catch (e) {
console.log(e);
setEpisodeLoading(false);
}
};
fetchList();
}, [ActiveSeason, refreshing]);

type playHandlerProps = {
linkIndex: number;
type: string;
Expand Down Expand Up @@ -162,8 +129,15 @@ const SeasonList = ({
episodeList[linkIndex].title
).replaceAll(/[^a-zA-Z0-9]/g, '_');
const externalPlayer = MMKV.getBool('useExternalPlayer');
const downloaded = await ifExists(file);
if (externalPlayer && !downloaded) {
const dwFile = await ifExists(file);
if (externalPlayer) {
if (dwFile) {
await IntentLauncher.startActivityAsync('android.intent.action.VIEW', {
data: dwFile,
type: 'video/*',
});
return;
}
handleExternalPlayer(link, type);
return;
}
Expand All @@ -172,6 +146,7 @@ const SeasonList = ({
linkIndex,
episodeList,
type: type,
directUrl: dwFile || '',
primaryTitle: primaryTitle,
secondaryTitle: seasonTitle,
poster: poster,
Expand Down Expand Up @@ -199,6 +174,38 @@ const SeasonList = ({
setStickyMenu({active: active, link: link, type: type});
};

useEffect(() => {
const fetchList = async () => {
if (!ActiveSeason?.episodesLink) {
return;
}
setEpisodeLoading(true);
try {
const cacheEpisodes = await MmmkvCache.getItem(
ActiveSeason.episodesLink,
);
if (cacheEpisodes) {
setEpisodeList(JSON.parse(cacheEpisodes as string));
// console.log('cache', JSON.parse(cacheEpisodes as string));
setEpisodeLoading(false);
}
const episodes = manifest[providerValue].GetEpisodeLinks
? await manifest[providerValue].GetEpisodeLinks(
ActiveSeason.episodesLink,
)
: [];
if (episodes.length === 0) return;
MmmkvCache.setItem(ActiveSeason.episodesLink, JSON.stringify(episodes));
// console.log(episodes);
setEpisodeList(episodes);
setEpisodeLoading(false);
} catch (e) {
console.log(e);
setEpisodeLoading(false);
}
};
fetchList();
}, [ActiveSeason, refreshing]);
return (
<View>
{LinkList.length > 1 ? (
Expand Down
7 changes: 6 additions & 1 deletion src/lib/Manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Content} from './zustand/contentStore';
import {dooflixProvider} from './providers/dooflix';
import {autoEmbedDrama} from './providers/autoEmbedDrama';
import {AEAnime} from './providers/autoEmbedAnime';
import {dramacool} from './providers/dramacool';
import {dramacoolConsumet} from './providers/dramacoolConsumet';
import {vegaMovies} from './providers/vega';
import {luxMovies} from './providers/luxMovies';
import {modMovies} from './providers/mod';
Expand All @@ -32,6 +32,9 @@ import {guardahd} from './providers/guardahd';
import {toonstream} from './providers/toonstream';
import {ridoMovies} from './providers/ridoMovies';
import {protonMovies} from './providers/protonMovies';
import {dramacool} from './providers/dramacool';
import {ringz} from './providers/ringz';
import {topMovies} from './providers/topmovies';

export interface ProviderType {
searchFilter?: string;
Expand Down Expand Up @@ -96,4 +99,6 @@ export const manifest: Manifest = {
toonstream: toonstream,
ridoMovies: ridoMovies,
protonMovies: protonMovies,
ringz: ringz,
topMovies: topMovies,
};
12 changes: 12 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export const providersList: ProvidersList[] = [
type: 'global',
flag: FLAGS.GLOBAL,
},
{
name: 'Ringz',
value: 'ringz',
type: 'global',
flag: FLAGS.GLOBAL,
},
{
name: 'NetflixMirror',
value: 'netflixMirror',
Expand Down Expand Up @@ -188,6 +194,12 @@ export const providersList: ProvidersList[] = [
type: 'india',
flag: FLAGS.INDIA,
},
{
name: 'TopMovies',
value: 'topMovies',
type: 'india',
flag: FLAGS.INDIA,
},
{
name: 'GuardaHD',
value: 'guardahd',
Expand Down
157 changes: 103 additions & 54 deletions src/lib/providers/dooflix/dooGetPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,61 @@ export const dooGetPost = async function (
try {
const baseUrl = await getBaseUrl('dooflix');
const catalog: Post[] = [];
// console.log(filter);
const url = `${baseUrl + filter + `?page=${page}`}`;
// console.log('dooflix', url);

const res = await axios.get(url, {headers, signal});
const resData = res.data;
const jsonStart = resData?.indexOf('[');
const jsonEnd = resData?.lastIndexOf(']') + 1;
const data =
JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.length > 0
? JSON?.parse(resData?.substring(jsonStart, jsonEnd))
: resData;
data?.map((result: any) => {
const id = result?.videos_id;
const link = `${baseUrl}/rest-api//v130/single_details?type=${
!result?.is_tvseries ? 'tvseries' : 'movie'
}&id=${id}`;
if (id) {
catalog.push({
title: result?.title,
link: link,
image: result?.thumbnail_url?.includes('https')
? result?.thumbnail_url
: result?.thumbnail_url?.replace('http', 'https'),
});

if (!resData || typeof resData !== 'string') {
console.warn('Unexpected response format from dooflix API');
return [];
}

let data;
try {
const jsonStart = resData.indexOf('[');
const jsonEnd = resData.lastIndexOf(']') + 1;

if (jsonStart === -1 || jsonEnd <= jsonStart) {
// If we can't find valid JSON array markers, try parsing the entire response
data = JSON.parse(resData);
} else {
const jsonSubstring = resData.substring(jsonStart, jsonEnd);
const parsedArray = JSON.parse(jsonSubstring);
data = parsedArray.length > 0 ? parsedArray : resData;
}
} catch (parseError) {
console.error('Error parsing dooflix response:', parseError);
return [];
}

if (!Array.isArray(data)) {
console.warn('Unexpected data format from dooflix API');
return [];
}

data.forEach((result: any) => {
const id = result?.videos_id;
if (!id) return;

const type = !result?.is_tvseries ? 'tvseries' : 'movie';
const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`;

const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https')
? thumbnailUrl
: thumbnailUrl?.replace('http', 'https');

catalog.push({
title: result?.title || '',
link,
image,
});
});
// console.log(catalog);

return catalog;
} catch (err) {
console.error('dooflix error ', err);
console.error('dooflix error:', err);
return [];
}
};
Expand All @@ -56,51 +81,75 @@ export const dooGetSearchPost = async function (
if (page > 1) {
return [];
}

const catalog: Post[] = [];
const baseUrl = await getBaseUrl('dooflix');
const url =
baseUrl +
`/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`;
const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`;

console.log('search', url);
const res = await axios.get(url, {headers, signal});
const resData = res.data;
const jsonStart = resData?.indexOf('{');
const jsonEnd = resData?.lastIndexOf('}') + 1;
const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.movie
? JSON?.parse(resData?.substring(jsonStart, jsonEnd))
: resData;
console.log('data🌏🌏', data);
data?.movie?.map((result: any) => {

if (!resData || typeof resData !== 'string') {
console.warn('Unexpected search response format from dooflix API');
return [];
}

let data;
try {
const jsonStart = resData.indexOf('{');
const jsonEnd = resData.lastIndexOf('}') + 1;

if (jsonStart === -1 || jsonEnd <= jsonStart) {
data = resData;
} else {
const jsonSubstring = resData.substring(jsonStart, jsonEnd);
const parsedData = JSON.parse(jsonSubstring);
data = parsedData?.movie ? parsedData : resData;
}
} catch (parseError) {
console.error('Error parsing dooflix search response:', parseError);
return [];
}

// Process movies
data?.movie?.forEach((result: any) => {
const id = result?.videos_id;
if (!id) return;

const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`;
if (id) {
catalog.push({
title: result?.title,
link: link,
image: result?.thumbnail_url?.includes('https')
? result?.thumbnail_url
: result?.thumbnail_url?.replace('http', 'https'),
});
}
const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https')
? thumbnailUrl
: thumbnailUrl?.replace('http', 'https');

catalog.push({
title: result?.title || '',
link,
image,
});
});

data?.tvseries?.map((result: any) => {
// Process TV series
data?.tvseries?.forEach((result: any) => {
const id = result?.videos_id;
if (!id) return;

const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`;
if (id) {
catalog.push({
title: result?.title,
link: link,
image: result?.thumbnail_url?.includes('https')
? result?.thumbnail_url
: result?.thumbnail_url?.replace('http', 'https'),
});
}
const thumbnailUrl = result?.thumbnail_url;
const image = thumbnailUrl?.includes('https')
? thumbnailUrl
: thumbnailUrl?.replace('http', 'https');

catalog.push({
title: result?.title || '',
link,
image,
});
});

return catalog;
} catch (error) {
console.error('dooflix search error ', error);
console.error('dooflix search error:', error);
return [];
}
};
2 changes: 1 addition & 1 deletion src/lib/providers/dooflix/dooGetSteam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const dooGetStream = async (link: string): Promise<Stream[]> => {
headers: {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0',
Referer: atob('aHR0cHM6Ly9oZG1vdmllMi5tb2Uv'),
Referer: 'https://mocdn.art/',
},
});
console.log('doo streams', streams);
Expand Down
Loading

0 comments on commit c227e12

Please sign in to comment.