strawpoll-grab/disco-graphy.py

11 lines
1.7 KiB
Python

import os
#data = "\n".join([str(x) for x in range(1, 50000001)])
curl = """curl -i 'http://localhost:8501/strawpoll/admin/queues' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: multipart/form-data; boundary=---------------------------308383748137752883524073922649' -H 'Origin: http://localhost:8501' -H 'Authorization: Basic dGhldGVjaHJvYm86ZWxpdmVJU3RoZWJlc3Q0OQ==' -H 'Connection: keep-alive' -H 'Referer: http://localhost:8501/strawpoll/admin/queues' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-Fetch-Dest: document' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: same-origin' -H 'Sec-Fetch-User: ?1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-binary $'-----------------------------308383748137752883524073922649\r\nContent-Disposition: form-data; name="queue"\r\n\r\ntodo1\r\n-----------------------------308383748137752883524073922649\r\nContent-Disposition: form-data; name="downloader"\r\n\r\n\r\n-----------------------------308383748137752883524073922649\r\nContent-Disposition: form-data; name="check"\r\n\r\nyes\r\n-----------------------------308383748137752883524073922649\r\nContent-Disposition: form-data; name="items"\r\n\r\n%(items)s\r\n-----------------------------308383748137752883524073922649\r\nContent-Disposition: form-data; name="items-file"; filename=""\r\nContent-Type: application/octet-stream\r\n\r\n-----------------------------308383748137752883524073922649--\r\n'"""
for i in range(1, 50000001):
if i % 5 == 0:
print(i)
os.system(curl % {'items':str(i)})
#os.system(curl % data)