Last active
October 8, 2023 03:35
-
-
Save aoirint/34690bb7243dc07bc63ada1f0e90b66e to your computer and use it in GitHub Desktop.
YouTubeの投稿動画一覧(/videos OR /streams)から動画ID・タイトルをTSVとして抽出するDevTools用スクリプト(2023-10-08版)
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
// 最初に以下を実行 | |
videoIdList = [] | |
rowList = [] | |
setInterval(() => { | |
for (let videoElement of [...document.querySelectorAll("#video-title-link")]) { | |
// if (videoElement.innerText.indexOf("MY KEYWORD") == -1) continue; | |
const videoId = new URL(videoElement.href).searchParams.get("v") | |
const videoTitle = videoElement.title | |
if (!videoIdList.includes(videoId)) { | |
videoIdList.push(videoId) | |
rowList.push([videoId, videoTitle].join("\t")) | |
} | |
} | |
}, 100) | |
// 適当なタイミングで以下を実行 | |
console.log(rowList.join("\n")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment