Add image resolution to title url
This commit is contained in:
parent
96ad2a323a
commit
568caa4434
12
ytcg.js
12
ytcg.js
@ -1,7 +1,13 @@
|
||||
function getCover()
|
||||
{
|
||||
var videoUrl = document.getElementById('videoUrl').value;
|
||||
var coverUrl = 'https://img.youtube.com/vi/' + YouTubeGetID(videoUrl) + '/maxresdefault.jpg';
|
||||
document.getElementById('ytImage').innerHTML =
|
||||
'<a download href="' + coverUrl + '"><img src="'+ coverUrl +'"></a>';
|
||||
var videoCover = new Image();
|
||||
|
||||
videoCover.onload = function()
|
||||
{
|
||||
document.getElementById('ytImage').innerHTML =
|
||||
'<a title="' + videoCover.width + 'x' + videoCover.height + '" download href="' + videoCover.src + '"><img src="'+ videoCover.src +'"></a>';
|
||||
}
|
||||
|
||||
videoCover.src = 'https://img.youtube.com/vi/' + YouTubeGetID(videoUrl) + '/maxresdefault.jpg';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user