Hi
@alex_free,
I've been trying out running the terminal commands you are using
when doing youtube streaming through a "do shell script" inside
an applescript script.
As far as I can see they run fine, although I don't get any output to see if an error
happens.
Maybe this can be an improvement ( IMHO ) to not make it depend on terminal at least
for streaming. This is because if you already have terminal running this makes you jump
to the workspace where terminal started when opening the new window.
I've also tried another thing which might be a way to find if using youtube-dl has failed.
If you run it using "-f <format> -g" or just "-g" you get the url of the video as output.
This way you can check if it returns an url for the video and see if it failed.
You can set a variable to the result of "do shell script" and then run
for example mplayer feeding this url directly to it instead of piping what youtube-dl is
streaming. From my tests at least with mplayer it seems to lower cpu usage a few percent.
To not have applescript blocked by running mplayer through "do shell script" you can add
" > /dev/null 2 > &1 & ". This will make "do shell script" release without waiting for mplayer
to finish.
Best regards,
voidRunner