如何 wget/curl 通过重定向来下载内容?
How to wget/curl past a redirect to download content?
我想使用 wget
、curl
甚至使用 Perl 每晚从 ShareLatex 下载我的项目副本,但是当我在 Chrome,我看到它在成功登录时从 /login
重定向到 /projects
。
由于重定向,我刷新了 Chrome 网络调试日志,但如果我进行了错误的登录尝试,我可以看到它发送的内容。请参阅下面的屏幕截图。
问题
任何人都可以解释我如何找出应该 post 的字符串才能登录吗?
_csrf
header 字符串重要吗?
我运气不好
curl -s --cookie-jar cookie https://sharelatex.com/login
curl -s --cookie cookie -H 'email: my@email.com' -H 'password: mypw' https://sharelatex.com/login
因为它只是给我一个失败的登录屏幕。
在curl
中使用-L
选项:
curl -s -L -H 'email: my@email.com' -H 'password: mypw' https://sharelatex.com/login
我想使用 wget
、curl
甚至使用 Perl 每晚从 ShareLatex 下载我的项目副本,但是当我在 Chrome,我看到它在成功登录时从 /login
重定向到 /projects
。
由于重定向,我刷新了 Chrome 网络调试日志,但如果我进行了错误的登录尝试,我可以看到它发送的内容。请参阅下面的屏幕截图。
问题
任何人都可以解释我如何找出应该 post 的字符串才能登录吗?
_csrf
header 字符串重要吗?
我运气不好
curl -s --cookie-jar cookie https://sharelatex.com/login
curl -s --cookie cookie -H 'email: my@email.com' -H 'password: mypw' https://sharelatex.com/login
因为它只是给我一个失败的登录屏幕。
在curl
中使用-L
选项:
curl -s -L -H 'email: my@email.com' -H 'password: mypw' https://sharelatex.com/login