Skip to content

Commit

Permalink
Merge pull request #177 from himanshu8443/feature
Browse files Browse the repository at this point in the history
Version 2.5.10 Fixed Providers
  • Loading branch information
Zenda-Cross authored Dec 29, 2024
2 parents 45a9298 + 96603b3 commit c3edf92
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 77 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 88
versionName "2.5.9"
versionCode 90
versionName "2.5.10"
}
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.9",
"version": "2.5.10",
"sdkVersion": "51.0.0",
"android": {
"minSdkVersion": 24,
"package": "com.vega",
"versionCode": 88
"versionCode": 90
},
"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.9",
"version": "2.5.10",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
74 changes: 49 additions & 25 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import TabBarBackgound from './components/TabBarBackgound';
import {TouchableOpacity} from 'react-native';
import {SafeAreaProvider, SafeAreaView} from 'react-native-safe-area-context';
import {StyleProp} from 'react-native';
import Animated from 'react-native-reanimated';

enableScreens(true);
enableFreeze(true);
Expand Down Expand Up @@ -228,57 +229,80 @@ const App = () => {
component={HomeStackScreen}
options={{
title: 'Home',
tabBarIcon: ({focused, color, size}) =>
focused ? (
<Ionicons name="home" color={color} size={size} />
) : (
<Ionicons name="home-outline" color={color} size={size} />
),
tabBarIcon: ({focused, color, size}) => (
<Animated.View
style={{
transform: [{scale: focused ? 1.2 : 1}],
}}>
{focused ? (
<Ionicons name="home" color={color} size={size} />
) : (
<Ionicons name="home-outline" color={color} size={size} />
)}
</Animated.View>
),
}}
/>
<Tab.Screen
name="SearchStack"
component={SearchStackScreen}
options={{
title: 'Search',
tabBarIcon: ({focused, color, size}) =>
focused ? (
<Ionicons name="search" color={color} size={size} />
) : (
<Ionicons name="search-outline" color={color} size={size} />
),
tabBarIcon: ({focused, color, size}) => (
<Animated.View
style={{
transform: [{scale: focused ? 1.2 : 1}],
}}>
{focused ? (
<Ionicons name="search" color={color} size={size} />
) : (
<Ionicons name="search-outline" color={color} size={size} />
)}
</Animated.View>
),
}}
/>
<Tab.Screen
name="WatchListStack"
component={WatchListStackScreen}
options={{
title: 'Watch List',
tabBarIcon: ({focused, color, size}) =>
focused ? (
<Entypo name="folder-video" color={color} size={size} />
) : (
<Entypo name="folder-video" color={color} size={size} />
),
tabBarIcon: ({focused, color, size}) => (
<Animated.View
style={{
transform: [{scale: focused ? 1.2 : 1}],
}}>
{focused ? (
<Entypo name="folder-video" color={color} size={size} />
) : (
<Entypo name="folder-video" color={color} size={size} />
)}
</Animated.View>
),
}}
/>
<Tab.Screen
name="SettingsStack"
component={SettingsStackScreen}
options={{
title: 'Settings',
tabBarIcon: ({focused, color, size}) =>
focused ? (
<Ionicons name="settings" color={color} size={size} />
) : (
<Ionicons name="settings-outline" color={color} size={size} />
),
tabBarIcon: ({focused, color, size}) => (
<Animated.View
style={{
transform: [{scale: focused ? 1.2 : 1}],
}}>
{focused ? (
<Ionicons name="settings" color={color} size={size} />
) : (
<Ionicons name="settings-outline" color={color} size={size} />
)}
</Animated.View>
),
}}
/>
</Tab.Navigator>
);
}

