-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
13 lines (12 loc) · 1.09 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<div id="msg"></div>
<input id="youtubeLink" value="https://youtu.be/3O1_3zBUKM8" /><br />
<button id="get">Get Thumbnail</button>
<script>
$(document).ready(function($) {
$("#get").click(function () {
var ytl = $( "#youtubeLink" ).val();
var yti = ytl.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
$("#msg").html( "<h1>YouTube Thumbnail</h1><p><img src=\"http://i3.ytimg.com/vi/" + yti[1] + "/maxresdefault.jpg\" class=\"image\" /></p><p><img src=\"http://i3.ytimg.com/vi/" + yti[1] + "/hqdefault.jpg\" class=\"image\" /></p><h2>Image URL:</h2><br /><input name=\"imageURL\" id=\"copyimageURL\" class=\"text\" size=\"70\" type=\"text\" value=\"http://i3.ytimg.com/vi/"+ yti[1] + "/maxresdefault.jpg\" onclick=\"this.select()\" readonly /><br /><input name=\"imageURL\" id=\"copyimageURL\" class=\"text\" size=\"70\" type=\"text\" value=\"http://i3.ytimg.com/vi/"+ yti[1] + "/hqdefault.jpg\" onclick=\"this.select()\" readonly /><p>Right/Ctrl Click the image to download. Highlight the URL above and copy to your clipboard.</p>" );
});
});
</script>