Skip to content

Commit

Permalink
Merge pull request #62 from himanshu8443/main
Browse files Browse the repository at this point in the history
update 2.2.3
  • Loading branch information
Zenda-Cross authored Aug 2, 2024
2 parents 3ddd807 + 786c532 commit a0360ba
Show file tree
Hide file tree
Showing 23 changed files with 392 additions and 129 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 45
versionName "2.2.2"
versionCode 46
versionName "2.2.3"
}
signingConfigs {
release {
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.2.2",
"version": "2.2.3",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
5 changes: 4 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import About, {checkForUpdate} from './screens/settings/About';
import {MMKV} from './lib/Mmkv';
import BootSplash from 'react-native-bootsplash';
import {enableFreeze, enableScreens} from 'react-native-screens';
import Preferences from './screens/settings/Preference';

enableScreens(true);
enableFreeze(true);
Expand Down Expand Up @@ -60,6 +61,7 @@ export type SettingsStackParamList = {
Settings: undefined;
DisableProviders: undefined;
About: undefined;
Preferences: undefined;
};
const Tab = createBottomTabNavigator();
const App = () => {
Expand Down Expand Up @@ -135,6 +137,7 @@ const App = () => {
component={DisableProviders}
/>
<SettingsStack.Screen name="About" component={About} />
<SettingsStack.Screen name="Preferences" component={Preferences} />
</SettingsStack.Navigator>
);
}
Expand Down Expand Up @@ -208,7 +211,7 @@ const App = () => {

useEffect(() => {
if (MMKV.getBool('autoCheckUpdate') !== false) {
checkForUpdate(() => {}, MMKV.getBool('autoDownload') || false);
checkForUpdate(() => {}, MMKV.getBool('autoDownload') || false, false);
}
}, []);

Expand Down
17 changes: 12 additions & 5 deletions src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,24 @@ function Hero() {
<MotiView
from={{opacity: 0, scale: 0.5}}
animate={{opacity: 1, scale: 1}}
//@ts-ignore
transition={{type: 'timing', duration: 300}}
className="w-full items-center justify-center">
<TextInput
onBlur={() => setSearchActive(false)}
autoFocus={true}
onSubmitEditing={e => {
searchNavigation.navigate('ScrollList', {
providerValue: provider.value,
filter: 'query' + e.nativeEvent.text,
title: `${provider.name}`,
});
if (e.nativeEvent.text.includes('https://')) {
navigation.navigate('Info', {
link: e.nativeEvent.text,
});
} else {
searchNavigation.navigate('ScrollList', {
providerValue: provider.value,
filter: 'query' + e.nativeEvent.text,
title: `${provider.name}`,
});
}
}}
placeholder={`Search in ${provider.name}`}
className="w-[95%] px-4 h-10 rounded-full border-white border"
Expand Down
16 changes: 16 additions & 0 deletions src/components/SeasonList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,26 @@ import {manifest} from '../lib/Manifest';
import SharedGroupPreferences from 'react-native-shared-group-preferences';
import RNReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Feather from '@expo/vector-icons/Feather';
import useWatchHistoryStore from '../lib/zustand/watchHistrory';

const SeasonList = ({
LinkList,
poster,
metaTitle,
providerValue,
refreshing,
routeParams,
}: {
LinkList: Link[];
poster: string;
metaTitle: string;
providerValue: string;
refreshing?: boolean;
routeParams: Readonly<{
link: string;
provider?: string;
poster?: string;
}>;
}) => {
const navigation =
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
Expand All @@ -57,6 +64,8 @@ const SeasonList = ({
LinkList[0],
);

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

useEffect(() => {
const fetchList = async () => {
if (!ActiveSeason?.episodesLink) {
Expand Down Expand Up @@ -158,7 +167,14 @@ const SeasonList = ({
return;
}
};

const playHandler = async ({link, type, title, file}: playHandlerProps) => {
addItem({
link: routeParams.link,
title: metaTitle,
image: routeParams.poster!,
provider: providerValue,
});
const externalPlayer = MMKV.getString('externalPlayer');
const downloaded = await ifExists(file);
if (externalPlayer && !downloaded) {
Expand Down
67 changes: 49 additions & 18 deletions src/components/Slider.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import {Image, Text, TouchableOpacity, View} from 'react-native';
import {Image, Pressable, Text, TouchableOpacity, View} from 'react-native';
import React from 'react';
import type {Post} from '../lib/providers/types';
import {NativeStackNavigationProp} from '@react-navigation/native-stack';
import {useNavigation} from '@react-navigation/native';
import {HomeStackParamList} from '../App';
import {Skeleton} from 'moti/skeleton';
import useContentStore from '../lib/zustand/contentStore';
import {FlashList} from '@shopify/flash-list';
import SkeletonLoader from './Skeleton';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import AntDesign from '@expo/vector-icons/AntDesign';
import useWatchHistoryStore from '../lib/zustand/watchHistrory';

export default function Slider({
isLoading,
Expand All @@ -25,21 +27,25 @@ export default function Slider({
const {provider} = useContentStore(state => state);
const navigation =
useNavigation<NativeStackNavigationProp<HomeStackParamList>>();
const [isSelected, setSelected] = React.useState('');
const {removeItem} = useWatchHistoryStore(state => state);

return (
<View className="gap-3 mt-7">
<Pressable onPress={() => setSelected('')} className="gap-3 mt-7">
<View className="flex flex-row items-center justify-between px-2">
<Text className="text-2xl text-primary font-semibold">{title}</Text>
<TouchableOpacity
onPress={() =>
navigation.navigate('ScrollList', {
title: title,
filter: filter,
providerValue: providerValue,
})
}>
<Text className="text-white text-sm">more</Text>
</TouchableOpacity>
{filter && (
<TouchableOpacity
onPress={() =>
navigation.navigate('ScrollList', {
title: title,
filter: filter,
providerValue: providerValue,
})
}>
<Text className="text-white text-sm">more</Text>
</TouchableOpacity>
)}
</View>
{isLoading ? (
<View className="flex flex-row gap-2 overflow-hidden">
Expand All @@ -57,18 +63,29 @@ export default function Slider({
estimatedItemSize={30}
showsHorizontalScrollIndicator={false}
data={posts}
extraData={isSelected}
horizontal
contentContainerStyle={{paddingHorizontal: 3, paddingTop: 7}}
renderItem={({item}) => (
<View className="flex flex-col mx-2">
<TouchableOpacity
onPress={() =>
onLongPress={e => {
e.stopPropagation();
ReactNativeHapticFeedback.trigger('effectClick', {
enableVibrateFallback: true,
ignoreAndroidSystemSettings: false,
});
setSelected(item.link);
}}
onPress={e => {
e.stopPropagation();
setSelected('');
navigation.navigate('Info', {
link: item.link,
provider: providerValue || provider?.value,
provider: item.provider || providerValue || provider?.value,
poster: item?.image,
})
}>
});
}}>
<Image
className="rounded-md"
source={{
Expand All @@ -78,6 +95,20 @@ export default function Slider({
}}
style={{width: 100, height: 150}}
/>
{isSelected === item.link && (
<View className="absolute top-0 left-0 w-full h-full bg-black/50 flex justify-center items-center z-50">
<AntDesign
name="delete"
size={24}
color="white"
onPress={() => {
console.log('remove', item);
setSelected('');
removeItem(item);
}}
/>
</View>
)}
</TouchableOpacity>
<Text className="text-white text-center truncate w-24 text-xs">
{item.title.length > 24
Expand All @@ -98,6 +129,6 @@ export default function Slider({
keyExtractor={item => item.link}
/>
)}
</View>
</Pressable>
);
}
4 changes: 2 additions & 2 deletions src/lib/Manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {modGetEpisodeLinks} from './providers/mod/modGetEpisodesList';
import {modGetStream} from './providers/mod/modGetStream';

/// uhd
import {uhdCatalogList} from './providers/uhd/uhCtatalog';
import {uhdCatalogList, uhdGenresList} from './providers/uhd/uhCtatalog';
import {uhdGetPosts} from './providers/uhd/uhdGetPosts';
import getUhdInfo from './providers/uhd/getUhdInfo';
import {uhdGetStream} from './providers/uhd/uhdGetStream';
Expand Down Expand Up @@ -150,7 +150,7 @@ export const manifest: Manifest = {
},
uhd: {
catalog: uhdCatalogList,
genres: [],
genres: uhdGenresList,
blurImage: true,
nonStreamableServer: ['Gdrive-Instant'],
getStream: uhdGetStream,
Expand Down
7 changes: 1 addition & 6 deletions src/lib/getHomepagedata.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {Content} from './zustand/contentStore';
import {manifest} from './Manifest';

export interface Post {
title: string;
link: string;
image: string;
}
import {Post} from './providers/types';

export interface HomePageData {
title: string;
Expand Down
7 changes: 4 additions & 3 deletions src/lib/providers/dramacool/dcGetPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ export const dcGetPosts = async function (
): Promise<Post[]> {
try {
const urlRes = await axios.get(
'https://consumet8.vercel.app/movies/dramacool/info?id=drama-detail/shogun',
'https://himanshu8443.github.io/providers/modflix.json',
);
const resData = urlRes.data.episodes[0].url;
const baseUrl = resData.split('/').slice(0, 3).join('/');
const dataRes = urlRes.data;
// console.log(dataRes.hdhub.url);
const baseUrl = dataRes?.dc?.url;
console.log('dcBaseUrl', baseUrl);
const url = filter.includes('query')
? `${baseUrl}/search?type=movies&keyword=${filter.replace(
Expand Down
16 changes: 16 additions & 0 deletions src/lib/providers/mod/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ export const catalogList = [
];

export const modGenresList = [
{
title: 'Apple TV+',
filter: '/ott/apple-tv',
},
{
title: 'Disney+',
filter: '/ott/disney-plus',
},
{
title: 'Hulu',
filter: '/ott/hulu',
},
{
title: 'Crunchyroll',
filter: '/ott/crunchyroll',
},
{
title: 'Action',
filter: '/movies-by-genre/action/',
Expand Down
3 changes: 2 additions & 1 deletion src/lib/providers/mod/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const headers = {
'sec-ch-ua-platform': '"Windows"',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
Referer: 'https://moviesmod.live/',
Referer: 'https://moviesmod.band/',
Cookie: 'popads_user_id=6ba8fe60a481387a3249f05aa058822d',
'Sec-Fetch-Site': 'none',
'Sec-Fetch-User': '?1',
'Upgrade-Insecure-Requests': '1',
Expand Down
Loading

0 comments on commit a0360ba

Please sign in to comment.