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

Commit

Permalink
Code Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TechShreyash committed Nov 12, 2022
1 parent bcedcd8 commit 0341864
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 47 deletions.
11 changes: 3 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: ""
directory: "/"
schedule:
interval: "weekly"
interval: "weekly"
5 changes: 3 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
GOGO = GoGoApi()
app = Flask(__name__)


@app.errorhandler(404)
def error():
return 'Something went wrong...\n\n Probably Anilist Is Down. Report To https://t.me/techshreyash'
Expand Down Expand Up @@ -43,13 +44,13 @@ def home():
@app.route('/embed')
def get_embed():
url = request.args.get('url')
if url and '.m3u8' not in url:
return redirect(url)
if url:
if '.m3u8' in url or '.mp4' in url or '.mkv' in url:
file = url
else:
file = request.args.get('file')
if not file:
return redirect(url)
sub = request.args.get('sub')
title = request.args.get('title')
if sub != None:
Expand Down
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
GOGO = GoGoApi()
app = Flask(__name__)


@app.errorhandler(404)
def error():
return 'Something went wrong...\n\n Probably Anilist Is Down. Report To https://t.me/techshreyash'
Expand Down Expand Up @@ -43,13 +44,13 @@ def home():
@app.route('/embed')
def get_embed():
url = request.args.get('url')
if url and '.m3u8' not in url:
return redirect(url)
if url:
if '.m3u8' in url or '.mp4' in url or '.mkv' in url:
file = url
else:
file = request.args.get('file')
if not file:
return redirect(url)
sub = request.args.get('sub')
title = request.args.get('title')
if sub != None:
Expand Down Expand Up @@ -168,4 +169,4 @@ def search_anime():


if __name__ == '__main__':
app.run('0.0.0.0')
app.run('0.0.0.0')
24 changes: 12 additions & 12 deletions programs/html_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ def get_genre_html(li):
return html


def get_eps_html(anime,title,data=None):
def get_eps_html(anime, title, data=None):
if not data:
data = GoGoApi().get_episodes(GoGoApi().search(anime, True)[0])
x = """<a class="ep-btn" href="{}">{}</a>"""
html = ''
for i in range(1,data+1):
for i in range(1, data+1):
html += x.format(f'/episode/{title}/{str(i)}', str(i))
return html



ANIME_POS = """
<a href="{}"><div class="poster la-anime">
<div id="shadow1" class="shadow">
Expand Down Expand Up @@ -104,7 +103,8 @@ def get_trending_html():

return html

def get_search_html(data:Anime):

def get_search_html(data: Anime):
html = ''

for i in data:
Expand All @@ -129,7 +129,7 @@ def get_recent_html(data):

for i in data:
i: Anime

x = ANIME_POS.format(
i.url,
i.lang,
Expand Down Expand Up @@ -238,11 +238,11 @@ def slider_gen():


def episodeHtml(episode, title):
isSub =episode.get('SUB')
isDub =episode.get('DUB')
sub = dub = ''
defa =0
s,d=1,1
isSub = episode.get('SUB')
isDub = episode.get('DUB')
sub = dub = ''
defa = 0
s, d = 1, 1

if isSub:
for i in isSub:
Expand All @@ -256,7 +256,7 @@ def episodeHtml(episode, title):
<a class="sobtn" onclick="selectServer(this)" data-value="/embed?url={i}&title={title}">Server {s}</a>
</div>"""
s += 1

if isDub:
for i in isDub:
if defa == 0:
Expand All @@ -268,7 +268,7 @@ def episodeHtml(episode, title):
dub += f"""<div class="sitem">
<a class="sobtn" onclick="selectServer(this)" data-value="/embed?url={i}&title={title}">Server {d}</a>
</div>"""
d += 1
d += 1

if sub != '':
t4 = f"""<div class="server">
Expand Down
5 changes: 3 additions & 2 deletions programs/others.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_other_title(title):
other += tit + ', '
return tit[:-2]


def get_studios(stud):
tit = ''
for i in stud:
Expand All @@ -116,6 +117,6 @@ def get_genre(genres):
def get_urls(title):
return '/anime/' + str(requests.utils.quote(title))


def get_t_from_u(url):
return str(requests.utils.unquote(url)).replace('/anime/','')

return str(requests.utils.unquote(url)).replace('/anime/', '')
2 changes: 1 addition & 1 deletion programs/vidstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ def extract(link):
)
)

return j['source'][0]['file']
return j['source'][0]['file']
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ requests = "^2.28.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
gunicorn
requests
bs4
flask
cssselect
regex
yarl
pycryptodomex
24 changes: 16 additions & 8 deletions static/css/episode.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,31 @@ footer {
align-items: center;
height: 50px;
}
footer div{

footer div {
text-align: center
}

footer a {

color: white;
font-family: 'Montserrat', sans-serif;
font-size: 11px;
font-weight: 500;


}

@media only screen and (min-width: 400px) {
footer a {
font-size: 13px;
}
}

@media only screen and (min-width: 600px) {
footer a {
font-size: 15px;
}
}
@media only screen and (min-width: 400px) {footer a{
font-size: 13px;
}}
@media only screen and (min-width: 600px) {footer a{
font-size: 15px;
}}

#head-div {
background: linear-gradient(to right, #eb3349 40%, #f45c43);
Expand Down
2 changes: 1 addition & 1 deletion static/js/player.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions templates/episode.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
<meta property="og:site_name" content="AnimeDex">
<meta property="og:url" content="http://anime-dex1.vercel.app/">
<meta itemprop="image" content="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/home.png">
<meta property="og:image"
content="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/home.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/home.png">
<meta property="og:image:secure_url"
content="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/home.png">
<meta property="og:image:width" content="650">
Expand All @@ -45,7 +44,8 @@
<body>
<header id="head-div">
<div id="title1">
<a href="/"><img src="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/header.png" alt="AnimeDex"></a>
<a href="/"><img src="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/header.png"
alt="AnimeDex"></a>
</div>
<div id="search-div">
<form action="/search" method='GET'>
Expand Down
3 changes: 2 additions & 1 deletion templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
<body>
<header id="head-div">
<div id="title1">
<a href="/"><img src="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/header.png" alt="AnimeDex"></a>
<a href="/"><img src="https://cdn.jsdelivr.net/gh/TechShreyash/AnimeDex@main/static/img/header.png"
alt="AnimeDex"></a>
</div>
<div id="search-div">
<form action="/search" method='GET'>
Expand Down
5 changes: 3 additions & 2 deletions wsgi.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os, sys
from app import app
import os
import sys

sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

from app import app

if __name__ == "__main__":
app.run()

1 comment on commit 0341864

@vercel
Copy link

@vercel vercel bot commented on 0341864 Nov 12, 2022

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-dex1.vercel.app
anime-dex-techshreyash.vercel.app

Please sign in to comment.