Last active
May 1, 2020 08:51
-
-
Save ariankordi/0842e0d04d18e456cf90ee0d908a9155 to your computer and use it in GitHub Desktop.
please don't use this because it doesn't handle a lot of cases, my F*CK do not even think about incorporating this into your creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, textarea { | |
background-color: #3d3d3d; | |
color: white; | |
font-family: sans-serif; | |
} | |
textarea { | |
border-color: darkgray; | |
font-family: monospace; | |
display: block; | |
height: 100px; | |
width: 450px; | |
} | |
textarea[disabled] { | |
background-color: darkgray; | |
color: black; | |
height: 300px; | |
} | |
button { | |
margin-top: 5px; | |
margin-bottom: 5px; | |
} | |
@media only screen and (max-width: 500px) { | |
textarea { | |
width: 94vw; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// enable php errors because this code is stupid lol | |
ini_set('display_errors', true); | |
ini_set('html_errors', false); | |
?><!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<title>crunchyroll magic</title> | |
<link rel="stylesheet" href="cronch.css"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<meta property="og:title" content="crunchyroll free url f*ucking grab 69 420 free 2019 working 279000% tested"> | |
<meta property="og:site_name" content="orange.availabledns.com/~niggarsp/, y'know, the one!"> | |
<meta property="og:description" content="you give it urls to crunchyroll anime episodes (OR MULTIPLE!!!!!! actually you should put multiple in here because it's slow), and it gives you the direct url to the video, which you can view in safari or edge natively, or you can open it in vlc and boom there's the episode you wanted at max quality and no ads!!!!!!! wow!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! japanese audio, english hardsub and max resolution only though"> | |
<!-- drawing source https://danbooru.donmai.us/posts/3688968 --> | |
<meta property="og:image" content="//<?=$_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI'])?>/cronch.jpg"> | |
<link rel="icon" href="cronch.jpg"> | |
</head> | |
<body> | |
<h1>crunchyroll magic</h1> | |
<p>wow</p> | |
<p>ℹ selects jaJP audio, enUS hardsubs</p> | |
<form method="POST"> | |
<textarea name="urls" placeholder="input urls to crunchyroll videos here, line separated"><?php if(isset($_POST['urls'])) echo htmlspecialchars($_POST['urls']);?></textarea> | |
<button>go</button> | |
</form> | |
<textarea disabled placeholder="url results appear here"><?php | |
if($_SERVER['REQUEST_METHOD'] === 'POST') { | |
if(isset($_POST['urls'])) { | |
if($_POST['urls'] !== '' && !ctype_space($_POST['urls'])) { | |
// urls is not blank, start accessing the pages ig | |
$lines = explode("\n", $_POST['urls']); | |
// $lines now contains every url in an array so start iterating through it | |
foreach($lines as $lineNo => $url) { | |
// if line is blank or whitespace, skip it | |
if($url === '' || ctype_space($url)) { | |
// skip | |
continue; | |
} | |
// basic check to see if this url is a crunchyroll url | |
if(strpos($url, 'https://www.crunchyroll.com/') !== 0) { | |
?>BRUH ONE OF THE URLS (line <?=$lineNo + 1?>) IS NOT CRUNCHYROLL!!!!!!!!! or at least doesn't begin with "https://www.crunchyroll.com/"<?php | |
} else { | |
// if a url has been printed before, so if finalUrl is defined, then... | |
if(isset($finalUrl)) { | |
// two newlines are printed | |
?> <?php | |
} | |
// checks are done | |
// remove whitespace from this url | |
$urlWithoutWhitespaces = preg_replace('/\s/', '', $url); | |
// this used to use a public proxy but this is not necessary and sometimes causes a redirect | |
$pageContent = file_get_contents(/*'http://tclhosting.com/test/miniProxy.php?' . */$urlWithoutWhitespaces); | |
$splitPart1 = explode('hls","audio_lang":"jaJP","hardsub_lang":"enUS","url":"', $pageContent); | |
$splitPart2 = explode('"', $splitPart1[1])[0]; | |
$finalUrl = stripslashes($splitPart2); | |
// print final url with two carriage returns & newline html entities | |
echo $finalUrl; | |
// not a polished method, this just checks if the url is blank in the end and puts a warning on the page | |
if($finalUrl === '') { | |
?>oops!!<?php | |
} | |
// flush as an attempt to get the rest of the page to show at this point | |
flush(); | |
} | |
} | |
} else { | |
// in this case, urls are blank | |
?>urls are blank..... bruh<?php | |
} | |
} | |
} | |
?></textarea> | |
<p>also this is really dumb it has no idea about the crunchyroll page you're on so</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment