These forums are archived

See this post for further info

get_iplayer forums

Forum archived. Posting disabled.

Unable to download from cron (rtmpdump error)

user-1113

get_iplayer is working fine from the command line, but when called from a user crontab it fails.

As mentioned in another thread I am spawning get_iplayer using a bash -lc in order to get the PATH to include /usr/local/bin (for the sake of rtmpdump), as I was unable to set PATH within the crontab for some reason.

However, rtmpdump still fails.  Using --verbose, I get


Code:
INFO: rtmpver:
INFO: /usr/local/bin/rtmpdump: error while loading shared libraries: librtmp.so.1: cannot open shared object file: No such file or directory
WARNING: Your version of rtmpdump/flvstreamer does not support SWF Verification
WARNING: You may see this warning if rtmpdump has malfunctioned
INFO: /usr/local/bin/rtmpdump version /usr/local/bin/rtmpdump: error while loading shared libraries: librtmp.so.1: cannot open shared object file: No such file or directory

It seems like it may still be a PATH issue, this time unable to find /usr/local/lib.  I've tried adding that directory to my PATH in .bashrc, but that hasn't made any difference.

Does anyone have any hints?

I'm using Slackware 14.1 64 bit in case that's useful.

user-2

LD_LIBRARY_PATH would be the controlling environment variable for shared library loading.  I would expect /usr/local/lib to be available by default, but perhaps not. Try setting it explicitly and see if it makes a difference. That is just a conjecture, though - I don't have a Slackware system available at the moment to verify.

user-2

One other thing that comes to mind: If you have rtmpdump in /usr/local, I presume you built it yourself rather than using the rtmpdump SlackBuild. Perhaps try the SlackBuild and see if things work better with rtmpdump installed in the normal locations.

EDIT: SlackBuild installation of get_iplayer and dependencies (incl. rtmpdump), as described in the installation instructions in the wiki, does work under cron.

user-1113

LD_LIBRARY_PATH is set to include /usr/local/lib in .bashrc so that shouldn't be a problem.

I installed everything from source because I could never get the SlackBuild version of ffmpeg to work with lame, compiling myself was the only way I could find to get around that. I guess I'd switch everything back as a last resort but would rather not lose lame if I can help it.

user-1113

In case it's useful to anyone else, this worked:


Code:
0  *  *  *  *  export LD_LIBRARY_PATH=/usr/local/lib && bash -lc '/usr/local/bin/get_iplayer --pvr --verbose'

Although setting LD_LIBRARY_PATH at the top of the crontab doesn't, for some reason.  Same for PATH.  I have no idea why.

Thanks for the pointers.

user-2

Normally, it should be enough to set LD_LIBRARY_PATH at the beginning of your cron command. You would also normally need to use --rtmpdump  in crontab since your rtmpdump binary wouldn't be in PATH, but you appear to get around that by launching a login shell from cron. I have no clue why LD_LIBRARY_PATH isn't being set the same way from .bashrc. Try setting it explicitly at the beginning of your cron command and using --rtmpdump instead of a login shell. Here is a test cron entry to show what I mean (downloads Bells on Sunday, a very short audio programme, to /tmp - adjust path to get_iplayer if necessary):

Code:
* * * * * LD_LIBRARY_PATH=/usr/local/lib /usr/bin/get_iplayer --pid b06tpxw9 --type radio --force --overwrite --output /tmp --rtmpdump /usr/local/bin/rtmpdump > /tmp/gip.txt 2>&1

SlackBuild ffmpeg works fine with SlackBuild lame for get_iplayer. If it doesn't meet some other requirements of your own, then I suppose you don't have much choice but to DIY.  Unless you built ffmpeg with librtmp as a dependency (not terribly useful), there is no reason you couldn't switch to SlackBuild just for rtmpdump.

user-2

(03-01-2016, 06:50 PM)Although setting LD_LIBRARY_PATH at the top of the crontab doesn't, for some reason.  Same for PATH.  I have no idea why.
LD_LIBRARY_PATH and PATH aren't supported by Slackware cron

These forums are archived

See this post for further info