From b0f2af18e572f316770a1c7c928933eb3f07b269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sat, 25 May 2019 17:08:06 -0500 Subject: Added 2 servers to extract JSON --- tools/processor.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/processor.php b/tools/processor.php index 5487fca..6b18f74 100644 --- a/tools/processor.php +++ b/tools/processor.php @@ -33,7 +33,21 @@ if ( $urlexists === TRUE ) { header( 'Location: index.php' ); } -$video_string = file_get_contents( "https://invidio.us/api/v1/videos/{$video_id}" ); +// servers JSON +$invidio0 = "https://invidio.us/api/v1/videos/{$video_id}"; +$invidio1 = "https://invidious.snopyta.org/api/v1/videos/{$video_id}"; + +$invidio0on = url_exists( $invidio0 ); +$invidio1on = url_exists( $invidio1 ); + +// check servers +if ( $invidio0on === TRUE ) { + $video_string = file_get_contents( $invidio0 ); +} elseif ( $invidio1on === TRUE ) { + $video_string = file_get_contents( $invidio1 ); +} else { + header( 'Location: index.php' ); +} $video_info = json_decode( $video_string ); -- cgit v1.2.3