useEffect(() => {
if (MMKV.getBool('autoCheckUpdate') !== false) {
checkForUpdate(
Expand Down
12 changes: 6 additions & 6 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ export const providersList: ProvidersList[] = [
// type: 'global',
// flag: '🌏',
// },
{
name: 'ExtraMovies',
value: 'extraMovies',
type: 'global',
flag: '🌏',
},
{
name: 'MoviesMod',
value: 'mod',
Expand Down Expand Up @@ -85,6 +79,12 @@ export const providersList: ProvidersList[] = [
type: 'global',
flag: '🌏',
},
{
name: 'ExtraMovies',
value: 'extraMovies',
type: 'global',
flag: '🌏',
},
{
name: 'VadaPav',
value: 'vadapav',
Expand Down
3 changes: 2 additions & 1 deletion src/lib/providers/autoEmbed/getRiveStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export async function getRiveStream(
'nova',
'vidcloud',
'ee3',
'showbox',
'ghost',
'asiacloud',
];
const baseUrl = await getBaseUrl('rive');
const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + '?url=' : '';
Expand Down
15 changes: 12 additions & 3 deletions src/lib/providers/drive/driveGetStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@ export const driveGetStream = async (
}
console.log('driveGetStream', type, url);
const res = await axios.get(url, {headers});
const redirectUrl = res.data.match(
// console.log('res', res);
let redirectUrl = res.data.match(
/<meta\s+http-equiv="refresh"\s+content="[^"]*?;\s*url=([^"]+)"\s*\/?>/i,
)[1];
)?.[1];
if (url.includes('/archives/')) {
redirectUrl = res.data.match(
/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i,
)?.[1];
}
console.log('redirectUrl', redirectUrl);
if (!redirectUrl) {
return await hubcloudExtracter(url, signal);
}
const res2 = await axios.get(redirectUrl, {headers});
const data = res2.data;
// console.log('data', data);
Expand All @@ -35,7 +44,7 @@ export const driveGetStream = async (
signal,
);
} catch (err) {
console.error(err);
console.error('Movies Drive err', err);
return [];
}
};
32 changes: 32 additions & 0 deletions src/lib/providers/hdhub4u/decoder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function rot13(str: string) {
return str.replace(/[a-zA-Z]/g, function (char) {
const charCode = char.charCodeAt(0);
const isUpperCase = char <= 'Z';
const baseCharCode = isUpperCase ? 65 : 97;
return String.fromCharCode(
((charCode - baseCharCode + 13) % 26) + baseCharCode,
);
});
}

export function decodeString(encryptedString: string) {
try {
// First base64 decode
let decoded = atob(encryptedString);

// Second base64 decode
decoded = atob(decoded);

// ROT13 decode
decoded = rot13(decoded);

// Third base64 decode
decoded = atob(decoded);

// Parse JSON
return JSON.parse(decoded);
} catch (error) {
console.error('Error decoding string:', error);
return null;
}
}
2 changes: 1 addition & 1 deletion src/lib/providers/hdhub4u/getRedirectLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function getRedirectLinks(link: string, signal: AbortSignal) {
// console.log('vcloudLink', vcloudLink?.[1]);
return blogLink || link;
} catch (err) {
console.error(err);
console.log('Error in getRedirectLinks', err);
return link;
}
}
6 changes: 6 additions & 0 deletions src/lib/providers/hdhub4u/hdbHeaders.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const hdbHeaders = {
Cookie: 'xla=s4t',
Referer: 'https://google.com',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0',
};
28 changes: 13 additions & 15 deletions src/lib/providers/hdhub4u/hdhub4uGetSteam.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import axios from 'axios';
import * as cheerio from 'cheerio';
import {headers} from '../headers';
import {ToastAndroid} from 'react-native';
import {hubcloudExtracter} from '../hubcloudExtractor';
import {getRedirectLinks} from './getRedirectLinks';
import {decodeString} from './decoder';

export async function hdhub4uGetStream(
link: string,
Expand All @@ -19,9 +19,15 @@ export async function hdhub4uGetStream(
hubdriveLink =
$('.btn.btn-primary.btn-user.btn-success1.m-1').attr('href') || link;
} else {
if (link.includes('hdhub4u')) {
link = 'https://max.offerboom.top/?id=' + link.split('id=')[1];
}
const res = await axios.get(link, {headers, signal});
const text = res.data;
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
console.log('encryptedString', encryptedString);
const decodedString: any = decodeString(encryptedString);
console.log('decodedString', decodedString);
link = atob(decodedString?.o);
console.log('new link', link);

const redirectLink = await getRedirectLinks(link, signal);
console.log('redirectLink', redirectLink);

Expand All @@ -48,20 +54,12 @@ export async function hdhub4uGetStream(
const hubcloudLink =
hubcloudText.match(
/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i,
) || [];
)?.[1] || hubdriveLink;
// console.log('hubcloudLink', hubcloudLink[1]);
try {
return await hubcloudExtracter(hubcloudLink[1], signal);
return await hubcloudExtracter(hubcloudLink, signal);
} catch (error: any) {
console.log('getStream error: ', error);
if (error.message.includes('Aborted')) {
// ToastAndroid.show('Request Aborted', ToastAndroid.SHORT);
} else {
ToastAndroid.show(
`Error getting stream links ${error.message}`,
ToastAndroid.SHORT,
);
}
console.log('hd hub 4 getStream error: ', error);
return [];
}
}
10 changes: 7 additions & 3 deletions src/lib/providers/hdhub4u/hdhubGetInfo.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import axios from 'axios';
import * as cheerio from 'cheerio';
import {headers} from '../headers';
import {Info, Link} from '../types';
import {hdbHeaders} from './hdbHeaders';

export const hdhub4uGetInfo = async function (link: string): Promise<Info> {
try {
const url = link;
const res = await axios.get(url, {headers});
const res = await axios.get(url, {headers: hdbHeaders});
console.log('hdhub4uGetInfo', url);
// console.log('hdhub4uGetInfo', res.data);
const data = res.data;
const $ = cheerio.load(data);
const container = $('.code-block.code-block-1');
const container = $('.page-body');
const imdbId =
container
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
Expand All @@ -30,6 +32,8 @@ export const hdhub4uGetInfo = async function (link: string): Promise<Info> {
.replace('DESCRIPTION:', '');
const image = container.find('img[decoding="async"]').attr('src') || '';

console.log('hdhub4uGetInfo', title, imdbId, type, synopsis, image);

// Links
const links: Link[] = [];
const directLink: Link['directLinks'] = [];
Expand Down
11 changes: 8 additions & 3 deletions src/lib/providers/hdhub4u/hdhubGetPosts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as cheerio from 'cheerio';
import {headers} from '../headers';
import {Post} from '../types';
import {getBaseUrl} from '../getBaseUrl';
import {hdbHeaders} from './hdbHeaders';

export const hdhubGetPosts = async function (
filter: string,
Expand All @@ -11,7 +11,7 @@ export const hdhubGetPosts = async function (
): Promise<Post[]> {
const baseUrl = await getBaseUrl('hdhub');
const url = `${baseUrl + filter}/page/${page}/`;
// console.log('hdhubGetPosts', url);
console.log('hdhubGetPosts', url);
return posts(url, signal);
};

Expand All @@ -29,8 +29,12 @@ export const hdhubGetPostsSearch = async function (

async function posts(url: string, signal: AbortSignal): Promise<Post[]> {
try {
const res = await fetch(url, {headers, signal});
const res = await fetch(url, {
headers: hdbHeaders,
signal,
});
const data = await res.text();
console.log('hdhubGetPosts', data);
const $ = cheerio.load(data);
const catalog: Post[] = [];
$('.recent-movies')
Expand All @@ -39,6 +43,7 @@ async function posts(url: string, signal: AbortSignal): Promise<Post[]> {
const title = $(element).find('figure').find('img').attr('alt');
const link = $(element).find('a').attr('href');
const image = $(element).find('figure').find('img').attr('src');

if (title && link && image) {
catalog.push({
title: title.replace('Download', '').trim(),
Expand Down
Loading

0 comments on commit c3edf92

Please sign in to comment.