Skip to content

Instantly share code, notes, and snippets.

View oddoye-david's full-sized avatar

David Oddoye oddoye-david

  • Ghana
View GitHub Profile
function download(showname, season = 's01', quality = '720p', encoding = 'x265') {
const fileContent = Array.from(document.querySelectorAll('a'))
.filter(x => x.href.toLowerCase().includes(season))
.filter(x => x.href.toLowerCase().includes(quality))
.filter(x => x.href.toLowerCase().includes(encoding))
.map(y => y.href).join('\n')
console.log(fileContent)
const element = document.createElement('a');
element.setAttribute('href', `data:text/plain;charset=utf-8, ${encodeURIComponent(fileContent)}`);
element.setAttribute('download', `${showname.replace(/ /g, '-')}.txt`);