App Store 增量 EPF 数据

发布于 2024-12-09 09:11:28 字数 1436 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

提笔落墨 2024-12-16 09:11:28

我通过curl做到了这一点,现在我也参与其中了。

$username = "username";
$password = "password";
$url = "http://feeds.itunes.apple.com/feeds/";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;

就是这么简单:)

I did it through curl and now i am in it.

$username = "username";
$password = "password";
$url = "http://feeds.itunes.apple.com/feeds/";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;

it was this much simple :)

只涨不跌 2024-12-16 09:11:28

在 python 中,您可以使用 requests library 例如,这可以很好地进行身份验证(并且您可以以更简单的方式编写下载逻辑。
它看起来像这样

username='yourusernamehere'
password='yourpasswordhere'
response = requests.get('https://feeds.itunes.apple.com/feeds/', auth=(username, password), stream=True)

请注意,我使用了 stream=True 机制,因为您将下载可能无法容纳在内存中的巨大文件,您应该像这样使用分块:

 with open(local_filename, 'wb') as f:
    for chunk in response.iter_content(chunk_size=1024):
        if chunk:  # filter out keep-alive new chunks
            f.write(chunk)
            f.flush()

In python you could use the requests library for example, that does Auth nicely (and you could write your download logic maybe in an easier fashion.
It would look like something like this

username='yourusernamehere'
password='yourpasswordhere'
response = requests.get('https://feeds.itunes.apple.com/feeds/', auth=(username, password), stream=True)

Note that I used the stream=True mechanism because you will be downloading huge files that probably will not fit in memory, you should use chunking like so:

 with open(local_filename, 'wb') as f:
    for chunk in response.iter_content(chunk_size=1024):
        if chunk:  # filter out keep-alive new chunks
            f.write(chunk)
            f.flush()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文