【发布时间】:2014-12-14 13:38:32
【问题描述】:
get_iplayer 允许用户从 BBC iPlayer 服务下载文件。太棒了,他们俩都是。
我正在尝试使用 NSTask 从 Xcode 中运行 get_iplayer 命令:
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];
这与我从终端运行时的工作相同:
get_iplayer --type=radio --pid b006tnvx
但是,它会产生以下输出:
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
而它应该产生一些类似的东西:
我不认为这是一个 get_iplayer 问题,这是我对 NSTask 以及可能是 unix 的工作原理缺乏了解。
你能指出我正确的方向吗?
干杯, 安迪
【问题讨论】:
标签: objective-c macos terminal nstask