Advertisement
Thunder-Menu

batch_install_youtube-dl_from_repos.bat

Nov 7th, 2023 (edited)
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.49 KB | Source Code | 0 0
  1. :: Vérification de la présence de Python
  2. where python >nul 2>&1
  3. if %errorlevel% neq 0 (
  4.     :: Téléchargement du fichier d'installation de Python
  5.    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.python.org/ftp/python/3.9.7/python-3.9.7-amd64.exe', 'python-installer.exe')"
  6.  
  7.    :: Installation silencieuse de Python
  8.    python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
  9. )
  10.  
  11. :: Vérification si pip est installé
  12. where pip >nul 2>&1
  13. if %errorlevel% equ 0 (
  14.    echo pip est installé
  15. ) else (
  16.    echo pip n'est pas installé
  17.     echo install pip
  18. :: Télécharger get-pip.py
  19. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  20.  
  21. :: Télécharger get-pip.py via PowerShell
  22. powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'get-pip.py')"
  23.  
  24. :: Télécharger get-pip.py via BITSAdmin
  25. bitsadmin /transfer mydownload /download /priority normal https://bootstrap.pypa.io/get-pip.py %CD%\get-pip.py
  26.  
  27. :: Exécuter get-pip.py
  28. python get-pip.py
  29. )
  30.  
  31. :: Cloner le dépôt youtube-dl
  32. git clone https://github.com/ytdl-org/youtube-dl.git
  33. cd youtube-dl
  34. git checkout master
  35. git pull
  36. pip install youtube-dl
  37.  
  38. :: Installation de youtube-dl
  39. pip install --upgrade youtube-dl
  40.  
  41. :: Installation de PyInstaller
  42. pip install pyinstaller
  43.  
  44. :: Installer le package
  45. python setup.py install
  46.  
  47. :: Générer un exécutable avec PyInstaller
  48. pyinstaller --onefile youtube_dl/__main__.py
  49. pause
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement