forked from axiom-team/astroport
/REC
This commit is contained in:
parent
188ce403cc
commit
02cb67d2b5
@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
|
* TIS CODE IS REALTED TO zen/_CopyLaRadio shell's
|
||||||
DONE!!!? WRITE THAT CODE IN infobar2.js : arrount line 158 before "return lines;"
|
DONE!!!? WRITE THAT CODE IN infobar2.js : arrount line 158 before "return lines;"
|
||||||
// ZEEBOX HACK ZONE
|
// ZEEBOX HACK ZONE
|
||||||
var reclink = './REC/youtube-dl.php?q=REC&artist=' + escape(encodeURIComponent(npinfo.Artist)) + '&title=' + escape(encodeURIComponent(npinfo.Title)) + '&radio='+ escape(encodeURIComponent(npinfo.stream)) +'&maxResults=1';
|
var reclink = './youtube-dl.php?q=REC&artist=' + escape(encodeURIComponent(npinfo.Artist)) + '&title=' + escape(encodeURIComponent(npinfo.Title)) + '&radio='+ escape(encodeURIComponent(npinfo.stream)) +'&maxResults=1';
|
||||||
var zcopylink = ' <a id="REC" title="Enregistrer sur Youtube" href="#" onclick=\'javascript:window.open("'+ reclink +'","REC","menubar=no, scrollbars=no, top=10, left=10, width=384, height=546");return false;\'>[REC]</a>';
|
var zcopylink = ' <a id="REC" title="Enregistrer sur Youtube" href="#" onclick=\'javascript:window.open("'+ reclink +'","REC","menubar=no, scrollbars=no, top=10, left=10, width=384, height=546");return false;\'>[REC]</a>';
|
||||||
zcopylink += ' <a title="RECHERCHE LIBRE" href="./REC/youtube-dl.php" target="youtube">*</a>';
|
zcopylink += ' <a title="RECHERCHE LIBRE" href="./youtube-dl.php" target="youtube">*</a>';
|
||||||
lines[0].text += zcopylink;
|
lines[0].text += zcopylink;
|
||||||
// ZEEBOX HACK ZONE
|
// ZEEBOX HACK ZONE
|
||||||
*/
|
*/
|
||||||
@ -28,48 +29,52 @@ if( $radio == "Nova zz" ) {
|
|||||||
}
|
}
|
||||||
// Write request for copy.sh triggering
|
// Write request for copy.sh triggering
|
||||||
if( $search == "REC" ) {
|
if( $search == "REC" ) {
|
||||||
///////////////////
|
|
||||||
$result.='<h2>♫ '.$radio.' ♫</h2>';
|
$result.='<h2>♫ '.$radio.' ♫</h2>';
|
||||||
// LINK RECEIVED
|
// LINK RECEIVED
|
||||||
if ($lnk) {
|
if ($lnk) {
|
||||||
$artist="";
|
$artist="";
|
||||||
shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Lien reçu."');
|
|
||||||
// Not making double request
|
// Not making double request
|
||||||
if( ! exec('grep '.escapeshellarg($lnk).' /tmp/ytdl.list') ) {
|
if( ! exec('grep '.escapeshellarg($lnk).' /tmp/ytdl.list') ) {
|
||||||
file_put_contents("/tmp/ytdl.list","CopyLibre||$lnk\n", FILE_APPEND);
|
// file_put_contents("/tmp/ytdl.list","CopyLibre||$lnk\n", FILE_APPEND);
|
||||||
|
// instead of using a relay daemon to monitor a /tmp shared file, we are going to send sbot message to make it. #zenyta SSB message.
|
||||||
|
shell_exec('/home/pi/.zen/astroport/zen/_CopyLaRadio/sbotc_zenyta.sh'. $lnk);
|
||||||
}
|
}
|
||||||
$result.='<p><a href="'.$lnk.'" target="check">LIEN: '.$lnk.'</a></p>';
|
$result.='<p><a href="'.$lnk.'" target="check">LIEN: '.$lnk.'</a></p>';
|
||||||
///////////////////
|
|
||||||
|
|
||||||
// TRACK COPY (not for undefined or local file)
|
// TRACK COPY (not for undefined or local file)
|
||||||
} else if ($radio && $artist != $title && $artist != "undefined" && $title != "undefined" && strlen(explode(".", $title)[1]) != 3 && explode(".", $title)[1] != "opus" ) {
|
} else if ($radio && $artist != $title && $artist != "undefined" && $title != "undefined" && strlen(explode(".", $title)[1]) != 3 && explode(".", $title)[1] != "opus" ) {
|
||||||
// Not making double request
|
// Not making double request
|
||||||
if( ! exec('grep '.escapeshellarg($cmd).' /tmp/ytdl.list') ) {
|
if( ! exec('grep '.escapeshellarg($cmd).' /tmp/ytdl.list') ) {
|
||||||
// shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Enregistrement ajouté."');
|
// shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Enregistrement ajouté."');
|
||||||
file_put_contents("/tmp/ytdl.list","$cmd\n", FILE_APPEND);
|
|
||||||
// } else {
|
shell_exec('/home/pi/.zen/astroport/zen/_CopyLaRadio/artist_song_to_sbotc_zenyta.sh "'. $artist . '" "' . $title .'"');
|
||||||
// shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Copie déjà lancée"');
|
|
||||||
|
} else {
|
||||||
|
shell_exec('/home/pi/.zen/astroport/zen/_CopyLaRadio/parle.sh "Copie déjà lancée"');
|
||||||
}
|
}
|
||||||
$result.='<a style="color:#FFFFFF" href="https://www.youtube.com/results?search_query='.urlencode($artist).'%20'.urlencode($title).'" target="check">
|
$result.='<a style="color:#FFFFFF" href="https://www.youtube.com/results?search_query='.urlencode($artist).'%20'.urlencode($title).'" target="check">
|
||||||
<h4>'.$artist.' / '.$title.'</h4>
|
<h4>'.$artist.' / '.$title.'</h4>
|
||||||
</a>';
|
</a>';
|
||||||
///////////////////
|
|
||||||
// RADIO EXTERNAL TRACK SCRAPER
|
// RADIO EXTERNAL TRACK SCRAPERs ....
|
||||||
} else if($radio != "" && $artist == "undefined" && $title == "undefined" ){
|
} else if($radio != "" && $artist == "undefined" && $title == "undefined" ){
|
||||||
shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Recherche externe pour '.$radio.'"');
|
shell_exec('/home/pi/.zen/astroport/zen/_CopyLaRadio/parle.sh "Recherche externe pour '.$radio.'"');
|
||||||
file_put_contents("/tmp/youtube-dl.log", "/home/pi/G1sms+/_CopyLaRadio/libradio/".escapeshellcmd($radio).".php".PHP_EOL, FILE_APPEND);
|
file_put_contents("/tmp/youtube-dl.log", "/home/pi/G1sms+/_CopyLaRadio/libradio/".escapeshellcmd($radio).".php".PHP_EOL, FILE_APPEND);
|
||||||
if ( file_exists("/home/pi/G1sms+/_CopyLaRadio/libradio/".escapeshellcmd($radio).".php") ) {
|
if ( file_exists("/home/pi/G1sms+/_CopyLaRadio/libradio/".escapeshellcmd($radio).".php") ) {
|
||||||
file_put_contents("/tmp/ytdl.list","$radio||".PHP_EOL, FILE_APPEND);
|
file_put_contents("/tmp/ytdl.list","$radio||".PHP_EOL, FILE_APPEND);
|
||||||
} else {
|
} else {
|
||||||
shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Aucun module"');
|
shell_exec('/home/pi/.zen/astroport/zen/_CopyLaRadio/parle.sh "Aucun module"');
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Identification imprécise. Podcast? Fichier local?"');
|
shell_exec('/home/pi/.zen/astroport/zen/_CopyLaRadio/parle.sh "Identification imprécise. Podcast? Fichier local?"');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ytform = '<form action="./REC/youtube-dl.php" method="GET">
|
$ytform = '<form action="./youtube-dl.php" method="GET">
|
||||||
<div>
|
<div>
|
||||||
<h3>ARTISTE: <input type="search" id="artist" name="artist" size="17" placeholder="Indiquez un artiste" value="'.$artist.'"></h3>
|
<h3>ARTISTE: <input type="search" id="artist" name="artist" size="17" placeholder="Indiquez un artiste" value="'.$artist.'"></h3>
|
||||||
<h3>TITRE: <input type="search" id="title" name="title" size="20" placeholder="Titre de la chanson" value="'.$title.'"></h3>
|
<h3>TITRE: <input type="search" id="title" name="title" size="20" placeholder="Titre de la chanson" value="'.$title.'"></h3>
|
||||||
@ -81,7 +86,7 @@ $ytform = '<form action="./REC/youtube-dl.php" method="GET">
|
|||||||
</form>
|
</form>
|
||||||
';
|
';
|
||||||
|
|
||||||
$lnkform.='<form action="./REC/youtube-dl.php" method="GET">
|
$lnkform.='<form action="./youtube-dl.php" method="GET">
|
||||||
<a href="https://youtube.com" target="search"><img src="./youtube.png"></a>
|
<a href="https://youtube.com" target="search"><img src="./youtube.png"></a>
|
||||||
<p><h1>youtube-dl</h1>
|
<p><h1>youtube-dl</h1>
|
||||||
<a style="color:#FFFFFF" href="https://ytdl-org.github.io/youtube-dl/supportedsites.html" target="_blank">- Sites compatibles -</a>
|
<a style="color:#FFFFFF" href="https://ytdl-org.github.io/youtube-dl/supportedsites.html" target="_blank">- Sites compatibles -</a>
|
||||||
@ -89,7 +94,7 @@ $lnkform.='<form action="./REC/youtube-dl.php" method="GET">
|
|||||||
<input type="hidden" id="q" name="q" value="REC">
|
<input type="hidden" id="q" name="q" value="REC">
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<input type="submit" value="Copie du Lien">
|
<input type="submit" value="Copie du Lien #zenyta">
|
||||||
</div>
|
</div>
|
||||||
</form>';
|
</form>';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user