This commit is contained in:
2021-02-21 00:11:16 +03:00
parent 70f5d477bd
commit 16db9bb108
4 changed files with 2 additions and 2 deletions
+36
View File
@@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<!--
/_ ... _ /_
/_//_/ ////_//_//_//\
_/ _//
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>YTCget</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="icon" href="//youtube.com/yts/img/favicon_32-vflOogEID.png" sizes="32x32">
<link rel="icon" href="//youtube.com/yts/img/favicon_48-vflVjB_Qk.png" sizes="48x48">
<link rel="icon" href="//youtube.com/yts/img/favicon_96-vflW9Ec0w.png" sizes="96x96">
<link rel="icon" href="//youtube.com/yts/img/favicon_144-vfliLAfaB.png" sizes="144x144">
<script src="youtubeID.js?v=1"></script>
<script src="ytcg.js?v=1"></script>
</head>
<body>
<div class="header">
<div class="wrap">
<form action="JavaScript:getCover()">
<input type="text" id="videoUrl" placeholder="YouTube video url" onchange="getCover()"><!--
--><button type="submit">Search</button>
</form>
</div>
</div>
<div class="content">
<div class="wrap" id="ytImage">
</div>
<p>Thanks: <a href="https://github.com/takien">@takien</a> for youtubeID.js script.<br>
<a href="https://github.com/iiiypuk/YTCget">View on GitHub</a></p>
</div>
</body>
</html>
+79
View File
@@ -0,0 +1,79 @@
@import url('https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic');
* {
padding: 0; margin: 0; outline: 0;
font-family: "Roboto";
font-size: 1.1rem;
}
body {
background-color: #121212;
}
div.wrap {
max-width: 800px;
margin: 0 auto;
}
div.header {
background-color: #232323;
padding: 16px;
}
div.content {
margin-top: 10px;
}
div.content img {
border: 1px solid #808080;
max-width: 100%;
border-radius: 8px;
}
div.content p {
color: #808080;
text-align: center;
}
div.content a {
color: #ffffff;
text-decoration: none;
}
input, button {
box-sizing: border-box;
border: 1px solid #121212;
background-color: #232323;
font-size: 1rem;
padding: 8px;
transition: 250ms all;
}
input {
width: calc(100% - 100px);
color: #808080;
border-radius: 8px 0 0 8px;
}
input::placeholder {
color: #818181;
transition: 250ms all;
}
input:focus {
background-color: #606060;
color: #ffffff;
transition: 250ms all;
}
button {
background-color: #343434;
color: #606060;
border-left: 0;
width: 100px;
border-radius: 0 8px 8px 0;
}
button:hover {
color: #808080;
color: #ffffff;
transition: 250ms all;
}
button:active {
background-color: #606060;
}
+35
View File
@@ -0,0 +1,35 @@
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
if(url[2] !== undefined) {
ID = url[2].split(/[^0-9a-z_\-]/i);
ID = ID[0];
}
else {
ID = url;
}
return ID;
}
/*
* Tested URLs:
var url = 'http://youtube.googleapis.com/v/4e_kz79tjb8?version=3';
url = 'https://www.youtube.com/watch?feature=g-vrec&v=Y1xs_xPb46M';
url = 'http://www.youtube.com/watch?feature=player_embedded&v=Ab25nviakcw#';
url = 'http://youtu.be/Ab25nviakcw';
url = 'http://www.youtube.com/watch?v=Ab25nviakcw';
url = '<iframe width="420" height="315" src="http://www.youtube.com/embed/Ab25nviakcw" frameborder="0" allowfullscreen></iframe>';
url = '<object width="420" height="315"><param name="movie" value="http://www.youtube-nocookie.com/v/Ab25nviakcw?version=3&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/Ab25nviakcw?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
url = 'http://i1.ytimg.com/vi/Ab25nviakcw/default.jpg';
url = 'https://www.youtube.com/watch?v=BGL22PTIOAM&feature=g-all-xit';
url = 'BGL22PTIOAM';
*/
+13
View File
@@ -0,0 +1,13 @@
function getCover()
{
var videoUrl = document.getElementById('videoUrl').value;
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';
}