Skip to content

Commit

Permalink
"Updated App.tsx, app.json, VideoPlayer.tsx, eas.json, and helper/uti…
Browse files Browse the repository at this point in the history
…ls.ts with various changes to URL handling, cookie headers, and build configurations."
  • Loading branch information
r0ld3x committed Sep 13, 2024
1 parent a82c4d5 commit 7cf3892
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 52 deletions.
18 changes: 7 additions & 11 deletions .well-known/assetlinks.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "{package_name}",
"sha256_cert_fingerprints": [
"{sha256_cert_fingerprints}"
]
}
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "{package_name}",
"sha256_cert_fingerprints": ["{sha256_cert_fingerprints}"]
}
}
]
3 changes: 2 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ const Page = () => {
const getInitUrl = useCallback(() => {
const func = async () => {
const data = await Linking.getInitialURL();
if (!data || data.length < 0) return;
const check = checkUrlPatterns(text);
if (!check || !data || data.length < 0) return;
setText(data);
submit(data);
};
Expand Down
6 changes: 5 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@
"extra": {
"router": {
"origin": false
},
"eas": {
"projectId": "b7b6b983-86d2-45e7-8127-0b58820ab96d"
}
}
},
"owner": "wnsjscroxtt"
}
}
6 changes: 5 additions & 1 deletion components/VideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export default function VideoPlayer({ data }: { data: ApiResponse }) {
const [isPlaying, setIsPlaying] = useState(true);
const player = useVideoPlayer(
{
uri: data.resolutions["Fast Download"],
uri: data.resolutions["HD Video"],
headers: {
cookie:
"browserid=z09C3XFwfWw9lPvS64DPoLVX3q8o9y2-cDBuNofHMAWBkvjUbUlEFjIh6L8=; lang=en; TSID=QhognhPqYAJ1AactOacigULhNDPH8ai9; __bid_n=191ea0f213837e3b6e4207; _ga_06ZNKL8C2E=GS1.1.1726214213.3.1.1726216196.59.0.0; _ga=GA1.1.1419035484.1726208747; ndus=Y-ZNVKxteHuiNU92ow2Ut_G1kbh_Taz4aUzfi290; PANWEB=1",
},
metadata: {
title: data.title,
},
Expand Down
4 changes: 0 additions & 4 deletions eas.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"android": {
"buildType": "apk"
Expand Down
71 changes: 37 additions & 34 deletions helper/utils.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
export function checkUrlPatterns(url: string): boolean {
const patterns: RegExp[] = [
/www\.nephobox\.com/,
/freeterabox\.com/,
/www\.freeterabox\.com/,
/1024tera\.com/,
/4funbox\.co/,
/www\.4funbox\.com/,
/mirrobox\.com/,
/nephobox\.com/,
/terabox\.app/,
/terabox\.com/,
/www\.terabox\.ap/,
/www\.terabox\.com/,
/www\.1024tera\.co/,
/www\.momerybox\.com/,
/teraboxapp\.com/,
/momerybox\.com/,
/tibibox\.com/,
/www\.tibibox\.com/,
/www\.teraboxapp\.com/,
/www\.teraboxlink\.com/,
/teraboxlink\.com/,
];
const patterns: RegExp[] = [
/www\.nephobox\.com/,
/freeterabox\.com/,
/www\.freeterabox\.com/,
/1024tera\.com/,
/4funbox\.co/,
/www\.4funbox\.com/,
/mirrobox\.com/,
/nephobox\.com/,
/terabox\.app/,
/terabox\.com/,
/www\.terabox\.ap/,
/www\.terabox\.com/,
/www\.1024tera\.co/,
/www\.momerybox\.com/,
/teraboxapp\.com/,
/momerybox\.com/,
/tibibox\.com/,
/www\.tibibox\.com/,
/www\.teraboxapp\.com/,
/www\.teraboxlink\.com/,
/teraboxlink\.com/,
/terasharelink\.com/,
];

return patterns.some(pattern => pattern.test(url));
return patterns.some((pattern) => pattern.test(url));
}


export function replaceNetlocWithNewDomain(url: string, newDomain: string = "1024terabox.com"): string {
try {
const urlObj = new URL(url);
const netloc = urlObj.hostname;
const newUrl = url.replace(netloc, newDomain);
return newUrl;
} catch (error) {
return url;
}
export function replaceNetlocWithNewDomain(
url: string,
newDomain: string = "1024terabox.com"
): string {
try {
const urlObj = new URL(url);
const netloc = urlObj.hostname;
const newUrl = url.replace(netloc, newDomain);
return newUrl;
} catch (error) {
return url;
}
}

0 comments on commit 7cf3892

Please sign in to comment.