Created
October 17, 2019 16:33
-
-
Save technoplato/47f63d15e2aa29693f713fcb3f08b2c0 to your computer and use it in GitHub Desktop.
YouTube Upload - AppleScript - Brute Force
This file contains hidden or 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
activate application "Safari Technology Preview" | |
tell application "Safari Technology Preview" | |
tell document 1 | |
set the URL to "https://youtube.com/upload" | |
delay 2 | |
do JavaScript "document.getElementById('start-upload-button-single').click()" | |
end tell | |
end tell | |
tell application "System Events" | |
keystroke "G" using {command down, shift down} | |
delay 1 | |
keystroke "~/Desktop/videos/" | |
delay 1 | |
keystroke return | |
delay 1 | |
key code 124 | |
delay 1 | |
keystroke "a" using {command down} | |
delay 1 | |
keystroke return | |
tell application "Safari Technology Preview" | |
tell document 1 | |
delay 2 | |
do JavaScript "document.getElementById('bulk-privacy-selector').click()" | |
delay 2 | |
do JavaScript "document.getElementsByClassName('bulk-set-privacy-unlisted')[0].click()" | |
delay 2 | |
do JavaScript "document.getElementsByClassName('expand-button-text).forEach(d => d.click())" | |
delay 2 | |
do JavaScript "[...document.getElementsByClassName('upload-item')].map(uploadItem => { | |
uploadItem.getElementsByClassName('expand-button-text')[0].click() | |
const titleNodes = uploadItem.getElementsByClassName('video-settings-title')[0].value | |
console.log(titleNodes) | |
const nodes = uploadItem.querySelector('.watch-page-link, a').childNodes | |
if (nodes.length > 1) { | |
console.log(nodes[1].text) | |
} | |
})" | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment