获取完整的 html 源代码并绕过

发布于 2024-12-15 04:09:35 字数 640 浏览 5 评论 0原文

好的,所以我正在尝试使用 mp3 转换器制作一个 youtube 下载器

有一个很棒的网站可以为我做这件事...

我可以发送链接并它处理信息...

但是当我要使用源下载时(提取链接),它只是给了我

<noscript>
<div class="warning">You have to enable JavaScript to use this Service!</div>

并且链接不存在

如果我使用 Chrome,来源是:

<div id="dl_link" style="display: block; "> <a href="/get?video_id=UA8rcLvS1BY&amp;h=8a4dfe7979a47aae13e47dad3999d09e"> <b>Download</b></a> · <a href="#" onclick="showLinkBox(); return false;">Link this mp3</a></div>

如何在用户不单击任何内容的情况下获取并下载它!

Ok, so I am trying to make a youtube downloader with mp3 converter

There is this awesome site that does it for me...

I can send the link and it processes the information...

However when I am about to download using the source (extracting link), it just gives me

<noscript>
<div class="warning">You have to enable JavaScript to use this Service!</div>

And the link is not present

If i use chrome, the source is:

<div id="dl_link" style="display: block; "> <a href="/get?video_id=UA8rcLvS1BY&h=8a4dfe7979a47aae13e47dad3999d09e"> <b>Download</b></a> · <a href="#" onclick="showLinkBox(); return false;">Link this mp3</a></div>

How do I get it and download it without the user clicking anything!

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

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

发布评论

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

评论(2

素食主义者 2024-12-22 04:09:35

curl 似乎支持它。尝试使用 Process.Start 调用它?

curl seems to support it. Try calling that with Process.Start ?

夜雨飘雪 2024-12-22 04:09:35

猜测第一:他们的网站使用请求标头来确定您使用的浏览器是否支持 javascript...

尝试设置 User-Agent http 标头在您发出请求时模仿合适的浏览器,并查看它们是否以正确的响应进行响应。

更新
由于猜测离谱,需要更多信息,我建议使用 Fiddler 来工作找出您的浏览器与其服务之间来回发送的内容,并尝试在您的代码中重现此行为。

Guess number one: Their site uses the request headers to figure out if the browser you're using supports javascript...

Try setting the User-Agent http header to mimic a suitable browser when you make your request and see if they respond with the correct response.

Update
Since guess one was wide of the mark, more information is required, I'd suggest using Fiddler to work out what is being sent back and forth between your browser and their service, and try to reproduce this behaviour in your code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文