Skip to content

Instantly share code, notes, and snippets.

@miguelcamposfernandes
Created October 17, 2021 20:43
Show Gist options
  • Save miguelcamposfernandes/b85f4a456a37fd4e4458f834cf55472b to your computer and use it in GitHub Desktop.
Save miguelcamposfernandes/b85f4a456a37fd4e4458f834cf55472b to your computer and use it in GitHub Desktop.
YTD - Download Form
{% extends 'layout.html' %}
{% block content %}
<form method="POST" action="{{ url_for('download_video') }}"> # Linking to a Python function we'll create next
<h3>{{ url.title }}</h5> # The video title
<select name="itag" aria-label="Default select example">
{% for i in url.streams.filter(progressive=True) %}
<option value="{{ i.itag }}"> {{ i.resolution }} </option> # Iterating through the qualities of the video.
{% endfor %}
</select>
<button type="submit">Download</button>
</form>
{% endblock content %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment