Skip to content

Instantly share code, notes, and snippets.

@matejmajny
Last active December 28, 2022 10:48
Show Gist options
  • Save matejmajny/eb46225e7e49d1b9ef14baf3eade7f04 to your computer and use it in GitHub Desktop.
Save matejmajny/eb46225e7e49d1b9ef14baf3eade7f04 to your computer and use it in GitHub Desktop.
small tool for downloading stuff to my vps file manager
import os
link = input("Link: ")
os.chdir("/var/www/simple-file-manager/yt-videos")
link = link.split("/")[2]
if link == "www.youtu.be" or link == "www.youtube.com":
os.system("yt-dlp -f 'bestvideo[height<=1080]+bestaudio/best[height<=1080]' -S res,ext:mp4:m4a --recode mp4 " + link)
else:
os.system("wget " + link)
print("Done!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment