From 286ff7a80e8d7fea398b78978c591aeee785f4b0 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Thu, 4 Oct 2018 17:55:10 +0200 Subject: [PATCH] - Add Gb to unit, - Add lmb_news_json_ld() function, - Now track video codec in video, - Add multiple resulution support to video. --- html/lmbrowse.php | 91 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 16 deletions(-) diff --git a/html/lmbrowse.php b/html/lmbrowse.php index 8660222..8a9f295 100644 --- a/html/lmbrowse.php +++ b/html/lmbrowse.php @@ -1,13 +1,13 @@ 1024; $i++) @@ -981,6 +982,53 @@ function lmb_news_tab_get( ) +/*--------------------------------------------------------------------------------------------------------------------*/ +/* News JSON-LD */ +/*--------------------------------------------------------------------------------------------------------------------*/ + +function lmb_news_json_ld( $news_tab) +{ + global $lmb_url_post; + + + for( $i=0; $i < count($news_tab); $i++) + { + + echo " +"; + + } +} + + /*--------------------------------------------------------------------------------------------------------------------*/ /* News Tab */ /*--------------------------------------------------------------------------------------------------------------------*/ @@ -992,6 +1040,8 @@ function lmb_news_tab( $skin_path) $news_tab = lmb_news_tab_get(); + lmb_news_json_ld( $news_tab); + ob_start(); for( $i=0; $i < count($news_tab); $i++) @@ -2333,9 +2383,9 @@ function lmb_video_file_tab_get( $play_type, $play_id, $play_priority, $video_id { if( $mode == "MULTI") { - $file_tab[$i]["url"] = "{$lmb_url_post}?page=download&type={$play_type}&id={$play_id}&priority={$play_priority}&dtype=video&vformat={$video_format}"; + $file_tab[$i]["url"] = "{$lmb_url_post}?page=download&type={$play_type}&id={$play_id}&priority={$play_priority}&dtype=video&vformat={$video_format}.{$video_codec}"; - $file_size = lmb_download_videos( $play_type, $play_id, $play_priority, $video_format, "SIZE"); + $file_size = lmb_download_videos( $play_type, $play_id, $play_priority, "{$video_format}.{$video_codec}", "SIZE"); $size_tab = lmb_size_convert( $file_size); } else @@ -2416,7 +2466,7 @@ function lmb_videolist( $play_type, $play_id, $play_priority, $skin_path) ob_start(); - $cmd="ls {$video_path}/* | sed -e 's/.*\.//' | grep -v \"png\" | sort -ru"; + $cmd="ls {$video_path}/* | sed -e 's/.*\.//' | grep -v \"png\" | sort -u"; exec($cmd, $codec_tab); if( count( $codec_tab) == 0 || ( file_exists( "{$video_path}/.hide" ) && ! lmb_admin_is())) @@ -3490,6 +3540,7 @@ function lmb_track_video( $play_type, $play_id, $play_priority, $track_id, $trac $video_res_cookie = "video_res"; $prefix_url = "{$lmb_url_post}?cookie_id={$video_res_cookie}&cookie_value="; $query_string = preg_replace( "/cookie_id={$video_res_cookie}&cookie_value=[^&]*&/", "", "{$_SERVER['QUERY_STRING']}"); + $video_res_1440p_url = htmlentities( "{$prefix_url}1440p&{$query_string}"); $video_res_1080p_url = htmlentities( "{$prefix_url}1080p&{$query_string}"); $video_res_720p_url = htmlentities( "{$prefix_url}720p&{$query_string}"); $video_res_360p_url = htmlentities( "{$prefix_url}360p&{$query_string}"); @@ -3498,15 +3549,21 @@ function lmb_track_video( $play_type, $play_id, $play_priority, $track_id, $trac $video_res_tab = array(); - if( "{$video_res}" == "") - { - $video_res = "1080p"; - } - switch("{$video_res}") { + case "1440p": + { + $video_res_1440p_class = "link-item-disabled"; + $video_res_1080p_class = "link-item"; + $video_res_720p_class = "link-item"; + $video_res_360p_class = "link-item"; + + break; + } + case "1080p": { + $video_res_1440p_class = "link-item"; $video_res_1080p_class = "link-item-disabled"; $video_res_720p_class = "link-item"; $video_res_360p_class = "link-item"; @@ -3516,6 +3573,7 @@ function lmb_track_video( $play_type, $play_id, $play_priority, $track_id, $trac case "720p": { + $video_res_1440p_class = "link-item"; $video_res_1080p_class = "link-item"; $video_res_720p_class = "link-item-disabled"; $video_res_360p_class = "link-item"; @@ -3525,6 +3583,7 @@ function lmb_track_video( $play_type, $play_id, $play_priority, $track_id, $trac case "360p": { + $video_res_1440p_class = "link-item"; $video_res_1080p_class = "link-item"; $video_res_720p_class = "link-item"; $video_res_360p_class = "link-item-disabled"; @@ -3573,7 +3632,7 @@ Your browser does not support the video tag. -
1080p 720p 360p
+
1440p 1080p 720p 360p
@@ -3883,7 +3942,7 @@ function lmb_download_covers( $play_type, $play_id, $play_priority, $cover_forma function lmb_download_videos( $play_type, $play_id, $play_priority, $video_format, $mode) { $play_dir = lmb_play_path_get( $play_type, $play_id, $play_priority); - $file_list = "videos/*-{$video_format}.mp4"; + $file_list = "videos/*-{$video_format}"; return( lmb_download_file( $play_dir, $file_list, $mode, "{$play_id}-{$video_format}")); }