Browse Source

Revert "exp: probe content-type when generating preview to request a subrange of video files"

This reverts commit 0010c7e35142eaf14ce9007907bd7a1cc7ce9432.
Andrew Dolgov 4 months ago
parent
commit
534edf067d
1 changed files with 8 additions and 19 deletions
  1. 8 19
      backend.php

+ 8 - 19
backend.php

@@ -1088,30 +1088,19 @@
 
 			if (strpos($url, "//") === 0) $url = "https:" . $url;
 
-			$headers = @get_headers($url, true);
-
-			if (is_array($headers) && isset($headers['Content-Type'])) {
-				$resp_ctype = $headers['Content-Type'];
-
-				if (strpos($resp_ctype, 'video/') !== FALSE) {
-					$options['http']['header'][] = 'Range: bytes=0-250000';
-				}
-			} else {
-				$resp_ctype = "";
-			}
-
 			$ctx = stream_context_create($options);
 			$data = @file_get_contents($url, false, $ctx);
 
 			if ($data) {
-				if (!$resp_ctype) {
-					if (isset($http_response_header) && is_array($http_response_header)) {
-						foreach ($http_response_header as $header) {
-							if (strstr($header, ": ") !== FALSE) {
-								list ($key, $value) = explode(": ", $header);
 
-								if (strtolower($key) == 'content-type') $resp_ctype = $value;
-							}
+				$resp_ctype = "";
+
+				if (isset($http_response_header) && is_array($http_response_header)) {
+					foreach ($http_response_header as $header) {
+						if (strstr($header, ": ") !== FALSE) {
+							list ($key, $value) = explode(": ", $header);
+
+							if (strtolower($key) == 'content-type') $resp_ctype = $value;
 						}
 					}
 				}