How to invoke get_iplayer with Workflow iOS App "Run Script Over SSH"?
Hi...I'm new to get_iplayer (great program, btw) and I'm not an expert when it comes to Terminal / the command line on my Mac (running MacOS 10.12.6).

I have installed both get_iplayer and ffmpeg using Homebrew (only 3-4 days ago).

When I'm sat in front of my Mac, using Terminal, everything works perfectly; I can record episodes by program code (following a search), PID or URL. I have set a default directory in which to save all recordings, and when an episode finishes downloading it always gets converted into a .mp4 file.

So far, so good.

I can also connect to my Mac using my iPhone via SSH, using an app called Workflow. I can get back to my Mac no problem...but when I first tried to send a command to get_iplayer, such as

get_iplayer "news"

I would get an error along the lines that it was an invalid BASH command (?).

I dug into this and figured out that in order to get a command to get_iplayer via the workflow app that I had to use the following instead:

/usr/local/Cellar/get_iplayer/3.02/bin/get_iplayer "news"

I can now use this technique to initiate searches and the recording of programs, by inserting a PID or URL etc. However, whenever I do this, the recording does happen but the resulting file is always left as a .ts file. I get the following in the output:

"WARNING: Required ffmpeg utility not found - not converting .ts file"

...suggesting that get_iplayer cannot locate ffmpeg when I do things from the app on my phone.

I wondered if anyone had any idea how I could get things working so that I end up with a .mp4 file at the end, instead?

Many thanks.
You're not running get_iplayer in a login shell, so you only get a minimal PATH environment variable, not the one you see when you're logged in. It doesn't include /usr/local/bin, where Homebrew applications are installed. Preface your get_iplayer command with PATH="/usr/local/bin:$PATH" to amend PATH for the remote command invocation, so there is no need for the long path to get_iplayer cellar. If that doesn't work, take up the issue in a Workflow forum to find out how it should be specified. Alternatively, you can specify full paths to ffmpeg and atomicparsley as get_iplayer options. See documentation in wiki.

EDIT: Another option might be to use a login shell, something like /bin/bash --login -c "get_iplayer news", but be careful with quotes.
Hi - Thanks for your prompt reply.

I've sorted the issue by specifying the full paths for ffmpeg and atomicparsley in get_iplayer's options.

I'm going to go on to look at the whole PATH subject as a learning point for myself, and see if I can get things working that way in due course.

Many thanks.