Apr 27 2009

Update 6th May 2009: You might want to read this first…
You are now able to search, index, record and watch Channel4’s 4oD without Adobe flash on most platforms using the latest release of the open source get_iplayer. And, best of all – it is DRM free…

This is possible thanks to today’s release of rtmpdump v1.5 by Andrej Stepanchuk which now supports adobe’s obfuscated RTMPE protocol.

To get this working do the following:

  • Use the download page to get a new version of rtmpdump and update get_iplayer to the latest version (1.73). (use get_iplayer –update)
  • Re-install the new Windows Automated Installer from here – it will then update to a working ffmpeg and rtmpdump v1.5.
  • Search for a programme:

    get_iplayer –type=ch4 Shameless

  • Record the programme that is number 40123 in the resulting index:

    get_iplayer –type=ch4 –get 40123

You can also record a programme if you suplly a 4oD url:

  • Find the programme on the Channel4 4oD web site and copy the link location of the programme.
  • Run get_iplayer as follows:

    get_iplayer –pid=ch4:http://www.channel4.com/programmes/shameless/catch-up#2872545

  • Or just: get_iplayer –pid=ch4:2872545


  • On April 28th, 2009, linuxcentre said:

    Seems to be there now – sometimes the beeb take a few hrs to put the programme on the feed. Also you could try to force a flush of the cache using –flush option.

    get_iplayer –nocopyright Perrin
    436: Reggie Perrin – Episode 1, BBC HD, Comedy,Entertainment,Sitcoms,TV, default

    INFO: 1 Matching Programmes

    • On April 28th, 2009, penguinny said:

      Thank you, I just figured this out. I was using get_iplayer –flush –type=tv and is it seems that –type=tv somehow prevented it from working correctly.

    • On April 28th, 2009, AudioBear said:

      Many thanks for the C4 stuff, my son will be very pleased! But, I’m having a few problems, mainly because I cannot seem to get rtmpdump to compile on my Intel OSX (Leopard) Mac.

      Does anyone have a compiled version of the correct stuff?

      • On April 28th, 2009, Alex P said:

        I was gonna ask the same thing. I had a play around trying to compile it but it just wasn’t happening…

        • On April 28th, 2009, John said:

          Excellent work thanks for the great script. And thanks to Andrej Stepanchuk for the rtmpdump program.

          Will you be adding support for Demand five to the script – that seems to use RTMPE too.

          • On April 28th, 2009, linuxcentre said:

            I certainly have that on my list. I won’t be making many changes for the next week – I’m going to be working at the Reading Beer festival this week though so I will be out of action…. Come find me behind the beer bar if you want a few free tasters on me 🙂

          • On April 28th, 2009, DavidC said:

            Has anyone noticed ffmpeg conversion failing sporadically on these 4oD flv’s? Same ffmpeg build never has problems with bbc downloads. So far i’ve only noticed it happen with the smaller 384×288 streams.

            FFmpeg version SVN-r18374-snapshot, Copyright (c) 2000-2009 Fabrice Bellard, et al.
            configuration: –enable-shared –cc=cc –mandir=/usr/local/man –disable-debug –disable-optimizations –enable-gpl –enable-pthreads –enable-postproc –enable-libfaac –enable-libfaad –enable-libmp3lame –enable-libtheora –enable-libvorbis –enable-libx264 –enable-x11grab –extra-libs=’-L/usr/local/lib -L/usr/X11R6/lib’ –extra-cflags=’-I/usr/local/include -I/usr/X11R6/include’ –disable-decoder=cavs –disable-altivec –disable-armv6 –disable-armvfp –disable-iwmmxt –disable-neon
            libavutil 50. 3. 0 / 50. 3. 0
            libavcodec 52.25. 0 / 52.25. 0
            libavformat 52.32. 0 / 52.32. 0
            libavdevice 52. 2. 0 / 52. 2. 0
            libswscale 0. 7. 1 / 0. 7. 1
            libpostproc 51. 2. 0 / 51. 2. 0
            built on Apr 8 2009 14:39:27, gcc: 3.3.5 (propolice)
            [flv @ 0x206920000]negative cts, previous timestamps might be wrong

            Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1)
            Last message repeated 13 times
            Input #0, flv, from ‘./Father_Ted/Father_Ted_Flight_into_Terrors02e10_2871743.partial.mp4.flv’:
            Duration: 00:23:51.08, start: 0.000000, bitrate: N/A
            Stream #0.0: Video: h264, yuv420p, 384×288 [PAR 1:1 DAR 4:3], 25 tbr, 1k tbn, 50 tbc
            Stream #0.1: Audio: aac, 24000 Hz, stereo, s16
            Output #0, mp4, to ‘./Father_Ted/Father_Ted_Flight_into_Terrors02e10_2871743.partial.mp4’:
            Stream #0.0: Video: libx264, yuv420p, 384×288 [PAR 1:1 DAR 4:3], q=2-31, 1k tbn, 1k tbc
            Stream #0.1: Audio: libfaac, 24000 Hz, stereo, s16
            Stream mapping:
            Stream #0.0 -> #0.0
            Stream #0.1 -> #0.1
            Press [q] to stop encoding
            [NULL @ 0x204a67c00]error, non monotone timestamps 40 >= 40
            av_interleaved_write_frame(): Error while opening file
            WARNING: flv conversion failed – retaining flv file

            • On April 28th, 2009, linuxcentre said:

              I use FFmpeg version SVN-r15261 (Fedora9/10) and FFmpeg revision number: 16573 on WindowsXP with no probs. I’ve not heard any other reports on OpenBSD – maybe try an older rev??

            • On April 29th, 2009, Russell said:

              I get the same problem on every ch4 programme, not on bbc ones. I’m also using a nightly build rather than the default ffmpeg (the one that came with Ubuntu 9.04 didn’t work at all!). I wonder if there’s a build flag we’ve missed or included in error?

              • On April 30th, 2009, Russell said:

                I found the solution to the ffmpeg conversion error, ffmpeg needs to be compiled with the following options:

                –enable-libfaac –enable-libmp3lame –enable-libtheora –enable-libvorbis –enable-libx264 –enable-libxvid –enable-gpl –enable-nonfree –enable-postproc –enable-avfilter –enable-avfilter-lavf

                • On April 30th, 2009, ufufgnaf said:

                  I can’t seem to get the program list off channel 4 website at the moment. Anybody else experiencing the problem? It worked last night.

                  • On April 30th, 2009, Bruce said:

                    Yes, me too. Presumably a temporary glitch.

                    • On May 1st, 2009, Alan said:

                      Still not working. Doesn’t work using pid either. Do you suppose Channel 4 are blocking it?

                      • On May 1st, 2009, Alan said:

                        Captured the xml file with Wireshark (while browsing with firefox), ran rtmpdump with -r and -u parameters, seemed to authenticate, and then got error.

                        • On May 1st, 2009, linuxcentre said:

                          Try updating get_iplayer now. You were right!

                          • On May 1st, 2009, Alan said:

                            Brilliant. Many thanks for the quick fix. Was beginning to wonder if it was something to do with the user agent string, but couldn’t make sense of it. You’re obviously way ahead of me. Thanks again.

                        • On May 1st, 2009, linuxcentre said:

                          It’s obfuscation 🙂
                          Try updating get_iplayer now.

                        • On May 1st, 2009, linuxcentre said:

                          update get_iplayer now…

                          • On May 2nd, 2009, stevan said:

                            It doesn’t seem to work again, am I the only one? Love the script by the way Phil!

                        • On May 1st, 2009, Bigarules said:

                          Tried with 1.74 just now, not getting a scrape.

                          WARNING: Failed to get programme index feed for from 4oD site

                          Have they changed it again?

                          • On May 1st, 2009, Alan said:

                            Failing for me again too.

                            • On May 2nd, 2009, Alan said:

                              Working again with v1.75. Thanks again.

                          • On May 1st, 2009, sizzle said:

                            4od scraping down here too.

                            • On May 2nd, 2009, Bigarules said:

                              Tried again just now with latest version (Ubuntu)

                              INFO: Current version is 1.75
                              INFO: Getting ch4 Programmes List
                              WARNING: Failed to get series list from from channel4 site
                              WARNING: Failed to get series list from from channel4 site
                              WARNING: Failed to get series list from from channel4 site

                              • On May 2nd, 2009, Mike said:

                                I can’t get this to work either, just updated to 1.75 too 🙁

                                • On May 2nd, 2009, murble said:

                                  They seem to be discriminating against anything containing Connection: TE and just dropping the connection.

                                  for a quick fix!

                                  • On May 3rd, 2009, stevan said:

                                    Good catch, that sorted it.

                                  • On May 3rd, 2009, keswick said:

                                    can someone explain how and what exactly you do with this script? iam so new to all this!


                                    • On May 3rd, 2009, linuxcentre said:

                                      Thanks – I’ve added that pathch now 🙂

                                    • On May 3rd, 2009, Flipper said:

                                      There appears to be a bug with Ch4 (version 1.76). Whichever program I try to download, I get a specific episode of the Countdown show.

                                      When using the get_iplayer –get XXXXX
                                      command, it creates a file with the program name, however it’s that Countdown episode.

                                      When using the pid:XXXXXXXXX notation for any XXXXXXXXX, it gets again the same Countdown episode, and put the name Countdown_s2009e70_2871745.mp4

                                      • On May 4th, 2009, Alan said:

                                        I’m seeing the same problem, with both version 1.76 and version 1.75 (just to check it wasn’t a problem specific to 1.76).

                                        • On May 4th, 2009, Alan said:

                                          Adding Accept: */* to the HTTP request seems to fix this.

                                          • On May 4th, 2009, LiLo said:

                                            How and where did you add Accept?

                                            • On May 4th, 2009, Alan said:

                                              Try inserting the following line into the create_ua subroutine:

                                              $ua->default_header( ‘Accept’ => “*/*” );

                                              By the way, if the people at Channel 4 that keep changing their system read this, at least the idea of always downloading Countdown was quite amusing (made me chuckle anyway).

                                              • On May 4th, 2009, linuxcentre said:

                                                Thanks Alan! I’ve patched get_iplayer v1.77 to make it more closely simulate a standard browser now inclusing the Accept header.

                                              • On May 5th, 2009, Flipper said:

                                                I just tried again with 1.86 and I get again the Countdown episodes ;-(.

                                              • On May 6th, 2009, Forex said:

                                                I always get Countdown with v1.82 too..

                                                If they did this on purpose it’s quite amusing indeed 😀

                                                The funny thing is though, that I get Countdown on my browser too !?
                                                Even on my laptop that has never been on 4oD or run get_iplayer ever before !?

                                                They are not doing this based on IPs are they??

                                              • On May 6th, 2009, Alan said:

                                                Hmmm, I have found that if I fetch the xml file for the asset info I always get the Countdown one, unless I use a proxy server that results in the request going from a different IP address, and then I get the correct xml file. Does sound like they have, maybe, black-listed some IP addresses. Guess I will have to find a way of sending that request from a selection of different IP addresses.

                                              • On May 14th, 2009, Matt said:

                                                Hi Alan,
                                                Did you manage to solve this problem?

                                    • On May 4th, 2009, Sam Weston said:

                                      It would appear that channel 4 is broken again :(:

                                      INFO: Getting ch4 Programmes List
                                      WARNING: Failed to get series list from from channel4 site
                                      WARNING: Failed to get series list from from channel4 site
                                      WARNING: Failed to get series list from from channel4 site

                                      I’m running the latest SVN (216)

                                      • On May 4th, 2009, linuxcentre said:

                                        The svn versions aren’t always the latest 😐

                                      • On May 4th, 2009, Sam Weston said:

                                        Oh right…I assumed they would be. I’ll try one of the proper releases.

                                        • On May 4th, 2009, linuxcentre said:

                                          Nah – use the ‘get_iplayer –update’ I cannot always vouch for the state of the svn one.

                                        • On May 13th, 2009, graham said:

                                          Hi I’m using v1.85 of get_iplayer but ch4 seems to be broken. the response is ‘Invalid type ‘ch4′ specified. Valid types are: itv,tv,podcast,radio’

                                          • On May 13th, 2009, graham said:

                                            please disregard…just saw the post stopping ch4 support

                                            • On November 4th, 2009, Del said:

                                              The “ch4” type doesn’t work. I know you said that you have moved to a plugin approach, but where can I get a working plugin? Can you link to a plugin that I can use? Also, how do you add a plugin?

                                              • On November 29th, 2009, liam said:

                                                WHEN IS IT GOING TO WORK ?

                                                • On December 5th, 2009, Mt T said:

                                                  How do i find the PID of a CH4 program?


                                                  • On December 22nd, 2009, iPlayer Assistance said:

                                                    The problem has been resolved, for more info please visit our help desk.

                                                    • On December 24th, 2009, Joe said:

                                                      Is this ever going to work with CH4, I really need to record stuff off channel 4.

                                                      • 7 old comments are not displayed. Click to display all comments

                                                      WordPress Themes