Last active
April 17, 2020 19:14
-
-
Save omridevk/4456b19b6cdd2aeebff5f3b39df79464 to your computer and use it in GitHub Desktop.
Download subtitles from addic7ed.com
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
((doc, timeout) => { | |
const $selectEnglish = doc | |
.querySelector('#langs') | |
.querySelector('td + td>input') | |
const selectAll = checkboxes => | |
checkboxes.forEach(checkbox => (checkbox.checked = true)) | |
const $download = doc.querySelector('input[value="Multi Download"') | |
$selectEnglish.checked = true | |
timeout(() => { | |
const $checkboxes = doc | |
.querySelector('#season') | |
.querySelector('table') | |
.querySelectorAll('input[type="checkbox"]') | |
if (!$checkboxes) { | |
alert("wrong site or couldn't find english subs") | |
return | |
} | |
selectAll($checkboxes) | |
const result = confirm( | |
'Click yes to continue or diselect if you want to select less than the 30 limit' | |
) | |
if (result) { | |
$download.click() | |
} | |
}, 500) | |
})(document, setTimeout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment