Esempio n. 1
0
def screen_it(movie_id):
    movie_repo = MovieRepository(get_db())
    movie = movie_repo.find_by_id(movie_id)
    if movie is None:
        flash('Requested movie not found')
        return redirect(request.url)

    return render_template('watch/index.html', movie=movie)
Esempio n. 2
0
def hsl_fragment(movie_id, file_name):
    movie_repo = MovieRepository(get_db())
    movie = movie_repo.find_by_id(movie_id)

    if movie is None:
        abort(404, "Movie could not be found")

    if movie.is_mp4:
        abort(404,
              "Could not find an HSL converted movie with the provided id")

    file_dir = os.path.join(current_app.config['HLS_DIR'], movie.blob_id)
    return send_from_directory(file_dir, file_name)
Esempio n. 3
0
def mp4_video(movie_id):
    movie_repo = MovieRepository(get_db())
    movie = movie_repo.find_by_id(movie_id)

    if movie is None:
        abort(404, "Movie could not be found")

    if not movie.is_mp4:
        abort(404, "Could not find an MP4 movie with the provided id")

    file_path = os.path.join(current_app.config['UPLOAD_FOLDER'],
                             movie.blob_id)
    start, end = get_range(request)
    return partial_response(file_path, start, end)
Esempio n. 4
0
def uploaded_movie(movie_id):
    movie_repo = MovieRepository(get_db())
    movie = movie_repo.find_by_id(movie_id)
    return render_template('upload/movie_uploaded.html', movie=movie)