Unattended iPlayer downloads
ThatGuy wrote in a comment that he’s using iplayer-dl on a Linux machine that he connects to via ssh, and wondered,
Though is it possible to get the ruby script to continue to be processed on the server, even if i disconnect form SSH?
It is. In fact, it’s exactly what I do. To achieve it, you’ll need to install GNU Screen (apt-get install screen on Debian/Ubuntu; your distro may vary).
The first time you connect to the downloading machine (or after a reboot), type:
screen
You’ll get a console prompt, from which you can start downloads as usual. When you disconnect from the session, the download will continue to run in the background.
Next time you connect to the machine via ssh, type:
screen -rd
You’ll get back to the console prompt that you were using earlier, which might still be downloading, or might have finished.
It’s as simple as that!
2008-07-30 08:21 UTC. Comments: 7.
Irregular Shed
Wrote at 2008-07-30 09:45 UTC using Firefox 3.0 on Windows XP:
Screen rocks. I’m currently without an always-on box under my direct control (electricity economy drive at home) so I can’t remember all the key combinations, but it’s worth reading up on them. There’s key combinations to attach extra screens, “tab” between them and detach without closing your terminal. Back when I was seeding Ubuntu ISO torrents it meant I could just spread the love without worrying about it.However, if you’re not looking for that level of interactivity and just want to start something off before closing your terminal you could just append an ampersand at the end of the command to get it to run as a new process. Something like:
ruby iplayer-dl.rb blah/blah/blah &
Although I’ve not tried it with this script I use it when I have to restart Redmine by hand on our office server, and that’s a Rails app. Works fine.
Paul Battley
Wrote at 2008-07-30 12:30 UTC using Firefox 3.0.1 on Mac OS X:
Using an ampersand won’t always work: the process will still die eventually. You can get around this by prefixing the command withnohup, but then you might as well just use screen!ThatGuy
Wrote at 2008-07-30 12:35 UTC using Internet Explorer 6.0 on Windows XP:
Cheers for that,I shall install screen tonight, and hopefully it will work perfectly!
This script has come on leaps and bounds since the first version I had, I look forward to any further features or updates.
Strawp
Wrote at 2008-07-30 15:08 UTC using Firefox 3.0.1 on Windows XP:
Indeed, screen changes everything. I also use it to remain permanently logged in to our IRC channel so that I don’t miss anything :PIrregular Shed
Wrote at 2008-07-30 16:43 UTC using Firefox 3.0 on Windows XP:
Well, I never knew that. And now I do, thanks Paul! I guess the way the box I’m talking to is configured allows me some slack to get away with it!For safety’s sake then, always use screen, because it’s considerably more skill =)
ThatGuy
Wrote at 2008-07-30 17:34 UTC using Safari 525.22 on Mac OS X:
The good:Screen is great
The Bad:
NAS:/PATH# iplayer-dl -s b00csjl9
Summer Heights High – Episode 8.mov (Default)
There is no page for this programme.
This probably means that the programme does not exist.
Metadata: http://www.bbc.co.uk/iplayer/playlist/b00csjl9/
Programme Page: http://www.bbc.co.uk/iplayer/episode/b00csjl9/
From browsing on my mobile device, it seems to be taking a bit longer for the quicktime play link to appear on the device, maybe that is the issue.
Either that, or my connection is not working, anyone else getting similar errors, occurring on quite a few popular/hot programs that I know have mobile versions.
Terence Eden
Wrote at 2008-07-31 12:18 UTC using Firefox 3.0.1 on Windows XP:
You can also start the process by typingscreen iplayer-dl -s b00csjl9
That will kick the download off in a separate screen.
To detach and go back to your console, CTRL+A+D.
To go back to that screen
screen -r
So, you can open a terminal, run screen, detatch and close the terminal. When you’re ready, open a new terminal and screen -r to check on it.
T