Browse Source

Fixes #40 (hopefully, didn't test)

master
Abrax 3 years ago
parent
commit
830e5ad962
2 changed files with 8 additions and 1 deletions
  1. 1
    0
      README.md
  2. 7
    1
      lizard/web_methods.py

+ 1
- 0
README.md View File

@@ -33,6 +33,7 @@ Command syntax changes:

Tor features:
- `lizard tor` will now auto-open the tor captcha page for convenience. ([#42](https://git.teknik.io/abrax/lizard/issues/42))
- When any web request receives a 403, a more informative message is printed. ([#40](https://git.teknik.io/abrax/lizard/issues/40)

Bugfixes:
- `lizard create` command now working. ([#43](https://git.teknik.io/abrax/lizard/issues/45))

+ 7
- 1
lizard/web_methods.py View File

@@ -71,8 +71,14 @@ def download_file(file_url, file_path):
elif r.status_code == 504:
print("Server busy (504), couldn't get {}, try again later.".format(file_url))
return False
elif r.status_code == 403:
print("8ch.net returned 403 (forbidden). There can be many reasons for this, but a common one is trying to "
"connect to 8ch.net (instead oxwugzccvk3dk6tj.onion) through Tor. If you are using Tor, "
"please substitute r commands with tr (trl, trc, etc).")
return False
else:
raise RuntimeError("Unexpected status code {} while trying to fetch {} - try opening in the browser, if that doesn't work submit an issue to the tracker.".format(r.status_code, file_url))
raise RuntimeError("Unexpected status code {} while trying to fetch {} - try opening in the browser, "
"if that doesn't work submit an issue to the tracker.".format(r.status_code, file_url))


def generate_thread_json_url(board, thread_no):

Loading…
Cancel
Save