diff options
Diffstat (limited to 'tools/processor.php')
-rw-r--r-- | tools/processor.php | 16 |
1 files changed, 15 insertions, 1 deletions
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 ); |