Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- print(''' __ __ ___
- /'__`\ /\ \ /\_ \
- ___ ___ _____ /\_\_\ \ \_\ \\\//\ \
- /' __` __`\/\ '__`\/_/_\_\_ /'_` \ \ \ \
- /\ \/\ \/\ \ \ \_\ \/\ \_\ \/\ \_\ \ \_\ \_
- \ \_\ \_\ \_\ \ ,__/\ \____/\ \___,_\/\____\
- \/_/\/_/\/_/\ \ \/ \/___/ \/__,_ /\/____/
- mp3dl \ \_\ youtube-dl wrapper script for
- \/_/ mp3 conversion.
- github.com/griimnak
- ''')
- mode = input('Choose mode: "music" or "video": ')
- url = None
- if mode == 'video':
- while True:
- url = input('[viddl] Paste YouTube, Twitter, Tiktok, Anime or Bitchute video url: ')
- os.system('yt-dlp --retries infinite --format "bestvideo+bestaudio[ext=m4a]/bestvideo+bestaudio/best" --merge-output-format mp4 "{}" --embed-thumbnail --postprocessor-args "-id3v2_version 3" -o videos/{}.%(ext)s'.format(url, time.time()))
- elif mode == 'music':
- while True:
- url = input('[mp3dl] Paste YouTube or Soundcloud url: ')
- os.system('yt-dlp --sleep-interval 1 -ciw --retries infinite -f bestaudio "{}" --extract-audio --audio-format mp3 --embed-thumbnail --postprocessor-args "-id3v2_version 3" -o music/%(title)s.%(ext)s'.format(url))
- else:
- exit('{} is not a valid mode, type "music" or "video"'.format(mode))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement