<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+ <change afterPath="$PROJECT_DIR$/scripts/youtubedl-download.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/index.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" 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/weatherstation.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/weatherstation.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/raspberrycast.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/raspberrycast.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1577378088885" duration="2201000" />
<workItem from="1577380387468" duration="866000" />
<workItem from="1577785483253" duration="3506000" />
- <workItem from="1577891426611" duration="1934000" />
- </task>
- <task id="LOCAL-00213" summary=".">
- <created>1566603610179</created>
- <option name="number" value="00213" />
- <option name="presentableId" value="LOCAL-00213" />
- <option name="project" value="LOCAL" />
- <updated>1566603610179</updated>
+ <workItem from="1577891426611" duration="4801000" />
</task>
<task id="LOCAL-00214" summary=".">
<created>1566737418166</created>
<option name="project" value="LOCAL" />
<updated>1577787688220</updated>
</task>
- <option name="localTasksCounter" value="262" />
+ <task id="LOCAL-00262" summary=".">
+ <created>1578036926863</created>
+ <option name="number" value="00262" />
+ <option name="presentableId" value="LOCAL-00262" />
+ <option name="project" value="LOCAL" />
+ <updated>1578036926863</updated>
+ </task>
+ <option name="localTasksCounter" value="263" />
<servers />
</component>
<component name="TodoView">
</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="1577787685019">
+ <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1578036915321">
<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="1577787685019" />
- <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1577785958789">
+ <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1578036915321" />
+ <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1578038647334">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="836" y="443" key="NewPhpFileDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577363498855" />
- <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1577785958789" />
+ <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1578038647334" />
<state x="872" y="242" key="Vcs.Push.Dialog.v2" timestamp="1577787700897">
<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="1577891427221" />
- <state x="732" y="257" width="607" height="536" key="find.popup" timestamp="1577380471547">
- <screen x="0" y="0" width="1920" height="1040" />
+ <state x="976" y="257" width="607" height="536" key="find.popup" timestamp="1578037318294">
+ <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="526" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1576492890263" />
+ <state x="976" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1578037318294" />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
mediaRaspCommons($device);
$res = VLCPlay($url, $device);
mediaRaspPostPlay($device);
- try {
- raspberryCast('video', $device, ['control' => 'stop']);
- } catch (Exception $e) {
-
- }
setPlaying('mediarasp:' . $url, $device);
mediaRaspCommons($device);
return $res;
}
-
-function mediaRaspCastURL($url, $device = null)
-{
- if (null === $device) {
- $device = config('DEVICE');
- }
- setPlaying('raspberrycast:' . $url, $device);
- raspberryCast('stream', $device, ['url' => $url]);
- setPlaying('raspberrycast:' . $url, $device);
-}
-
function mediaRaspPlayCast($castURL, $device = null)
{
if (null === $device) {
return $res;
}
-function downloadYoutubeDL($url, $ext = 'mkv')
+function getYoutubeDLCastURL($url)
+{
+ $res = `/usr/local/bin/youtube-dl -f best --get-url $url`;
+ return trim($res);
+}
+
+function getYoutubeDLPath($url)
{
$hash = sha1($url);
- $dest = "/nas/Videos/YoutubeDL/" . $hash . '.' . $ext;
- $wip = $dest . '.wip';
- if (!file_exists($dest) && !file_exists($wip)) {
- set_time_limit(0);
- ignore_user_abort(true);
- file_put_contents($wip, '');
+ return "/nas/Videos/YoutubeDL/" . $hash . '.mkv';
+}
- $format = 'bestvideo+bestaudio/best';
- `/usr/local/bin/youtube-dl -f '$format' -o $dest --merge-output-format $ext '$url'`;
- unlink($wip);
+function downloadYoutubeDL($url)
+{
+ $dest = getYoutubeDLPath($url);
+ $wip = $dest . '.wip';
+ if (!file_exists($dest)) {
+ if (!file_exists($wip)) {
+ httpRequest('https://' . $_SERVER['HTTP_HOST'] . '/scripts/youtubedl-download.php?url=' . rawurldecode($url), 'get', [], null, 1);
+ }
+ return getYoutubeDLCastURL($url);
+ } else {
+ return $dest;
}
- return $dest;
}
function getYoutubeDLMeta($url, $isHash = false)
if (file_exists($fileorstream)) {
$fileorstream = 'file://' . $fileorstream;
}
+ echo $fileorstream;
if ($device === 'bureau') {
sshCommand('/usr/local/bin/soundtohdmi', $device, true, true);
}