下面的代码在views.py中。我想在用户粘贴视频链接后从用户那里获取一个变量而不是'360p'。有没有办法展示如何从用户那里获得分辨率。我必须接受用户的输入。完整代码类似于以下网页 https://www.hexascholars.com/code-snippet/youtube-video-download-using-django-and-python/
def get_download(request):
if request.method == 'GET':
if(request.GET.get('url')):
url = request.GET['url']
try:
yt = YouTube(url)
title = yt.title
stream = yt.streams.filter(res='360p').first()
path = download_path()
stream.download(path)
message = "Download Complete!"
video = Video()```