Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
formando nova melhor estrutura
Browse files Browse the repository at this point in the history
  • Loading branch information
uesleibros committed Sep 3, 2024
1 parent ac77c00 commit 5e8b0bf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/app/api/buscar/animes/anroll/episodios/navegar/route.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import config from "@/config";

export async function GET(request) {
const id = request.nextUrl.searchParams.get("id");

if (!id)
return Response.json({ error: "missing ep_id." }, { status: 404 });

const res = await fetch(`https://www.anroll.net/_next/data/nxb43Ok4qvT2cAlD0OLS1/e/${id}.json?episode=${id}`, {
const res = await fetch(`https://www.anroll.net/_next/data/${config.anroll.buildId}/e/${id}.json?episode=${id}`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"Referer": "https://www.anroll.net/"
Expand Down
5 changes: 3 additions & 2 deletions src/app/api/recentes/animes/anroll/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export async function GET() {
const res = await fetch(`https://www.anroll.net/_next/data/${config.anroll.buildId}/index.json`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"Referer": "https://www.anroll.net/"
"Referer": "https://www.anroll.net/",
"Cookie": "anroll:activeSVI=0; anroll:theaterMode=1; _a_44B3TM_d_=true"
},
next: { revalidate: 300 }
});
Expand All @@ -14,5 +15,5 @@ export async function GET() {
catalog.forEach((i) => i.episode.thumbnail = `https://static.anroll.net/images/animes/screens/${i.episode.anime.slug_serie}/${i.episode.n_episodio}.jpg`);
catalog.forEach((i) => i.episode.anime.thumbnail = `https://static.anroll.net/images/animes/capas/${i.episode.anime.slug_serie}.jpg`);

return Response.json(catalog);
return Response.json({data: catalog});
}
6 changes: 1 addition & 5 deletions src/app/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ export default async function Home() {
const res = await fetch(`${protocol}://${host}/api/recentes/animes/anroll`);
const {data} = await res.json();

if (data?.data_releases.length > 0) {
return data.data_releases;
}

return null
return data;
}

const trending = await pegarTopicosAnimes();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Episode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Episode({ slug, episode_id, thumbnail, title, episode_nu
/>
<div className="absolute top-0 transition duration-300 group-hover:bg-black group-hover:bg-opacity-30 w-full h-full">
<div className="invisible transition duration-300 group-hover:visible">
<p className="text-white text-xl mx-auto mt-[22%]">Plau</p>
<p className="text-white text-xl text-center mx-auto mt-[22%]">Plau</p>
</div>
</div>
<div className="absolute w-full top-0 p-2 flex justify-between items-center">
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function Header() {
<NavbarContent className="hidden sm:flex gap-4" justify="end">
<NavbarItem>
<div>
<p onClick={irParaAnimeAleatorio} className="transition-colors text-xl cursor-pointer text-zinc-400 hover:text-white">Randomizar</p>
<p onClick={irParaAnimeAleatorio} className="transition-colors text-sm cursor-pointer text-zinc-400 hover:text-white">Randomizar</p>
</div>
</NavbarItem>
</NavbarContent>
Expand All @@ -121,7 +121,7 @@ export default function Header() {
<NavbarMenuItem>
<NavbarItem className="mb-3">
<div onClick={irParaAnimeAleatorio} className="cursor-pointer group flex items-center gap-2">
<p onClick={irParaAnimeAleatorio} className="transition-colors text-xl cursor-pointer text-zinc-400 hover:text-white">Randomizar</p>
<p onClick={irParaAnimeAleatorio} className="transition-colors text-sm cursor-pointer text-zinc-400 hover:text-white">Randomizar</p>
</div>
</NavbarItem>
</NavbarMenuItem>
Expand Down

0 comments on commit 5e8b0bf

Please sign in to comment.