Created
December 26, 2020 05:36
-
-
Save xziyue/83e4770fdca96cd83f2801ef1d2db8f5 to your computer and use it in GitHub Desktop.
enter groovy music list into Discord
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
import time | |
from pynput.keyboard import Key, Controller | |
import pyperclip | |
import json | |
with open('crawl_list.json', 'r') as infile: | |
song_list = json.load(infile) | |
kb = Controller() | |
input('press enter and focus on Discord input box\nthe script will start in 3 seconds') | |
time.sleep(3) | |
for song in song_list: | |
pyperclip.copy('-play {}'.format(song['url'])) | |
kb.press(Key.ctrl) | |
kb.press('v') | |
kb.release('v') | |
kb.release(Key.ctrl) | |
kb.press(Key.enter) | |
kb.release(Key.enter) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment