forked from axiom-team/astrXbian
Compare commits
2 Commits
af51349bba
...
23a6aad73c
Author | SHA1 | Date |
---|---|---|
Boris | 23a6aad73c | |
fred | 71b79cd842 |
|
@ -20,7 +20,7 @@ source $HOME/.profile
|
||||||
|
|
||||||
#### CONTROL STATION IPFS DAEMON
|
#### CONTROL STATION IPFS DAEMON
|
||||||
## timeout is fixing ipfs minimum response time, before considering stuck process
|
## timeout is fixing ipfs minimum response time, before considering stuck process
|
||||||
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
|
IPFSNODEID=$(ipfs --timeout=30s id -f='<id>\n')
|
||||||
[[ ! $IPFSNODEID && -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING" && sudo systemctl restart ipfs && exit 1
|
[[ ! $IPFSNODEID && -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING" && sudo systemctl restart ipfs && exit 1
|
||||||
[[ ! $IPFSNODEID && "${USER}" == "xbian" ]] && echo "IPFS NOT RUNNING" && sudo service ipfs restart && exit 1
|
[[ ! $IPFSNODEID && "${USER}" == "xbian" ]] && echo "IPFS NOT RUNNING" && sudo service ipfs restart && exit 1
|
||||||
## CONTROL IPFS IS RUNNING OR RESTART
|
## CONTROL IPFS IS RUNNING OR RESTART
|
||||||
|
|
|
@ -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