-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.py
58 lines (49 loc) · 1.36 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
from sch import main_fun
from flask import Flask,send_file,current_app,request,jsonify
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
def home():
return "generic api services @garudadev.com"
@app.route('/getCategories')
def getCategories():
return jsonify(main_fun.getCategories())
@app.route('/searchChannel')
def searchChannel():
lang,cate=False,False
if ("lang" in request.args):
lang=request.args["lang"]
if ("cate" in request.args):
cate=request.args["cate"]
try:
return jsonify(main_fun.searchChannel(lang,cate))
except Exception as e:
print(str(e))
return "failed:invalid parameters or no parameters,<br>search /getCategories"
@app.route('/TodaySchedule')
def TodaySchedule():
channel=False
offset=0
if ("channel" in request.args):
channel=request.args["channel"]
return jsonify(main_fun.TodaySchedule(channel,offset))
@app.route('/Schedule')
def Schedule():
channel=False
offset=0
if ("channel" in request.args):
channel=request.args["channel"]
if ("offset" in request.args):
offset=request.args["offset"]
return jsonify(main_fun.TodaySchedule(channel,offset))
@app.route('/GetTodaysMovies')
def GetTodaysMovies():
lang=False
offset=0
if ("lang" in request.args):
lang=request.args["lang"]
if ("offset" in request.args):
offset=request.args["offset"]
return main_fun.GetTodaysMovies(lang,offset)
#app.run()