-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor file paths, update dependencies, and add new components
- Loading branch information
1 parent
73d8f84
commit e2416e4
Showing
12 changed files
with
227 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { | ||
View, | ||
Text, | ||
ScrollView, | ||
Animated, | ||
Platform, | ||
UIManager, | ||
LayoutAnimation, | ||
} from 'react-native'; | ||
import React, {useEffect, useState} from 'react'; | ||
import {Link} from '../lib/getInfo'; | ||
import {getStream} from '../lib/getStream'; | ||
|
||
const SeasonList = ({LinkList}: {LinkList: Link[]}) => { | ||
if (Platform.OS === 'android') { | ||
if (UIManager.setLayoutAnimationEnabledExperimental) { | ||
UIManager.setLayoutAnimationEnabledExperimental(true); | ||
} | ||
} | ||
const [acc, setAcc] = useState<string>(''); | ||
const [stream, setStream] = useState<string>(''); | ||
useEffect(() => { | ||
const fetchStream = async () => { | ||
const link = await getStream( | ||
LinkList.find(link => link.title === acc)?.movieLinks || '', | ||
); | ||
console.log('link', link); | ||
setStream(link); | ||
}; | ||
if (acc) { | ||
fetchStream(); | ||
} | ||
}, [acc]); | ||
|
||
return ( | ||
<ScrollView className="p-4"> | ||
<Text className="text-white text-lg font-semibold mb-2">Seasons</Text> | ||
<View className="flex-row flex-wrap justify-center gap-x-2 gap-y-2"> | ||
{LinkList.map(link => ( | ||
<View | ||
className="bg-quaternary min-w-full p-2 rounded-md" | ||
key={link.movieLinks}> | ||
<Text | ||
className="text-white" | ||
onPress={() => { | ||
LayoutAnimation.configureNext( | ||
LayoutAnimation.Presets.easeInEaseOut, | ||
); | ||
setAcc(acc === link.title ? '' : link.title); | ||
}}> | ||
{link.title} | ||
</Text> | ||
<Animated.ScrollView | ||
style={{ | ||
maxHeight: acc === link.title ? 200 : 0, | ||
overflow: 'hidden', | ||
}}> | ||
<Text className="text-white">{link.movieLinks}</Text> | ||
<Text className="text-white">{stream}</Text> | ||
</Animated.ScrollView> | ||
</View> | ||
))} | ||
</View> | ||
</ScrollView> | ||
); | ||
}; | ||
|
||
export default SeasonList; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import axios from 'axios'; | ||
import * as cheerio from 'cheerio'; | ||
|
||
export async function getStream(dotlink: string) { | ||
try { | ||
// console.log('dotlink', dotlink); | ||
const dotlinkRes = await axios(dotlink); | ||
const dotlinkText = dotlinkRes.data; | ||
// console.log('dotlinkText', dotlinkText); | ||
const vLink = | ||
dotlinkText.match(/<a\s+href="([^"]*v-cloud\.bio[^"]*)"/i) || []; | ||
// console.log('vLink', vLink[1]); | ||
const vLinkRes = await axios(vLink[1]); | ||
const vLinkText = vLinkRes.data; | ||
const vLinkRedirect = vLinkText.match(/var\s+url\s*=\s*'([^']+)';/) || [ | ||
'', | ||
'', | ||
]; | ||
// console.log(vLinkRedirect); | ||
const getTokenRes = await axios(vLinkRedirect[1]); | ||
|
||
const getTokenText = getTokenRes.data; | ||
const getToken = getTokenText.match(/[\?&]r=([^&;]*)/); | ||
// console.log(getToken?.[1]); | ||
const blogLink = `https://bloggingvector.shop/re/${getToken?.[1]}?_=631252793`; | ||
const blogRes = await axios(blogLink); | ||
// console.log(blogRes.data); | ||
const vcloudLink = blogRes.data.match( | ||
/https:\/\/v-cloud\.bio\/\w+\?token=([a-zA-Z0-9_-]+)/, | ||
); | ||
// console.log('vcloudLink', vcloudLink?.[0]); | ||
const vcloudRes = await axios(vcloudLink?.[0]); | ||
const $ = cheerio.load(vcloudRes.data); | ||
|
||
const linkClass = $('.btn-success.btn-lg.h6'); | ||
const streamLinks: string[] = []; | ||
linkClass.each((index, element) => { | ||
const itm = $(element); | ||
const link = itm.attr('href') || ''; | ||
if (link?.includes('workers.dev')) { | ||
streamLinks.push(link); | ||
} | ||
}); | ||
|
||
// console.log(streamLinks); | ||
return streamLinks[0]; | ||
} catch (error) { | ||
console.error(error); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {clsx, type ClassValue} from 'clsx'; | ||
import {twMerge} from 'tailwind-merge'; | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)); | ||
} |
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
Oops, something went wrong.