Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
AnimeDex v1.5
Browse files Browse the repository at this point in the history
Powered By TechZApi

Multiple download quality options in episode page
Video Player fixed
And many more other fixes and improvements
  • Loading branch information
TechShreyash committed Mar 8, 2023
1 parent 554d4dc commit 8911611
Show file tree
Hide file tree
Showing 19 changed files with 2,231 additions and 924 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

<p align="center" > <img alt="GitHub Forks" src="https://img.shields.io/github/forks/TechShreyash/AnimeDex?label=%F0%9F%8D%B4Forks&logoColor=blue&style=social"> <img alt="GitHub Repo Stars" src="https://img.shields.io/github/stars/TechShreyash/AnimeDex?label=%E2%AD%90%EF%B8%8FStars&logoColor=blue&style=social"> </p>

[![Better Uptime Badge](https://betteruptime.com/status-badges/v1/monitor/kqf5.svg)](https://betteruptime.com/?utm_source=status_badge)

<hr>

Expand All @@ -12,7 +11,17 @@
- Uses Anilist To Get Data
- And GoGo Anime For Episodes
- Can Be Deployed To Vercel.com And Repl.it OR Any Other Hosting Service
- Website : https://animedex.live
> Website : https://animedex.live
> Powered By TechZApi
<hr><br>

### ♻️ Get TechZApi

- Get from @TechZApiBot on Telegram | https://t.me/TechZApiBot
- Fill this in env or in config.py
- Facing a-ny issues let us know at https://t.me/TechZBots_Support

<hr><br>

Expand All @@ -21,20 +30,24 @@

- Click Below To Deploy On Vercel

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FTechShreyash%2FAnimeDex&project-name=anime-dex&repo-name=anime-dex&demo-title=AnimeDex&demo-description=Watch%20Animes%20Online%20For%20Free&demo-url=https%3A%2F%2Fanimedex.live%2F&demo-image=https%3A%2F%2Fgithub.com%2FTechShreyash%2FAnimeDex%2Fraw%2Fmain%2Fstatic%2Fhome.png)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FTechShreyash%2FAnimeDex&env=API_KEY&envDescription=Your%20TechZ%20Api%20Key%2C%20Get%20from%20%40TechZApiBot%20on%20Telegram%20&envLink=https%3A%2F%2Ft.me%2FTechZApiBot&project-name=animedex&repository-name=AnimeDex&demo-title=AnimeDex&demo-description=Watch%20Animes%20Online%20For%20Free&demo-url=animedex.live&demo-image=https%3A%2F%2Fgithub.com%2FTechShreyash%2FAnimeDex%2Fraw%2Fmain%2Fscreenshots%2Fhome.jpeg)

- Demo : https://anime-dex1.vercel.app

- Deploy To Repl.it

- Just Fork This Repl To Your Account : https://replit.com/@ShreyashDheemar/AnimeDex
- Fork This Repl To Your Account : https://replit.com/@ShreyashDheemar/AnimeDex

- Fill your TechZApi Key in config.py

- Demo : https://animedex.shreyashdheemar.repl.co

- Deploy On Server
- Install Requirements

```pip3 install -r requirements.txt```

- Fill you TechZApi Key in config.py
- Start The Website

