shell - PHP Exec - How to only display the result of the last command -
i'm using exec
php function run script grabs youtube video in mp3 format (with youtube-dl
).
at end of script made echo
, result want.
but when launch php page, output composed of youtbe-dl
did. that:
[youtube] ztks9svhhui: downloading webpage [youtube] ztks9svhhui: downloading video info webpage [youtube] ztks9svhhui: extracting video information [youtube] ztks9svhhui: downloading js player en_us-vflgfv_kx [youtube] ztks9svhhui: downloading js player en_us-vflgfv_kx [download] destination: /var/www/xxx/mp3dl/kaskade - whatever ft kolaj (neus remix).webm [download] 0.0% of 3.84mib @ 10.17kib/s eta 06:26 [download] 0.1% of 3.84mib @ 30.44kib/s eta 02:09 [. . .] [download] 100.0% of 3.84mib @ 4.01mib/s eta 00:00 [download] 100% of 3.84mib in 00:00 [ffmpeg] destination: /var/www/xxx/mp3dl/kaskade - whatever ft kolaj (neus remix).mp3 deleting original file /var/www/xxx/mp3dl/kaskade - whatever ft kolaj (neus remix).webm (pass -k keep) /var/www/xxx/mp3dl/kaskade - whatever ft kolaj (neus remix).mp3
the thing need :
/var/www/xxx/mp3dl/kaskade - whatever ft kolaj (neus remix).mp3
how can that? there did not understand?
edit : there php code :
$url = htmlspecialchars($_post['url']); $choice1 = $_post['choice1']; $output = exec('sh scripts/ytdlmp3_direct.sh "'.$url.'"'); if(isset($_post['action'])){ if(empty($url)) { print("<div class='card-panel yellow'>please add url</div>") ; } else { if($choice1 == "download") { print $output; } elseif($choice1 == "store") { print "soon"; } } }
thanks! ~quentin
add -q or --quiet command via exec()
, not output of "debug" messages.
from documentation
-q, --quiet activate quiet mode
Comments
Post a Comment