Skip to content

Instantly share code, notes, and snippets.

@Deltachaos
Created April 24, 2012 21:16
Show Gist options
  • Save Deltachaos/2483888 to your computer and use it in GitHub Desktop.
Save Deltachaos/2483888 to your computer and use it in GitHub Desktop.
Translate a "18bla, you must login to see this video" Videolink into blupp viewable without login (http://yt18.natenom.name)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>yt18</title>
<style type="text/css">
body {
background-color: #abcdef;
overflow: hidden;
text-decoration: bold;
}
label,
input,
button,
select,
textarea {
font-size: 13px;
font-weight: normal;
line-height: 18px;
}
input,
button,
select,
textarea {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
label {
display: block;
margin-bottom: 5px;
color: #333333;
}
input,
textarea,
select,
.uneditable-input {
display: inline-block;
width: 530px;
height: 18px;
padding: 4px;
margin-bottom: 9px;
font-size: 13px;
line-height: 18px;
color: #555555;
background-color: #ffffff;
border: 1px solid #cccccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
input,
textarea {
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
color:#000;
}
input:focus,
textarea:focus {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
/* IE6-9 */
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
.centerContent {
text-align:center
}
.centerContent.background {
color: grey;
font-size:8pt;
width:20%;
border-top: 1px solid #fff;
margin:auto auto 50px auto;
}
#description {
text-align:center
}
button {
font-size: 20px;
font-weight: normal;
padding: 14px 24px;
margin-right: 10px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
background-color: #0074cc;
*background-color: #0055cc;
background-image: -ms-linear-gradient(top, #0088cc, #0055cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0055cc);
background-image: -o-linear-gradient(top, #0088cc, #0055cc);
background-image: -moz-linear-gradient(top, #0088cc, #0055cc);
background-image: linear-gradient(top, #0088cc, #0055cc);
background-repeat: repeat-x;
border-color: #0055cc #0055cc #003580;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
color:#fff
}
#dorewritecontainer {
margin-top:30px;
margin-bottom:30px;
}
#url {
color:#fff
}
</style>
</head>
<body>
<div class="centerContent">
<h1>YouTube 18</h1>
<div id="description">
<input id="urlinput" size="60" value="Paste Youtube Link/URL of censored Video" onfocus="this.value=''" />
<div id="dorewritecontainer">
<button id="dorewrite">Get uncensored URL</button>
</div>
</div>
<div id="rewrite" style="display:none;">
<a id="url" href=""></a>
</div>
<div id="retry" style="display:none;">
<button id="doretry">Reset</button>
</div>
</div>
<div class="centerContent background">
<p>Background:</p>
<p><a href="http://wiki.natenom.name/sammelsurium/youtube-filter">http://wiki.natenom.name/sammelsurium/youtube-filter</a></p>
<p>Technische Umsetzung:</p>
<p><a href="http://deltachaos.de">Deltachaos</a></p>
<p>Supervisor:</p>
<p><a href="http://natenom.name">Natenom</a></p>
</div>
</body>
<script src="./jquery-1.7.1.min.js"></script>
<script type="text/javascript">
</script>
<script>
var element = $('#urlinput');
var searchtext="Paste Youtube Link/URL of censored Video"
$("#dorewrite").click(function () {
var link = $(element).val();
var result = link.match(/^(?:(?:http|https)(?::\/\/))?(?:www\.)?(?:youtube\.com\/watch\?v=([^&]+)\&?|youtu.be\/([^&]+)|youtube\.com\/verify_age\?next_url=\/watch%3Fv%3D([^%]+)%?)/);
if(result === null) {
$(element).val('Bitte eine gültige URL eingeben!');
return;
}
result = result.slice(1);
for(i = 0; i < result.length; i++) {
if(result[i] !== undefined) {
var id = result[i];
}
}
var newlink="https://youtube.com/v/" + id;
var url = $(element).val();
$('#url').attr('href', newlink).text('URL for Video-ID: '+id);
$("#rewrite").show("fast");
$("#description").hide("fast");
$("#retry").show("fast");
$("#doretry").show("fast");
});
$("#doretry").click(function () {
$('#urlinput').val(searchtext);
$("#rewrite").hide("fast");
$("#description").show("fast");
$("#doretry").hide("fast");
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment