def delete_own_video():
    """
    In GET request
        - Redirects to login page if not logged in.
        - If the uploader and current user are the same, it deletes the video.
        - Redirects to dashboard.
    """
    if request.method == 'GET':
        if 'user' not in session:
            return redirect(url_for('login_form'))
        is_admin = (requests.get(url='http://127.0.0.1:8080/is-admin/{}'.format(session['user'])).content).decode("utf-8") # Done
        if is_admin == "True":
            abort(403)
        d_error = request.args.get('d_error', False)
        video_ID = request.args.get('video_ID')
        title = ((requests.get('http://127.0.0.1:8080/title/{}'.format(video_ID))).content).decode("utf-8") # Done
        uploader = ((requests.get('http://127.0.0.1:8080/uploader/{}'.format(video_ID))).content).decode("utf-8") # Done
        if uploader == 'Error getting username':
            abort(404)
        username = session['user']
        if username != uploader:
            abort(403)
        else:
            video_delete_page = ((requests.get(url='http://127.0.0.1:8080/html/{}'.format('video_delete_confirmation.html'))).content).decode("utf-8")
            return render_template_string(video_delete_page, video_ID = video_ID, title = title, c_error = d_error)
    """
    In POST request
        - Accepts password from form.
        - Checks if the user is valid.
        - Deletes the video.
    """
    if request.method == 'POST':
        if 'user' not in session:
            abort(403)
        is_admin = (requests.get(url='http://127.0.0.1:8080/is-admin/{}'.format(session['user'])).content).decode("utf-8") # Done
        if is_admin == "True":
            abort(403)
        username = session['user']
        password = request.form['password']
        video_ID = request.form['video_ID']
        is_deleted = ((requests.post(url='http://127.0.0.1:8080/delete-video', data={'username' : username, 'password' : password, 'video_ID' : video_ID})).content).decode("utf-8") # Done
        if is_deleted == "True":
            return redirect(url_for('my_videos'))
        else:
            return redirect(url_for('delete_own_video', video_ID = video_ID, d_error = True))