Skip to content

Instantly share code, notes, and snippets.

@ShaneLee
Created August 11, 2020 09:13
Show Gist options
  • Save ShaneLee/62bb4e0aa8ab4fc5d29982cfa4a56561 to your computer and use it in GitHub Desktop.
Save ShaneLee/62bb4e0aa8ab4fc5d29982cfa4a56561 to your computer and use it in GitHub Desktop.
import subprocess, urllib, random
class NoBlocks(Exception): pass
def getblocks():
r = urllib.urlopen("http://{?REDACTED?}/grab").read()
if '<html' in r.lower(): raise NoBlocks
return r.split()
import sys
if len(sys.argv) > 1:
prefix = ['--socks5', sys.argv[1]]
else:
prefix = []#'-interface','eth0:1']
line = lambda x: ['curl'] + prefix + ['-H', "Cookie: TENACIOUS=" + str(random.random())[3:], '-o', 'pdfs/' + str(x) + '.pdf', "http://www.jstor.org/stable/pdfplus/" + str(x) + ".pdf?acceptTC=true"]
while 1:
blocks = getblocks()
for block in blocks:
print block
subprocess.Popen(line(block)).wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment