Skip to content

Instantly share code, notes, and snippets.

@bagcivan
Last active June 13, 2023 20:59
Show Gist options
  • Save bagcivan/31279d0b64c6e5b3716981e45c8a1ab9 to your computer and use it in GitHub Desktop.
Save bagcivan/31279d0b64c6e5b3716981e45c8a1ab9 to your computer and use it in GitHub Desktop.
Youtube Altyazı alma
setTimeout(function() {
document.querySelector("#button-shape > button > yt-touch-feedback-shape > div > div.yt-spec-touch-feedback-shape__fill").click();
}, 2000);
setTimeout(function() {
document.querySelector("#items > ytd-menu-service-item-renderer:nth-child(5) > tp-yt-paper-item > yt-formatted-string").click();
}, 4000);
setTimeout(function() {
let elements = document.querySelectorAll('yt-formatted-string.segment-text');
let textArray = [];
elements.forEach(function(element) {
textArray.push(element.textContent);
});
let finalText = textArray.join(", ");
console.log(finalText);
}, 6000);
@bagcivan
Copy link
Author

javascript ile youtube sayfasında önce 3 noktaya daha sonra da transcripti göster butonuna ardından oluşturulan metni alıp birleştirir ve sonucu konsola yazar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment