0

get_iplayer allows user to download files from the BBC iPlayer service. It is awesome, they both are.

I'm attempting to run a get_iplayer command from within Xcode using NSTask:

NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/users/myuser/documents/get_iplayer_install/get_iplayer"];
NSArray *args = @[@"--type=radio",@"--pid",  @"--modes=flashaacstd,rtspaaclow",  @"b006tnvx"];
[task setArguments:args];
[task launch];
[task waitUntilExit];

This is intended to do the same job as when I run this from terminal:

get_iplayer --type=radio --pid b006tnvx

However, it produces this output:

get_iplayer v2.90, Copyright (C) 2008-2010 Phil Lewis
This program comes with ABSOLUTELY NO WARRANTY; for details use --warranty.
This is free software, and you are welcome to redistribute it under certain
conditions; use --conditions for details.

WARNING: rdf URL contained no data
WARNING: PID URL contained no RDF data. Trying to record PID directly.
INFO: Trying pid: --modes=flashaaclow using type: radio
INFO: Trying to stream pid using type radio
INFO: pid not found in radio cache
Matches:

INFO: 1 Matching Programmes

ERROR: Failed to get version pid metadata from iplayer site

WARNING: rdf URL contained no data
WARNING: PID URL contained no RDF data. Trying to record PID directly.
INFO: Trying pid: flashaacstd using type: radio
INFO: Trying to stream pid using type radio
INFO: pid not found in radio cache
Matches:

INFO: 1 Matching Programmes

ERROR: Failed to get version pid metadata from iplayer site

Program ended with exit code: 0

Whereas it ought to produce something like this:

enter image description here

I don't think this is a get_iplayer question, it's my lack of understanding about NSTask and probably about how unix works.

Can you point me in the right direction?

Cheers, Andy

Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247
Return_Of_The_Archons
  • 1,731
  • 3
  • 20
  • 26
  • 1
    You can try http://stackoverflow.com/questions/17976289/executing-shell-commands-with-nstask-objective-c-cocoa – Wain Dec 14 '14 at 14:23

1 Answers1

1

Your arguments are in the wrong order. You've got the --modes argument and value in between the --pid argument in value.

The output says as much by saying it can't find a pid with the name of the name of --modes=flashaaclow

macshome
  • 939
  • 6
  • 11