]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Tue, 7 Jan 2020 09:19:31 +0000 (10:19 +0100)
committerVincent <vincent@enhydra.fr>
Tue, 7 Jan 2020 09:19:31 +0000 (10:19 +0100)
.idea/workspace.xml
scripts/freeboxchannel.php
scripts/lib/mediarasp.php
scripts/lib/remoteinfos.php
scripts/youtubedl-download.php

index 8814ac45f1112567ebf21066f5633a27ddd95b11..881669f9f8182519d27cb329148517e4ac482b81 100644 (file)
@@ -3,8 +3,10 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/gradient.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/gradient.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/freeboxchannel.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/freeboxchannel.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/youtubedl-download.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/youtubedl-download.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1577380387468" duration="866000" />
       <workItem from="1577785483253" duration="3506000" />
       <workItem from="1577891426611" duration="8746000" />
-      <workItem from="1578343490755" duration="2955000" />
-    </task>
-    <task id="LOCAL-00219" summary=".">
-      <created>1567453650664</created>
-      <option name="number" value="00219" />
-      <option name="presentableId" value="LOCAL-00219" />
-      <option name="project" value="LOCAL" />
-      <updated>1567453650665</updated>
+      <workItem from="1578343490755" duration="7740000" />
     </task>
     <task id="LOCAL-00220" summary=".">
       <created>1567497032711</created>
       <option name="project" value="LOCAL" />
       <updated>1578382506583</updated>
     </task>
-    <option name="localTasksCounter" value="268" />
+    <task id="LOCAL-00268" summary=".">
+      <created>1578382650656</created>
+      <option name="number" value="00268" />
+      <option name="presentableId" value="LOCAL-00268" />
+      <option name="project" value="LOCAL" />
+      <updated>1578382650656</updated>
+    </task>
+    <option name="localTasksCounter" value="269" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     </state>
     <state x="720" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577298128269" />
     <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1576479992407" />
-    <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1578382488210">
+    <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1578388732220">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="701" y="114" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1577381105204" />
     <state x="701" y="127" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1575647157027" />
-    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1578382488210" />
+    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1578388732220" />
     <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1578038647334">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577380394903" />
     <state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1575647093028" />
     <state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1578343490530" />
-    <state x="976" y="257" width="607" height="536" key="find.popup" timestamp="1578343507511">
+    <state x="976" y="257" width="607" height="536" key="find.popup" timestamp="1578382838515">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="257" width="607" height="536" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1577380471547" />
-    <state x="976" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1578343507511" />
+    <state x="976" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1578382838515" />
+    <state x="936" y="240" key="run.anything.popup" timestamp="1578386519646">
+      <screen x="0" y="0" width="2560" height="1040" />
+    </state>
+    <state x="936" y="240" key="run.anything.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1578386519646" />
   </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
index 804bcaad6b154ebba5eb81c8e9e885794d4caefe..95791b1b35efc25be36a887f6f3abd1ac2b4bb8b 100644 (file)
@@ -5,11 +5,11 @@ harmonyActivity('tv');
 if (isset($_GET['channel'])) {
     $commands = array_merge(['ok', 'pause=5'], str_split((string)$_GET['channel']));
 } else if (isset($_GET['menu']) && $_GET['menu'] == 'replay') {
-    $commands = ['right', 'ok', 'pause=5', 'down', 'down', 'down', 'down', 'right', 'right', 'right', 'right'];
+    $commands = ['right', 'ok', 'pause=5', 'down', 'down', 'down', 'down', 'down'];
 } else if (isset($_GET['menu']) && $_GET['menu'] == 'netflix') {
     $commands = ['right', 'down', 'down', 'ok', 'pause=25', 'ok'];
 }