```python3 main.py```
Expand Down
187 changes: 105 additions & 82 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from programs.anime_loader import get_GPage, get_html
from programs.db import update_views, update_watch
from programs.html_gen import (
animeRecHtml,
animeRecHtml2,
episodeHtml,
get_eps_html,
get_eps_html2,
Expand All @@ -15,11 +15,11 @@
from flask import Flask, render_template, request, redirect
from programs.anilist import Anilist
from programs.others import get_atitle, get_other_title, get_studios, get_t_from_u
from programs.gogo import GoGoApi
from programs.vidstream import extract_m3u8
from programs.techzapi import TechZApi
from config import API_KEY

GOGO = GoGoApi()
app = Flask(__name__)
TechZApi = TechZApi(API_KEY)


@app.route("/favicon.ico")
Expand All @@ -31,12 +31,9 @@ def favicon():

@app.route("/")
def home():
html = render_template("home.min.html")
div1 = get_trending_html()
try:
div2 = get_recent_html(GOGO.home())
except:
div2 = ""
html = render_template("home.html")
div1 = get_trending_html(TechZApi.top_animedex())
div2 = get_recent_html(TechZApi.gogo_latest())
sliders = slider_gen()

html = (
Expand All @@ -51,27 +48,46 @@ def home():
@app.route("/anime/<anime>")
def get_anime(anime):
try:
data = GOGO.anime(anime)
title = data[0]
synopsis = data[1]
names = data[2]
studios = data[3]
episodes = data[4]
genres = get_genre_html(data[5])
img = data[6]
dub = data[7]
season = data[8]
year = data[9]
typo = data[10]
status = data[11]
data = TechZApi.gogo_anime(anime)
TITLE = data.get("title")
IMG = data.get("img")
LANG = data.get("lang")
TYPE = data.get("type")
WATCHNOW = "/episode/" + data.get("id") + "/1"
OTHER = data.get("other name")
TOTAL = str(data.get("total_ep"))
YEAR = data.get("year")
STATUS = data.get("status")
STUDIO = "?"
GENERES = get_genre_html(data.get("genre").split(","))
SYNOPSIS = data.get("summary")

x = anime.lower()
if x.endswith("-dub"):
x = x[:-4]
if x.endswith("-sub"):
x = x[:-4]
x = get_t_from_u(x).replace("-", " ")
displayAnime = animeRecHtml(Anilist().get_recommendation(x))
ep_html, watch = get_eps_html(anime, anime)

try:
DISPLAY_ANIME = animeRecHtml(Anilist().get_recommendation(x))
except:
DISPLAY_ANIME = ""
EPISODES = get_eps_html(data=data.get("episodes"))

html = render_template(
"anime.html",
IMG=IMG,
TITLE=TITLE,
LANG=LANG,
TYPE=TYPE,
WATCHNOW=WATCHNOW,
OTHER=OTHER,
TOTAL=TOTAL,
YEAR=YEAR,
STATUS=STATUS,
STUDIO=STUDIO,
)
except:
anime = anime.lower()
if anime.endswith("-dub"):
Expand All @@ -81,47 +97,46 @@ def get_anime(anime):
anime = get_t_from_u(anime).replace("-", " ")
data = Anilist().anime(anime)

img = data.get("coverImage").get("medium").replace("small", "medium")
if not img:
img = data.get("bannerImage")
title = get_atitle(data.get("title"))
synopsis = data.get("description")
names = get_other_title(data.get("title"))
studios = get_studios(data.get("studios").get("nodes"))
episodes = str(data.get("episodes"))
genres = get_genre_html(data.get("genres"))
displayAnime = animeRecHtml(data.get("recommendations").get("edges"))
IMG = data.get("coverImage").get("medium").replace("small", "medium")
if not IMG:
IMG = data.get("bannerImage")
TITLE = get_atitle(data.get("title"))
SYNOPSIS = data.get("description")
OTHER = get_other_title(data.get("title"))
STUDIO = get_studios(data.get("studios").get("nodes"))
TOTAL = str(data.get("episodes"))
GENERES = get_genre_html(data.get("genres"))
DISPLAY_ANIME = animeRecHtml2(data.get("recommendations").get("edges"))

try:
ep_html, watch = get_eps_html(anime)
EPISODES, id = get_eps_html(api=TechZApi, anime=TITLE)
except:
ep_html, watch = "", "#"
dub = data.get("format")
season = data.get("season")
year = data.get("seasonYear")
typo = data.get("format")
status = data.get("status")

html = render_template(
"anime.min.html",
img=img,
title=title,
DUB=dub,
SEASON=season,
other=names,
studios=studios,
episodes=episodes,
year=year,
ATYPE=typo,
status=status,
animeURL=f"/anime/{anime}",
WATCHNOW=f"/episode/{watch}",
aid=anime,
)

html = html.replace("GENEROS", genres)
html = html.replace("EPISOS", ep_html)
html = html.replace("DISPLAY_ANIME", displayAnime)
html = html.replace("SYNOP", synopsis)
EPISODES, id = "", "#"

SEASON = str(data.get("season")) + " " + str(data.get("seasonYear"))
YEAR = data.get("seasonYear")
TYPE = data.get("format")
STATUS = data.get("status")
WATCHNOW = "/episode/" + id + "/1"

html = render_template(
"anime.html",
IMG=IMG,
TITLE=TITLE,
LANG=TYPE,
TYPE=SEASON,
WATCHNOW=WATCHNOW,
OTHER=OTHER,
TOTAL=TOTAL,
YEAR=YEAR,
STATUS=STATUS,
STUDIO=STUDIO,
)

html = html.replace("GENERES", GENERES)
html = html.replace("EPISODES", EPISODES)
html = html.replace("DISPLAY_ANIME", DISPLAY_ANIME)
html = html.replace("SYNOPSIS", SYNOPSIS)
update_views(anime)
return html

Expand All @@ -132,28 +147,29 @@ def get_episode(anime, episode):
episode = int(episode)

try:
total_eps, ep = GOGO.get_episodes(anime)
eps = GOGO.get_links(ep[episode - 1])
ep_list = get_eps_html2(ep)
data = TechZApi.gogo_episode(f"{anime}-episode-{episode}")
x = TechZApi.gogo_anime(anime)
total_eps = x.get("total_ep")
ep_list = x.get("episodes")
except:
search = GOGO.search(anime, True)
total_eps, ep = GOGO.get_episodes(search[0])
eps = GOGO.get_links(ep[episode - 1])
ep_list = get_eps_html2(ep)

aid = ep[episode - 1].split("-episode-")[0]
search = TechZApi.gogo_search(anime)[0]
anime = search.get("id")
total_eps = search.get("total_ep")
ep_list = search.get("episodes")
data = TechZApi.gogo_episode(f"{anime}-episode-{episode}")

ep_list = get_eps_html2(ep_list)
btn_html = get_selector_btns(f"/episode/{anime}/", int(episode), int(total_eps))
ep_html, iframe = episodeHtml(eps, f"{anime} - Episode {episode}")
ep_html, iframe = episodeHtml(data, f"{anime} - Episode {episode}")

temp = render_template(
"episode.min.html",
"episode.html",
title=f"{anime} - Episode {episode}",
heading=anime,
iframe=iframe,
)

update_watch(aid)
update_watch(anime)
return (
temp.replace("PROSLO", btn_html)
.replace("SERVER", ep_html)
Expand All @@ -170,9 +186,9 @@ def search_anime():
if anime.endswith("-sub"):
anime = anime[:-4]

html = render_template("search.min.html", aid=anime.replace("+", " "))
html = render_template("search.html", aid=anime.replace("+", " "))

data = GOGO.search(anime)
data = TechZApi.gogo_search(anime)
display = get_search_html(data)

html = html.replace("SEARCHED", display)
Expand All @@ -193,10 +209,17 @@ def get_embed():
url += f'&token={request.args.get("token")}'
if request.args.get("expires"):
url += f'&expires={request.args.get("expires")}'
file = extract_m3u8(url)

file = TechZApi.gogo_stream(url)
server = int(request.args.get("server"))
if server == 1:
file = file.get("source")[0].get("file")
elif server == 2:
file = file.get("source_bk")[0].get("file")
else:
file = request.args.get("file")
except:
except Exception as e:
print(e)
file = request.args.get("file")
if not file:
return redirect(url)
Expand All @@ -208,8 +231,8 @@ def get_embed():
@app.route("/api/latest/<page>")
def latest(page):
try:
data = get_GPage(page)
html = get_html(data)
data = TechZApi.gogo_latest(page)
html = get_recent_html(data)
return {"html": html}
except:
return {"html": ""}
13 changes: 13 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Your TechZ Api Key
# Get from @TechZApiBot on Telegram | https://t.me/TechZApiBot

from os import getenv


API_KEY = "Paste Your Key Here"

if not API_KEY or API_KEY == "Paste Your Key Here" or API_KEY == "":
API_KEY = getenv("API_KEY")

if not API_KEY:
raise Exception("Please add your TechZ Api Key in config.py file")
Loading

1 comment on commit 8911611

@vercel
Copy link

@vercel vercel bot commented on 8911611 Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anime-dex – ./

anime-dex-git-main-techshreyash.vercel.app
anime-dex-techshreyash.vercel.app
anime-dex1.vercel.app

Please sign in to comment.