Anonymous 08/17/23(Thu)03:51:12 No.40232552▶>>40232586 >>40232678 >>40237366 >>40229035 >improve it Was kinda a pain in the ass to figure this out (I'm sorta used to the pain of programming), but wow, I thought it would be harder to do. Finished, I guess: >#!/usr/bin/env python3 >import argparse >import subprocess >import re >def obj_links(start): > command1 = subprocess.Popen(['ipfs', 'object', 'links', start], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) > out, err = command1.communicate() > errcode = command1.returncode > if len(str(out)) == 3: > return > output1 = re.sub("\\\\n", "\\\\n" + start + " -> ", re.sub("\\\\n.$", "", re.sub(r"^..", start + " -> ", str(out)))) > output2 = output1.split("\\n") > for x in output2: > print(x) > cids2 = [] > for x in output2: > cids2.append(str(re.sub(" .*", "", re.sub("^Qm................................................", "", x)))) > for n in cids2: > obj_links(n) >obj_links("QmYKnbVVwuCC2MDaxnikgZf4Xk12h6gjQquy6DkhJNa1Lo") Recursive function to recursively list a directory. I think it works with more complex folders too. This would have been helpful to have months ago, when this one multi-terabyte MLP-related folder was still alive. Page 10 so no image.