-$keys = array_merge(array('home', 'pause=2', 'home', 'pause=1', 'home', 'home'), $commands);
+$keys = array_merge(array('home', 'pause=2', 'home', 'pause=1', 'home', 'left', 'right', 'home'), $commands);
 
 if ($currentActivity != 'tv') {
     sleep(40);
index 176c03a146bb2dac973401a35ec37773e628a3aa..a8f1da6fd6c47651ffeb284923ba025214c85308 100644 (file)
@@ -350,7 +350,6 @@ function mediaRaspPlayCast($castURL, $device = null)
     $dest = downloadYoutubeDL($castURL, 1080, true, 'mkv');
     getYoutubeDLMeta($castURL);
     $res = VLCPlay($dest, $device);
-    print_r($res);
     mediaRaspPostPlay($device);
     setPlaying('mediarasp:cast:' . $castURL);
     return $res;
@@ -362,7 +361,9 @@ function getYoutubeDLCastURL($url, $height = 1080)
     if ($height != 0) {
         $h = '[height<=' . $height . ']';
     }
-    $res = `/usr/local/bin/youtube-dl -f best$h --get-url $url`;
+    $cmd = "/usr/local/bin/youtube-dl -f 'best$h' --get-url '$url'";
+    $res = `$cmd`;
+    echo $res;
     return trim($res);
 }
 
@@ -382,8 +383,12 @@ function downloadYoutubeDL($url, $height = 1080, $cast = true, $ext = 'mkv')
     $wip = $dest . '.wip';
     if (!file_exists($dest)) {
         if (!file_exists($wip)) {
-            $convert = 'https://' . $_SERVER['HTTP_HOST'] . '/scripts/youtubedl-download.php?url=' . rawurldecode($url) . '&h=' . $height . '&ext=' . $ext;
-            httpRequest($convert, 'get', [], null, $cast ? 1 : 0);
+            $convert = 'https://' . $_SERVER['HTTP_HOST'] . '/scripts/youtubedl-download.php';
+            try {
+                httpRequest($convert, 'get', ['url' => $url, 'h' => $height, 'ext' => $ext], null, $cast ? 1 : 0);
+            } catch (Exception $e) {
+
+            }
             if (!$cast) {
                 return $dest;
             }
index b9a290cdaefcdae6be0f26f54e1f255036a00ff5..827d071dbbb2738614ee0259a1a323275b430fd4 100644 (file)
@@ -63,8 +63,11 @@ function mediaraspRemoteInfos()
     $res['duration'] = intval((string)$status->xpath('//length')[0]);
     $res['time'] = intval((string)$status->xpath('//time')[0]);
 
-    if (preg_match("|^\/nas\/Videos\/YoutubeDL\/([a-f0-9]{40})\.mp4$|", $source, $matches)) {
-        $meta = getYoutubeDLMeta($matches[1], true);
+    $playing = getPlaying();
+    $e = explode(':', $playing, 3);
+
+    if (count($e) === 3 && $e[0] === 'mediarasp' && $e[1] === 'cast') {
+        $meta = getYoutubeDLMeta($e[2]);
         $res['title'] = $meta['title'];
         $res['artwork'] = $meta['thumbnail'];
     } else {
index 4dd7a4b6fb132d463d50fc98b63877d5c64cc5cd..d111ec87ee075bb81e22529dc18bcbd212c383f9 100644 (file)
@@ -1,5 +1,9 @@
 <?php
+set_time_limit(0);
+ignore_user_abort(true);
 require_once "import.php";
+set_time_limit(0);
+ignore_user_abort(true);
 $url = $_GET['url'];
 $ext = $_GET['ext'];
 $h = isset($_GET["h"]) ? $_GET['h'] : 0;
@@ -7,8 +11,7 @@ $h = isset($_GET["h"]) ? $_GET['h'] : 0;
 $dest = getYoutubeDLPath($url, $h, $ext);
 $wip = $dest . '.wip';
 if (!file_exists($dest) && !file_exists($wip)) {
-    set_time_limit(0);
-    ignore_user_abort(true);
+
     file_put_contents($wip, '');
     $height = '';
     if ($h != 0) {
@@ -16,8 +19,7 @@ if (!file_exists($dest) && !file_exists($wip)) {
     }
 
     $format = 'bestvideo' . $height . '+bestaudio/best' . $height;
-    $cmd="/usr/local/bin/youtube-dl -f '$format' -o $dest --merge-output-format mkv '$url'";
-    echo $cmd;
+    $cmd = "/usr/local/bin/youtube-dl -f '$format' -o $dest --merge-output-format mkv '$url'";
     `$cmd`;
     unlink($wip);
 }
\ No newline at end of file