Skip to content

Instantly share code, notes, and snippets.

@seeya
Last active February 8, 2020 06:57
Show Gist options
  • Save seeya/00b5c8d731c9d2efd3e43ab3c26d0a45 to your computer and use it in GitHub Desktop.
Save seeya/00b5c8d731c9d2efd3e43ab3c26d0a45 to your computer and use it in GitHub Desktop.
Youtube Downloader using iOS Shortcuts + VLC
// Created by 0x6a
// Meant for iOS Shortcuts + VLC app
function download(link) {
let dl = document.createElement("div");
dl.className = 'dlbtn';
dl.style = "position: absolute; width: 100%;";
dl.innerHTML = "<a href='https://yt.frp.0x6a.bid/test?path=" + link + "' style='position: absolute; right: 22px; top: -40px; font-size: 14px; font-weight: bold; background-color: black; color: white; border-radius: 5px; padding:5px 15px 5px 15px;'>📥</a>";
return dl;
}
function search_download(link) {
let dl = document.createElement("div");
dl.className = 'dlbtn';
dl.innerHTML = "<a href='https://yt.frp.0x6a.bid/test?path=" + link + "' style='font-size: 14px; font-weight: bold; background-color: black; color: white; border-radius: 5px; padding: 5px 15px 5px 15px;'>📥</a>";
return dl;
}
function add_dl_btn() {
setInterval(function() {
document.querySelectorAll("ytm-large-media-item").forEach((child) => {
if(child.getElementsByClassName("dlbtn").length == 0) {
let link = child.getElementsByTagName("a")[0].href;
child.appendChild(download(link));
}
});
document.querySelectorAll(".compact-media-item-metadata").forEach((child) => {
if(child.getElementsByClassName("dlbtn").length == 0) {
let link = child.getElementsByTagName("a")[0].href;
child.appendChild(search_download(link))
}
});
}, 1000);
}
setTimeout(() => {
add_dl_btn();
completion(true);
}, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment