在Mac上获取SHOUTcast元数据 [英] Getting SHOUTcast metadata on the Mac
本文介绍了在Mac上获取SHOUTcast元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Objective-C中创建一个应用程序,我需要从SHOUTcast流中获取元数据。我尝试过:
I'm creating an application in Objective-C and I need to get the metadata from a SHOUTcast stream. I tried this:
NSURL *URL = [NSURL URLWithString:@"http://202.4.100.2:8000/"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
[request addValue:@"1" forHTTPHeaderField:@"icy-metadata"];
[request addValue:@"Winamp 5/3" forHTTPHeaderField:@"User-Agent"];
[request addValue:@"audio/mpeg" forHTTPHeaderField:@"Content-Type"];
[NSURLConnection connectionWithRequest:request delegate:self];
我必须从这个请求中获取标题才能获得信息,对吗?不幸的是,它不断返回这些头文件:
I would have to get the headers from this request in order to get the information, right? Unfortunately it keeps returning these headers:
Date =17 Apr 2010 21:57:14 -0200;
Date = "17 Apr 2010 21:57:14 -0200";
"Max-Age" = 0;
我做错了什么?
推荐答案
我发现这个问题的答案。简单地在URL的末尾附加一个7.html并解析文件。
I found an answer to this question. Simply append a 7.html at the end of the URL and parse the file.
I.E。
http://38.96.148.138:7534/7.html
这篇关于在Mac上获取SHOUTcast元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文