Skip to content

Commit 4b1b248

Browse files
authored
update
1 parent 3d8f9b5 commit 4b1b248

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

youtube-info-extractor.html

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ <h2>Youtube video info extractor</h2>
2020
<table width="100%">
2121
<tr width="100%">
2222
<td width="40%">
23+
Your Youtube API Access Key: <input id="accesskey" type="text" size="50"> | <small><a target="_blank" href="https://developers.google.com/youtube/v3/getting-started" title="What, you thought I'll let you use mine? :)">Click here to get your Access Key</a></small><br>
2324
<h4>Enter YouTube Video URLs in the text box below,<br>one URL per line</h3>
2425

2526
<textarea id="search-txt" type="text" rows="20" cols="50">
@@ -29,7 +30,8 @@ <h4>Enter YouTube Video URLs in the text box below,<br>one URL per line</h3>
2930
<input id="search-btn" type="button" value="Fetch Video Information"> <small>give it a few secs</small>
3031
</td><td>
3132
Output: <br>
32-
<textarea id="output" rows="25" cols="80"></textarea>
33+
<textarea id="output" rows="20" cols="80"></textarea>
34+
<br> For youtube-dl:<br><input id="youtubedl" size="80" value="ytmp4"></>
3335
<script>
3436
/*
3537
* YouTube: Retrieve Title, and other info
@@ -40,6 +42,7 @@ <h4>Enter YouTube Video URLs in the text box below,<br>one URL per line</h3>
4042
//$(function() {
4143
$("#search-btn").on("click", function() {
4244
document.getElementById('output').value = '';
45+
document.getElementById('youtubedl').value = '';
4346
var array1 = document.getElementById('search-txt').value.split('\n');
4447
for (i=0; i< array1.length; i++) { // for loop cyling through each line of input text
4548
var line = array1[i];
@@ -54,7 +57,7 @@ <h4>Enter YouTube Video URLs in the text box below,<br>one URL per line</h3>
5457
continue;
5558
}
5659
$.getJSON("https://www.googleapis.com/youtube/v3/videos", {
57-
key: "AIzaSyB67EeMDNvqQqPqwVM-Jtqt8Pdpq-R9q4I",
60+
key: $('#accesskey').val(),
5861
part: "snippet,statistics",
5962
id: videoid
6063
}, function(data) {
@@ -63,6 +66,8 @@ <h4>Enter YouTube Video URLs in the text box below,<br>one URL per line</h3>
6366
} else {
6467
document.getElementById("output").value += "https://www.youtube.com/watch?v=" + data.items[0].id + "\n" + data.items[0].snippet.title + " -" + data.items[0].snippet.channelTitle + ", " + data.items[0].snippet.publishedAt.substr(0,10) + "\n\n" ;
6568
}
69+
70+
document.getElementById("youtubedl").value += " " + 'http://youtu.be/' + data.items[0].id;
6671

6772
/*
6873
other infos, from original script:

0 commit comments

Comments
 (0)