diff options
author | Jesús <heckyel@hyperbola.info> | 2019-05-25 17:08:06 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-05-25 17:08:06 -0500 |
commit | b0f2af18e572f316770a1c7c928933eb3f07b269 (patch) | |
tree | c5a1a64b5166571a37d09973891d9fc01449340f | |
parent | b41d19f8fdf2d6cc78e3d37cb45e03c1681e45f2 (diff) | |
download | ytlibre-b0f2af18e572f316770a1c7c928933eb3f07b269.tar.lz ytlibre-b0f2af18e572f316770a1c7c928933eb3f07b269.tar.xz ytlibre-b0f2af18e572f316770a1c7c928933eb3f07b269.zip |
Added 2 servers to extract JSON
-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 ); |