使用Python从php页面获取文件
我想从下载一个字幕 有一个按钮重定向到“down.php”并开始下载。这是该按钮的html代码:使用Python从php页面获取文件,python,Python,我想从下载一个字幕 有一个按钮重定向到“down.php”并开始下载。这是该按钮的html代码: <form method="post" action="/down.php" > <div style="text-align:center"> <input type="hidden" name="idid" value="670441"> <input type="hidd
<form method="post" action="/down.php" >
<div style="text-align:center">
<input type="hidden" name="idid" value="670441">
<input type="hidden" name="altid" value="670264">
<input type="hidden" name="sidid" value="8a8ed56bafbf7df631e367f1289eb046">
<button type="submit" class="altIndirButton">
<span class="altIndir1"></span>
</button>
</div>
</form>
为什么我的zip文件已损坏
您正在以w+模式打开文件,因此它会将其解释为文本文件 Windows上的Python区分了文本文件和二进制文件; 文本文件中的行尾字符将自动更改 在读取或写入数据时,会稍微改变。这是在幕后进行的 对于ASCII文本文件,修改文件数据是可以的,但它会 损坏的二进制数据,如JPEG或EXE文件中的数据 二进制文件使用wb+模式。 像这样:
f = open("subtitle.zip","wb+")
非常感谢你,我花了好几个小时才把它修好。你只用了30秒,你太棒了。
f = open("subtitle.zip","wb+")