|
|
@ -21,11 +21,12 @@ def todarkive(s,folder,filename): |
|
|
|
sys.stderr.write('# Wrote file: {}\n'.format(filename)) |
|
|
|
sys.stderr.write('# Wrote file: {}\n'.format(filename)) |
|
|
|
|
|
|
|
|
|
|
|
def daget(pasteid): |
|
|
|
def daget(pasteid): |
|
|
|
pasteid = pasteid.split('/')[-1] # in case it's a full url |
|
|
|
|
|
|
|
if '#' in pasteid: |
|
|
|
if '#' in pasteid: |
|
|
|
p,needhash = pasteid.split('#') |
|
|
|
p,needhash = pasteid.split('#') |
|
|
|
else: |
|
|
|
else: |
|
|
|
p,needhash = pasteid,None |
|
|
|
p,needhash = pasteid,None |
|
|
|
|
|
|
|
# Split *after* we split by "#" (sometimes hash contains /). |
|
|
|
|
|
|
|
p = p.split('/')[-1] # in case it's a full url |
|
|
|
sys.stderr.write('# getting paste {}\n'.format(p)) |
|
|
|
sys.stderr.write('# getting paste {}\n'.format(p)) |
|
|
|
payload = pasteclient.sloppy_get(p) |
|
|
|
payload = pasteclient.sloppy_get(p) |
|
|
|
if not payload: |
|
|
|
if not payload: |
|
|
|