Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to build a simple website for Django2.2 to download youtube videos

Shulou Source: shulou.com Published: 2022-06-02 07:12:30 10月01日 Update

This article mainly explains "Django2.2 how to build a simple website to download youtube videos", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Django2.2 how to build a simple website to download youtube videos" bar!

The knowledge points designed in the tutorial include: routing (urls) / template (templates) / view (views), but not the model (models). The front end uses Bootstrap4, which involves navigation bars, forms and tables. The newly learned content is that youtube videos can be embedded directly into the web page. Video tutorial link Part1 https://www.youtube.com/watch?v=fYmFUVKMcVA&t=432sPart2https://www.youtube.com/watch?v=-GmIat6rWiw&t=13s corresponding to youtube

If you can't use youtube, you can watch it at bilibili. I moved the video to bilibili.

Part1 https://www.bilibili.com/video/BV19a4y1h7DgPart2https://www.bilibili.com/video/BV1GD4y1S7Zx

Encountered an error when using pytube

ImportError: cannot import name 'quote' from' pytube.compat'

Search for the corresponding solution found after reporting an error

Https://github.com/nficano/pytube/issues/591

Uninstall pytube and reinstall pytube3

The command used to uninstall pytube is

Pip uninstall pytube

Reinstall

Pip install pytube3

The code I repeated myself was put on my github.

Https://github.com/PunicagranatumL/Django2.2_Simple_Example

The final effect:

Home page:

Http://127.0.0.1:8000/youtube_download/ytb_main/

Download interface:

Http://127.0.0.1:8000/youtube_download/ytb_download/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DODj3GvXhA_M

Click Download to download and save the results directly in your computer's Downloads folder.

Here we learn a new knowledge point of python: list data to repeat, the code is:

List (dict.fromkeys (resolutions))

Resolutions is a list.

The code also uses global variables and local variables in global,python. Exactly how to use them is not clear yet.

Thank you for reading, the above is the content of "Django2.2 how to build a simple website to download youtube videos". After the study of this article, I believe you have a deeper understanding of how to build a simple website to download youtube videos on Django2.2, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Video simplicity website code content knowledge knowledge points learning variables tutorials global front-end methods commands that is local ideas situations effects data Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Tech Info Xiaomi NVidia Shulou Technology