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