The first page should have a big square where people can drop their videos or ckick the button to choose them.
the text and the image on the first page should be centered
On the secoond one, at the top center it will show a percentage how much of video is uploaded.
then,the server takes three image blocks under the percentage, and turns in to 4:3 random screenshots from the uploaded video, the 4 block has a custom image, if you click on it, you can upload your image.
then, on the down, you can see a choose element
with 4 circles with 1234 of the images, and choose hich image to use. on the down right you can see a button that takes you to the third page.
third page has 2 text slots for the name of the video and for the description.
after that, there are circle choose with private, доступ по ссылке и публично.
в низу по центру кнопка Загрузить! :D
Все сделано на бутстрапе, и страницы должны продолжать base.html
# data/videos.py

import sqlalchemy
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Boolean
from sqlalchemy.orm import relationship
from data.db_session import SqlAlchemyBase
from sqlalchemy_serializer import SerializerMixin
from datetime import datetime

class Video(SqlAlchemyBase, SerializerMixin):
    __tablename__ = 'videos'

    id = Column(Integer, primary_key=True, unique=True, autoincrement=True, nullable=False)
    title = Column(String, nullable=False)
    author_id = Column(Integer, ForeignKey("users.id"), nullable=False)
    description = Column(String, nullable=False, default='')
    likes = Column(Integer, nullable=False, default=0)
    datetime = Column(DateTime, nullable=False, default=datetime.utcnow)
    comments_enabled = Column(Boolean, default=True)  # Новое поле
    privacy = Column(Integer, nullable=False, default=3)  # New field for privacy setting
    comments = relationship('Comment', back_populates='video', cascade='all, delete-orphan')
    author = relationship('User', back_populates='videos')
    views = sqlalchemy.Column(sqlalchemy.Integer, nullable=False, default=0)  # New field for view count
@app.route('/add_video', methods=['GET', 'POST'])
def add_video():
    if not current_user.is_authenticated:
        return forbidden('')  # Ensure you have a `forbidden` handler defined

    form = VideoForm()
    params = {
        'title': 'Добавление видео',
        'authenticated': current_user.is_authenticated,
        'current_user': current_user
    }

    if current_user.is_blocked:
        flash('Ваш аккаунт заблокирован и вы не можете загружать видео.', 'danger')
        return render_template('add_video.html', form=form, **params)

    if form.validate_on_submit():
        video_file = form.video.data
        preview_file = form.preview.data
        datetime_input = form.datetime.data  # Получаем выбранную дату

        # Установка даты загрузки
        video_datetime = datetime_input if datetime_input else datetime.utcnow()

        # Validate video file format
        if not video_file.filename.lower().endswith('.mp4'):
            flash('Данный формат видео не поддерживается. Пожалуйста, загрузите видео в формате mp4.', 'danger')
            return render_template('add_video.html', form=form, **params)

        # Validate preview image format
        if not preview_file.filename.lower().endswith('.jpg'):
            flash('Данный формат обложки не поддерживается. Пожалуйста, загрузите изображение в формате jpg.', 'danger')
            return render_template('add_video.html', form=form, **params)

        try:
            # Create a new Video object
            video = Video(
                title=form.title.data,
                description='<br>'.join(form.description.data.split('\n')),
                author_id=current_user.id,
                comments_enabled=form.comments_enabled.data,
                datetime=video_datetime  # Assuming your Video model has this field
            )
            db_sess.add(video)
            db_sess.commit()

            # Save uploaded files
            video_path = os.path.join('static/vid', f'{video.id}.mp4')
            preview_path = os.path.join('static/pre', f'{video.id}.jpg')
            video_file.save(video_path)
            preview_file.save(preview_path)

            flash('Видео успешно загружено!', 'success')
            return redirect('/')

        except Exception as e:
            db_sess.rollback()
            flash(f'Произошла ошибка при загрузке видео: {e}', 'danger')
            return render_template('add_video.html', form=form, **params)

    return render_template('add_video.html', form=form, **params)