i want to download a subtitle from http://www.turkcealtyazi.org/sub/670264/fantastic-beasts-and-where-to-find-them.html
There is a button that redirects to "down.php" and starts the download.This the is button's html code:
<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>
This is my code, it downloads and saves the file without an error but the downloaded zip file is always corrupted.
import requests
def saveDisc(text):
f = open("subtitle.zip","w")
f.write(text)
f.close()
data = {'idid': "670441", 'altid':"670264",'sidid':"8a8ed56bafbf7df631e367f1289eb046"}
response = requests.post('http://www.turkcealtyazi.org/down.php', data=data)
print response.headers.get("Content-disposition") #output=attachment; filename=670264-Fantastic-Beasts-and-Where-to-Find-Them-2016-1CD-23.976fps-TR-29kB-TurkceAltyazi-org.zip
print len(response.content) #output=30539
saveDisc(response.content)
Why my zip-file is corrupt?