Created
August 10, 2021 21:20
-
-
Save emsi/a7820e6a5d12116b6766c348f73e144c to your computer and use it in GitHub Desktop.
Pyto youtube downloader
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
# Download audio/video file using youtube_dl | |
# to a folder picked on first run (using bookmarks). | |
# Make sure to start it with "--fixup never". | |
# For exampe to download just original audio use | |
# Pyto Run Script with following arguments: | |
# -f 140 --fixup never $URL | |
from youtube_dl import main | |
import bookmarks | |
import background as bg | |
import os | |
import uuid | |
music = bookmarks.FolderBookmark("music") | |
os.chdir(music.path) | |
# use random task id so we can have multiple background downloads | |
with bg.BackgroundTask(None, str(uuid.uuid4())) as b: | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment