Created
July 22, 2021 09:45
-
-
Save Priler/3dab2608a345b5d11bfed78f600bfa0a to your computer and use it in GitHub Desktop.
Video download from YouTube with youtube-dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
import youtube_dl | |
def progress_hook(d): | |
if(d['status'] == "downloading"): | |
print(f'{d["_speed_str"]} ({d["_percent_str"]})') | |
else: | |
print("Готово!") | |
ydl_opts = { | |
'progress_hooks': [progress_hook] | |
} | |
link = input("Введите ссылку на видос: ") | |
with youtube_dl.YoutubeDL(ydl_opts) as ydl: | |
ydl.download([link]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