Created
April 7, 2018 22:23
-
-
Save GitPatrickHarris/80b31ae9f700b1063244dbd469835d61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment