-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
63 lines (56 loc) · 2.13 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from flask import Flask,request,url_for,redirect,render_template
from flask_cors import CORS
from yudhaLIB._bypasser import yudhaLIB
from yudhaLIB._fansublaler import _fansublaler
from yudhaLIB._pencarian import _pencarian
import re
app=Flask(__name__)
CORS(app)
@app.route('/',methods=['GET','POST'])
def index():
return render_template('index.html')
@app.route('/api',methods=['GET','POST'])
def api():
if request.args.get('fansub'):
kueri=request.args.get('kueri')
fansub=request.args.get('fansub')
if fansub=='oploverz':
return _pencarian(fansub,kueri)
if fansub=='samehadaku':
return _pencarian(fansub,kueri)
if fansub=='awsubs':
return _pencarian(fansub,kueri)
if fansub=='anitoki':
return _pencarian(fansub,kueri)
if request.args.get('redirect'):
res=yudhaLIB(request.args.get('redirect'))
return redirect(res)
if request.args.get('mode'):
if request.args.get('mode')=='bypass':
try:
url=request.args.get('url')
if re.search(r"oploverz",str(url)):
res=_fansublaler('oploverz',request.args.get('url'))
return str(res)
if re.search(r"samehadaku",str(url)):
res=_fansublaler('samehadaku',request.args.get('url'))
return str(res)
if re.search(r"awsubs",str(url)):
res=_fansublaler('awsubs',request.args.get('url'))
return str(res)
if re.search(r"anitoki",str(url)):
res=_fansublaler('anitoki',request.args.get('url'))
return str(res)
else:
return 'error'
except Exception as r:
return str(r)
if request.args.get('mode')=='kueri':
q=request.args.get('q')
return str(q)
else:
return 'API v1.5.0 FansubLALER'
else:
return 'API v1.5.0 FansubLALER'
if __name__=='__main__':
app.run(debug=True)