diff --git a/README.md b/README.md index e69de29..7334ce7 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,3 @@ +# Script generici + +Raccolta di script generici in vari linguaggi. \ No newline at end of file diff --git a/invidious-redirect.php b/invidious-redirect.php new file mode 100644 index 0000000..f5bf9d1 --- /dev/null +++ b/invidious-redirect.php @@ -0,0 +1,41 @@ + $istanza) { + if ($istanza[1]['type'] == 'https') { + $istanze_per_tipo[] = $istanza[0]; + } + } + + // selezione lista casuale + $indirizzo_casuale = $istanze_per_tipo[ rand(0, count($istanze_per_tipo)-1) ]; + + header('Location: https://'.$indirizzo_casuale); + exit(); +} + +// Se il JSON non è valido o il server non risponde...?? +else { + exit(); +} + + +// Funzione per la verifica del formato JSON +function isJson($string) { + json_decode($string); + return json_last_error() === JSON_ERROR_NONE; +} \ No newline at end of file