From 758c3caa614dffcb9c292f9c5b60adf00fe1b0a8 Mon Sep 17 00:00:00 2001 From: "youtsteve1@gmail.com" Date: Sun, 2 Jun 2024 13:47:30 +0300 Subject: [PATCH] updated video sources --- package.json | 2 +- pages/anime/[id].js | 3 +-- pages/animes.js | 4 ++-- pages/api/anime/[id].js | 2 +- pages/api/animes/[id].js | 4 ++-- pages/api/episode/[id].js | 2 +- sections/movies/VideoPostHero.js | 7 +++++-- sections/movies/VideoPostTags.js | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index cf55c13..10c5e31 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pages/anime/[id].js b/pages/anime/[id].js index cce0d84..dd24fcd 100644 --- a/pages/anime/[id].js +++ b/pages/anime/[id].js @@ -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 diff --git a/pages/animes.js b/pages/animes.js index a282938..9d72162 100644 --- a/pages/animes.js +++ b/pages/animes.js @@ -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, diff --git a/pages/api/anime/[id].js b/pages/api/anime/[id].js index 2e013ed..99db98f 100644 --- a/pages/api/anime/[id].js +++ b/pages/api/anime/[id].js @@ -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 { diff --git a/pages/api/animes/[id].js b/pages/api/animes/[id].js index 29d329b..d240f16 100644 --- a/pages/api/animes/[id].js +++ b/pages/api/animes/[id].js @@ -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'); diff --git a/pages/api/episode/[id].js b/pages/api/episode/[id].js index d47f863..b453207 100644 --- a/pages/api/episode/[id].js +++ b/pages/api/episode/[id].js @@ -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; diff --git a/sections/movies/VideoPostHero.js b/sections/movies/VideoPostHero.js index 783498e..a949a47 100644 --- a/sections/movies/VideoPostHero.js +++ b/sections/movies/VideoPostHero.js @@ -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'; @@ -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); }; @@ -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(); @@ -645,6 +647,7 @@ export default function VideoPostHero({ post,setStreamingServer,streamingServer + {!pathname.includes('anime')&&( Server @@ -657,7 +660,7 @@ export default function VideoPostHero({ post,setStreamingServer,streamingServer vidcloud - + )} ); } diff --git a/sections/movies/VideoPostTags.js b/sections/movies/VideoPostTags.js index 31af8a9..c904262 100644 --- a/sections/movies/VideoPostTags.js +++ b/sections/movies/VideoPostTags.js @@ -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;