aboutsummaryrefslogtreecommitdiffstats
path: root/tools/processor.php
diff options
context:
space:
mode:
Diffstat (limited to 'tools/processor.php')
-rw-r--r--tools/processor.php114
1 files changed, 14 insertions, 100 deletions
diff --git a/tools/processor.php b/tools/processor.php
index c3afdd1..a490d32 100644
--- a/tools/processor.php
+++ b/tools/processor.php
@@ -1,11 +1,6 @@
<?php
require_once "init.php";
-$instance = [
- "snopyta" => "https://invidious.snopyta.org",
- "glie" => "https://invidious.glie.town",
-];
-
if ( empty( $_GET['link'] ) ){
header( 'Location: index.php' );
}
@@ -23,6 +18,7 @@ if ( $urlexists === TRUE ) {
invidiou[.]sh|
invidious[.]kabi[.]tk|
invidious[.]glie[.]town|
+ invidious[.]zapashcanon[.]fr|
yotter[.]conocimientoslibres[.]ga|
invidious[.]snopyta[.]org)) # URL supports
(\/(?:[\w\-]+\?v=|embed\/|v\/)?) # Parameters (embed, v)
@@ -40,104 +36,22 @@ if ( $urlexists === TRUE ) {
header( 'Location: index.php' );
}
-// servers JSON
-$invidio0 = "{$instance['snopyta']}/api/v1/videos/{$video_id}";
-$invidio1 = "{$instance['glie']}/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 );
-
-$videoTitle = $video_info->title;
-$videoAuthor = $video_info->author;
-$videoDurationSecs = $video_info->lengthSeconds;
-$videoDuration = secToDuration( $videoDurationSecs );
-$videoChannel = $video_info->authorId;
-
-// Begin_ViewCount
-$extract_video_view = $video_info->viewCount;
-$videoViews = bytes( $extract_video_view );
-// End_ViewCount
-
-// change hqdefault.jpg to default.jpg for downgrading the thumbnail quality
-$videoThumbURL = "https://i1.ytimg.com/vi/{$video_id}/hqdefault.jpg";
-$librethumb = $video_info->videoThumbnails[0]->url;
-
-// Extract videos from JSON
-$streamFormats = $video_info->formatStreams;
-
-// Downloads
-$downloads = $video_info->formatStreams;
+// Core API
+require_once "extract.php";
-// Live
-$islive = $video_info->liveNow;
+$videoTitle=$vidtitle;
+$videoThumbURL = "https://i.ytimg.com/vi/{$video_id}/hqdefault.jpg";
+$videoDuration = secToDuration($vidtime);
+$videoViews = bytes( $vidviewCount );
+$islive = $vidisLiveContent;
-///// Beaking DRM!!!
-// Check standar video into URL
-if ( $islive === FALSE ) {
- $url_standar = $streamFormats[0]->url;
+if (!empty($vdef)) {
+ $streamFormats = $vdef;
} else {
- $url_standar = FALSE;
+ $streamFormats = $vid;
}
-if ( $url_standar === FALSE ) {
- // nodes
- $node0 = "{$instance['snopyta']}/latest_version?id={$video_id}&itag=18&local=true";
- $node1 = "{$instance['glie']}/latest_version?id={$video_id}&itag=18&local=true";
-
- // explain DRM
- $drmv = "https://archive.org/download/libreweb/rms-drm.webm";
-
- $node0on = video_exists( $node0 );
- $node1on = video_exists( $node1 );
-
- // check nodes
- if ( $node0on === TRUE ) {
- $breakurl = $node0;
- } elseif ( $node1on === TRUE ) {
- $breakurl = $node1;
- } else {
- $breakurl = $drmv;
- $formatdrm = 'video/webm';
- }
-
- // format video DRM
- if ( $islive === FALSE ) {
- $formatdrm = $streamFormats[0]->type;
- $breakquality = trim( $streamFormats[0]->resolution, 'p' );
- $downloadQuality = $streamFormats[0]->resolution;
- $downloadFormat = $downloads[0]->container;
- } else {
- $formatdrm = NULL;
- $breakquality = NULL;
- $downloadQuality = NULL;
- $downloadFormat = NULL;
- }
-
- $breaklink = TRUE;
- $downloadbreak = TRUE;
-
-} else {
- // clean variables
- $breakurl = NULL;
- $breaklink = NULL;
- $breakquality = NULL;
- $downloadbreak = NULL;
- $downloadFormat = NULL;
- $downloadQuality = NULL;
- $formatdrm = NULL;
-}
-///// End Beaking DRM!!!
+$videoAuthor = $vidauthor;
/* ---- ---- Generated URL and embed ---- ---- */
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {
@@ -151,5 +65,5 @@ $subject = $pro."://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
// Local URL
$local_url = preg_replace( '/index.php/', '', $subject );
-/* ---- ---- Change to Freedom URL ---- ---- */
-$url_freedom = "{$instance['snopyta']}/watch?v={$video_id}";
+/* ---- ---- URL Query ---- ---- */
+$url_query = "{$baselink}";