forked from shashankatgit/YoutubeThumbnailMaximizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
31 lines (23 loc) · 804 Bytes
/
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
from flask import Flask
from flask import render_template
from flask import request
from flask import redirect
from flask import url_for
from url_processor import processURL
from url_processor import prepareURLfromVidID
app = Flask(__name__, static_url_path='/static')
@app.route("/")
def main():
return render_template('index.html')
@app.route('/submitLink', methods=['POST'])
def submitLink():
vidURL = request.form.get('vidURL')
videoID = processURL(vidURL, request.url_root);
return redirect(url_for('showLink', vidID=videoID))
@app.route('/showLink', methods=['GET'])
def showLink():
vidID=request.args.get('vidID')
shareableLink = prepareURLfromVidID(vidID, request.url_root);
return render_template('showLink.html', shareableURL = shareableLink)
if __name__=="__main__":
app.run()