forked from axiom-team/astrXbian
Merge pull request '[FIX] Improvement of duplicate content detection and handling' (#36) from BorisPaing/astrXbian_UX-et-webUI:boris into master
Reviewed-on: axiom-team/astrXbian#36
This commit is contained in:
commit
4552f89d93
|
@ -228,3 +228,15 @@ function canReadVideoFormat ($mimeType) {
|
||||||
|
|
||||||
return ($mimeType == 'video/mp4');
|
return ($mimeType == 'video/mp4');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function in_array_column($text, $column, $array)
|
||||||
|
{
|
||||||
|
if (!empty($array) && is_array($array))
|
||||||
|
{
|
||||||
|
for ($i=0; $i < count($array); $i++)
|
||||||
|
{
|
||||||
|
if ($array[$i][$column]==$text || strcmp($array[$i][$column],$text)==0) return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ $videosList = array();
|
||||||
$search = isset($_GET['search']) ? urldecode($_GET['search']) : "";
|
$search = isset($_GET['search']) ? urldecode($_GET['search']) : "";
|
||||||
exec("/bin/bash -c './get_astrxbian_index.sh \"*\" \"". $search . "\"'", $videos);
|
exec("/bin/bash -c './get_astrxbian_index.sh \"*\" \"". $search . "\"'", $videos);
|
||||||
exec("/bin/bash -c './get_PIN.sh'", $pinnedVideos);
|
exec("/bin/bash -c './get_PIN.sh'", $pinnedVideos);
|
||||||
$videos = array_unique($videos);
|
// $videos = array_unique($videos);
|
||||||
|
|
||||||
// exec("/bin/bash -c './get_youtube_videos.sh'", $videos);
|
// exec("/bin/bash -c './get_youtube_videos.sh'", $videos);
|
||||||
// echo file_get_contents("http://youtube2.com/ipns/12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/.12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/FASTRXBIAN");
|
// echo file_get_contents("http://youtube2.com/ipns/12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/.12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/FASTRXBIAN");
|
||||||
|
@ -49,6 +49,11 @@ foreach ($videos as $v) {
|
||||||
|
|
||||||
list($contentType, $videoID, $year, $filename, $saison, $tagsStr, $ipnsHash, $definition, $videoURI) = explode(";", $v);
|
list($contentType, $videoID, $year, $filename, $saison, $tagsStr, $ipnsHash, $definition, $videoURI) = explode(";", $v);
|
||||||
|
|
||||||
|
if (in_array_column($videoURI, 'uri', $videosList)) {
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
list($videoSource, $videoID) = handleVideoID($videoID);
|
list($videoSource, $videoID) = handleVideoID($videoID);
|
||||||
|
|
||||||
$ipfsHash = preg_replace('!^/ipfs/([^/]+)/.*$!isU', '$1', $videoURI);
|
$ipfsHash = preg_replace('!^/ipfs/([^/]+)/.*$!isU', '$1', $videoURI);
|
||||||
|
|
Loading…
Reference in New Issue