Skip to content

Commit

Permalink
updated video sources
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyout committed Jun 2, 2024
1 parent 523bfe6 commit 758c3ca
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@auth0/auth0-spa-js": "^1.20.1",
"@consumet/extensions": "^1.5.6",
"@consumet/extensions": "^1.6.0",
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11.8.2",
"@emotion/server": "^11.4.0",
Expand Down
3 changes: 1 addition & 2 deletions pages/anime/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@ export default function BlogPost({ data }) {
export async function getServerSideProps(context) {
try {
const id = context.params.id;
const anime =new ANIME.Gogoanime();
const anime =new ANIME.Zoro();
const movie = await anime.fetchAnimeInfo(id);
console.log(movie)
const sources = await anime.fetchEpisodeSources(movie.episodes[0].id);
movie.sources = sources.sources;
movie.subtitles=sources.subtitles
Expand Down
4 changes: 2 additions & 2 deletions pages/animes.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ export default function Videos({ data }) {

export async function getServerSideProps(context) {
try {
const anime =new ANIME.Gogoanime();
const movies = await anime.fetchAnimeList();
const anime =new ANIME.Zoro();
const movies = await anime.fetchTopAiring();
return {
props: {
data: movies.results,
Expand Down
2 changes: 1 addition & 1 deletion pages/api/anime/[id].js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///axios
import {ANIME } from '@consumet/extensions';
const anime =new ANIME.Gogoanime();
const anime =new ANIME.Zoro();

export default async function handler(req, res) {
try {
Expand Down
4 changes: 2 additions & 2 deletions pages/api/animes/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ANIME } from "@consumet/extensions";
export default async function handler(req, res) {
try {
const { sort } = await req.query;
const anime =new ANIME.Gogoanime();
const movies = await anime.fetchAnimeList();
const anime =new ANIME.Zoro();
const movies = await anime.fetchTopAiring();
res.status(200).json(movies);
} catch (error) {
console.error('failed to load data');
Expand Down
2 changes: 1 addition & 1 deletion pages/api/episode/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ANIME} from '@consumet/extensions';
import {MOVIES} from 'wikiextensions-flix';
import axios from "@/utils/axios";
const anime =new ANIME.AnimeSaturn();
const anime =new ANIME.Zoro();
export default async function handler(req, res) {
try {
const { id,episode,type } = await req.query;
Expand Down
7 changes: 5 additions & 2 deletions sections/movies/VideoPostHero.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { fDate } from '@/utils/formatTime';
// components
import Image from '@/components/Image';
import Iconify from '@/components/Iconify';
import { useRouter } from 'next/router';
import { useRef } from 'react';
import { MediaProvider, MediaPlayer, Time, useMediaStore, useMediaRemote,Track,Captions } from '@vidstack/react';

Expand Down Expand Up @@ -257,6 +258,7 @@ export default function VideoPostHero({ post,setStreamingServer,streamingServer

const open = Boolean(anchorEl);
const openCc = Boolean(anchorEl1);
const { pathname } = useRouter();
const handleClick = (event) => {
setAnchorEl(event.currentTarget);
};
Expand Down Expand Up @@ -305,7 +307,7 @@ export default function VideoPostHero({ post,setStreamingServer,streamingServer
sources,
subtitles
} = post;
const stream = sources.find((source) => source.quality&&source.quality.includes('auto'))||sources[1];
const stream = sources.find((source) => source.quality&&source.quality.includes('auto'))||sources[0];
function preventHorizontalKeyboardNavigation(event) {
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
event.preventDefault();
Expand Down Expand Up @@ -645,6 +647,7 @@ export default function VideoPostHero({ post,setStreamingServer,streamingServer
</SpeedDial>
</FooterStyle>

{!pathname.includes('anime')&&(
<Box sx={{ display: 'flex', alignItems: 'center',mt:4,p:2 }}>
<FormControl fullWidth>
<InputLabel id="demo-simple-select-label">Server</InputLabel>
Expand All @@ -657,7 +660,7 @@ export default function VideoPostHero({ post,setStreamingServer,streamingServer
<MenuItem value={'VidCloud'}>vidcloud</MenuItem>
</Select>
</FormControl>
</Box>
</Box>)}
</>
);
}
2 changes: 1 addition & 1 deletion sections/movies/VideoPostTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function VideoPostTags({ post,setMovie }) {
const { query,pathname } = useRouter();
const[active,setActive]=useState(0);
const[loading,setLoading]=useState(false)
const { enqueueSnackbar } = useSnackbar();
const { enqueueSnackbar } = useSnackbar();

const { id } = query;
let { tags,episodes,type} = post;
Expand Down

0 comments on commit 758c3ca

Please sign in to comment.