Skip to content

Instantly share code, notes, and snippets.

@aoirint
Last active October 8, 2023 03:35
Show Gist options
  • Save aoirint/34690bb7243dc07bc63ada1f0e90b66e to your computer and use it in GitHub Desktop.
Save aoirint/34690bb7243dc07bc63ada1f0e90b66e to your computer and use it in GitHub Desktop.
YouTubeの投稿動画一覧(/videos OR /streams)から動画ID・タイトルをTSVとして抽出するDevTools用スクリプト(2023-10-08版)
// 最初に以下を実行
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