|
|
|
@ -3,7 +3,7 @@ from flask import (Flask, render_template, flash, redirect,
|
|
|
|
|
from flask_bootstrap import Bootstrap
|
|
|
|
|
from flask_wtf import FlaskForm
|
|
|
|
|
from wtforms import DateTimeField, IntegerField, SubmitField
|
|
|
|
|
from wtforms.validators import DataRequired, NumberRange
|
|
|
|
|
from wtforms.validators import InputRequired, NumberRange
|
|
|
|
|
|
|
|
|
|
from datetime import datetime, timedelta
|
|
|
|
|
import os
|
|
|
|
@ -20,9 +20,9 @@ Bootstrap(app)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DownloadForm(FlaskForm):
|
|
|
|
|
start_time = DateTimeField('Start time', validators=[DataRequired()],
|
|
|
|
|
start_time = DateTimeField('Start time', validators=[InputRequired()],
|
|
|
|
|
format='%Y-%m-%d %H:%M')
|
|
|
|
|
length = IntegerField('Length', validators=[DataRequired(),
|
|
|
|
|
length = IntegerField('Length', validators=[InputRequired(),
|
|
|
|
|
NumberRange(min=1, max=app.config['MAX_LENGTH'])])
|
|
|
|
|
submit = SubmitField('Download')
|
|
|
|
|
|
|
|
|
|