Created
September 14, 2018 01:48
-
-
Save cherenkov/8343c19aa23faa25d49917762f7d131f to your computer and use it in GitHub Desktop.
youtube再生リストの動画URL一覧を取得する
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
//力技ですが、URL一覧を取得する方法を考えてみました。 | |
//まず、このような自分が管理するプレイリストを編集する画面に移動する。 | |
// https://gyazo.com/5312815c46bcacd81dd0e1f4b05a1d41 | |
//動画数が100以上だと「もっと見る」とか押さないと隠れているかもしれないので、 | |
//同じ画面内に一度全部表示させてから、 | |
//ブラウザのコンソールを開いて下記のコードをコピペしてEnterすると画面の右下にURL一覧ができます。 | |
(function(){ | |
var ary = []; | |
document.querySelectorAll('.pl-video-title-link').forEach(function(e){ | |
var href = e.href; | |
console.log(href); | |
ary.push(href.replace(/&.+/,'')); | |
}) | |
var t = document.createElement('textarea'); | |
t.value = ary.join('\n'); | |
t.style = 'position:fixed;bottom:0;right:0;width:400px;height:200px;'; | |
document.body.appendChild(t); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment