(tid, name)
| 57 | |
| 58 | |
| 59 | def visit_thread(tid, name): |
| 60 | path = "/read-htm-tid-%s.html" % tid |
| 61 | if path in done_urls: |
| 62 | logging.info(" skip %-30s %s" % (path, name)) |
| 63 | return |
| 64 | else: |
| 65 | logging.info("Visit %-30s %s" % (path, name)) |
| 66 | done_urls.add(path) |
| 67 | rsp = get(path) |
| 68 | attchments = re.findall(re_attchment, rsp.text) |
| 69 | if not attchments: |
| 70 | logging.error("No attachment in %s" % path) |
| 71 | return |
| 72 | for path, name in attchments: |
| 73 | for f in formats: |
| 74 | if name.endswith(f): |
| 75 | download(path, name) |
| 76 | |
| 77 | |
| 78 | def visit_board(): |
no test coverage detected