/youtube-video-downloader

This script downloads YouTube videos and saves them to the current directory.

Primary LanguagePython

How the script works...

This script allows users to download YouTube videos and save them to the current directory where the script is located. The script uses the pytube library to retrieve information about the video, including its title and the URL of the highest resolution version. The requests library is then used to download the video in chunks, and the tqdm library is used to display the progress of the download. This script can be useful for saving YouTube videos for offline viewing or for saving a copy of a video that may be removed from YouTube in the future.

Prerequisites Before running the script, you must install the following modules:

  • 'pytube'
  • 'requests'
  • 'tqdm'

You can install these modules using pip, the Python package manager. For example, to install pytube, you can use the following command:

pip install pytube

How to run the script:

  1. Open the Windows console.
  2. Navigate to the directory where the script is located.
  3. Run the script using the python command, followed by the name of the script file. For example:

python main.py

Next, you will enter the YouTube link and press "Enter" to confirm.


Wie das Skript funktioniert...

Dieses Skript ermöglicht es Benutzern, YouTube-Videos herunterzuladen und im aktuellen Verzeichnis zu speichern, in dem sich das Skript befindet. Das Skript verwendet die Bibliothek pytube, um Informationen über das Video abzurufen, einschließlich seines Titels und der URL der höchsten Auflösungsversion. Die Bibliothek requests wird dann verwendet, um das Video in Chunks herunterzuladen, und die Bibliothek tqdm wird verwendet, um den Fortschritt des Downloads anzuzeigen. Dieses Skript kann nützlich sein, um YouTube-Videos zum Offline-Ansehen zu speichern oder um eine Kopie eines Videos zu speichern, das möglicherweise in Zukunft von YouTube entfernt wird.

Vorraussetzungen Bevor Sie das Skript ausführen, müssen Sie die folgenden Module installieren:

  • 'pytube'
  • 'requests'
  • 'tqdm'

Sie können diese Module mithilfe von pip, dem Python-Paketmanager, installieren. Um zum Beispiel pytube zu installieren, können Sie den folgenden Befehl verwenden:

pip install pytube

Wie das Skript ausgeführt wird:

  1. Öffnen Sie die Windows-Konsole.
  2. Navigieren Sie zum Verzeichnis, in dem sich das Skript befindet.
  3. Führen Sie das Skript mit dem Befehl python aus, gefolgt vom Namen der Script Datei:

python main.py

Anschließend geben Sie den youtubelink ein und bestätigen mit "Enter".