Compare commits
3 Commits
4e402d27a9
...
d90af65328
Author | SHA1 | Date |
---|---|---|
Boris Paing | d90af65328 | |
Boris Paing | 14429c84ad | |
Boris Paing | e2b3ab3983 |
|
@ -31,9 +31,9 @@ function changeEveryNSec ($n, $a) {
|
|||
}
|
||||
|
||||
$taglines = [
|
||||
'Votre caverne remplie des <strong>trésors</strong> que vous avez découverts sur le web.',
|
||||
'Votre <strong>forteresse</strong> de contenu imprenable>',
|
||||
'Votre <strong>palais</strong> informationnel.'
|
||||
'Votre caverne remplie des <strong>trésors</strong> que vous avez découverts sur le web',
|
||||
'Votre <strong>forteresse</strong> de contenu imprenable',
|
||||
'Votre <strong>palais</strong> informationnel'
|
||||
];
|
||||
|
||||
define('USP', changeEveryNSec(2, $taglines));
|
||||
|
|
|
@ -18,13 +18,16 @@
|
|||
|
||||
<form method="post" action="" class="add-video">
|
||||
<label for="youtube_url"l>Sauvegarder une vidéo Youtube :</label>
|
||||
<input type="text" name="youtube_url" placeholder="https://www.youtube.com/watch?v=ASywAfBAVrQ" size="45" />
|
||||
<input type="submit" value="Mon précieux !" />
|
||||
|
||||
<?php
|
||||
if (isset($_POST['youtube_url'])) {
|
||||
|
||||
?>
|
||||
if (!isset($_POST['youtube_url'])) {
|
||||
|
||||
$out = '';
|
||||
$placeholder = 'https://www.youtube.com/watch?v=ASywAfBAVrQ';
|
||||
|
||||
} else {
|
||||
|
||||
$out = '
|
||||
<p class="confirmation">Votre vidéo est en cours de téléchargement…</p>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
|
@ -32,14 +35,21 @@
|
|||
$.ajax({
|
||||
method: "POST",
|
||||
url: "youtube_add_video_aux.php",
|
||||
data: { youtube_url: "<?php echo $_POST['youtube_url']; ?>" }
|
||||
data: { youtube_url: "'. $_POST['youtube_url'] .'" }
|
||||
})
|
||||
.done(function( response ) {
|
||||
console.log(response);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
</script>';
|
||||
|
||||
$placeholder = htmlspecialchars($_POST['youtube_url']);
|
||||
}
|
||||
?>
|
||||
<input type="text" name="youtube_url" placeholder="<?php echo $placeholder; ?>" size="45" />
|
||||
<input type="submit" value="Mon précieux !" />
|
||||
|
||||
<?php
|
||||
echo $out;
|
||||
?>
|
||||
</form>
|
||||
</header>
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo chgrp -R www-data ~/.ipfs
|
||||
sudo chmod -R g+rw ~/.ipfs
|
|
@ -17,4 +17,6 @@ if (isset($_POST['youtube_url'])) {
|
|||
|
||||
exec("/bin/bash -c './ajouter_video_youtube.sh ". $youtube_url ."'", $output);
|
||||
|
||||
echo '<pre>'; print_r($output); echo '</pre>';
|
||||
$out = implode("\n", $output);
|
||||
|
||||
echo $out;
|
||||
|
|
|
@ -12,8 +12,8 @@ function astroport_urlencode ($str) {
|
|||
$videoURI = urldecode($_GET['uri']);
|
||||
list($a, $ipfsPath, $videoIPFS_ID, $videoFileName) = explode('/', $videoURI);
|
||||
$videoURL = 'http://'. HOST. '/' . urlencode($ipfsPath) . '/' . urlencode($videoIPFS_ID) . '/' . astroport_urlencode($videoFileName);
|
||||
$videoName = htmlentities(urldecode($_GET['name']));
|
||||
$videoMIME = htmlentities($_GET['mime']);
|
||||
$videoName = htmlspecialchars(urldecode($_GET['name']));
|
||||
$videoMIME = htmlspecialchars($_GET['mime']);
|
||||
|
||||
include('inc/header.php');
|
||||
|
||||
|
|
Loading…
Reference in New Issue