Please see below ...

On 31/10/2018 12:59, RS wrote:

On 31/10/2018 10:02, MacFH - C E Macfarlane wrote:

When I posted this yesterday evening, I didn't think to check that the download link was actually working, which for reasons too complicated and OT to be worth going into here, it wasn't. I've changed the filename and instructions accordingly, and now it is.


Thanks for sight of your script.  At 2700 lines of Perl I think it's probably a lot more complicated than I need.


Yes, 2700 lines is rather intimidating, but actually that arises from the complexity of what needs to be done, and nearly all the work has been done for you.  Your main tasks to convert the script for your own needs will be:

    1)    Defining a suitable PC list, see lines 261ff
    2)    Probably adapting the subroutine/function  MountShare, see lines 664ff, to mount a pre-existing local directory for one or more of the pre-defined peer PCs, instead of trying to connect to it over the network.

However you *may* be able to achieve this by defining suitably the peer PC in step 1, without changing anything in MountShare in step 2  -  after all, it's perfectly valid for a PC to connect to itself over the network!

As an example command-line, I don't usually need to reconcile between PCs on a daily basis, but I call gip.pl every evening before going to bed, giving it a command-line which reflects what I've spotted in Digiguide, and it downloads everything overnight.  Last night's command was:

        perl gip.pl a "Empire" "The Ghan" "Origins Of Us" --hide -g

        The first parameter is for gip.pl:
        a         All - download any hits from all of the four pre-defined search lists  -  HDTV, TV, Hidef Radio, Radio

        The rest are standard get_iplayer parameters:
        "Empire" "The Ghan" "Origins Of Us"    Additionally download any hits from these search terms         -- hide        Don't show search hits that have already been downloaded
        -g            Get the downloads

You would need an additional parameter before the 'a', something like ...
        -m:<hostname>,MSWin32
... or ...
        -m:<hostname>,Linux
... of which I presume the former is more likely, as I don't know of many drivers to read Linux disk formats from Windows  -  they seem to exist, but when I last researched this, ISTR they had a poor reputation  -  whereas Windows NTFS disk formats can be both read and written from within Linux.  To clarify, when gip.pl is reconciling, the source line-endings are determined by the OS under which it is running, while the destination line-endings are based on the Linux/MSWin2 parameter when defining the target PC, either in the peer PC list, @PCs, (preferred), or else from the command-line using defaults (may work, but not recommended).

As far as the complexity of the script goes, some thought will make you realise the reason for it  -  what at first seems a simple task, actually turns out to be quite complex when you start to think about it:

    1)    Reconciliation between two configurations, which can  be copying data from one configuration to the other, say newest to oldest, or merging it.  Take the download history for example, .  To copy it from one to another ...
            a)    Copy the file, changing the line-endings if required
            b)    Replace the paths of the downloaded files with the output directory for the target configuration
... while to merge the data between the two, at very least you need to:
            a)    Strip out the paths from both the download histories
            b)    Merge sort, removing duplicates
            c)    Reinstate the correct paths for each of the two configurations ... while you may wish also to remove other types of duplicates, say if the same programme has been downloaded multiple times at different resolutions, or otherwise clean up the data, say by throwing away unwanted fields to reduce the file size.

Similarly, merging the options is more complex than may at first appear, because some, such as exclusion terms, may be safely merged, while others, such as local program paths, absolutely must not be merged!

    2)    Cycle through a number of search lists calling get_iplayer to download each one with different parameters appropriate to each list.


_______________________________________________
get_iplayer mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/get_iplayer

Reply via email to