A framework for quick web archiving
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.2 KiB

  1. STATUS_TODO = 0
  2. '''Status of an item that has not been processed yet'''
  3. STATUS_INPROGRESS = 1
  4. '''Status of an item that is currently being processed'''
  5. STATUS_DONE = 2
  6. '''Status of an item that has been processed'''
  7. STATUS_ERROR = 3
  8. '''Status of an item during whose processing an error occurred'''
  9. ACTION_SUCCESS = 0
  10. '''Treat this response as a success'''
  11. ACTION_IGNORE = 1 #TODO Replace with ACTION_SUCCESS since it's really the same thing.
  12. '''Ignore this response'''
  13. ACTION_RETRY = 2
  14. '''Retry the same request'''
  15. ACTION_FOLLOW_OR_SUCCESS = 3
  16. '''If the response contains a Location or URI header, follow it. Otherwise, treat it as a success.'''
  17. #TODO: Rename to ACTION_FOLLOW maybe? However, the current name makes it more clear what qwarc does when there's a redirect without a redirect target...
  18. ACTION_RETRIES_EXCEEDED = 4
  19. '''This request failed repeatedly and exceeded the retry limit.'''
  20. ACTION_TOO_MANY_REDIRECTS = 5
  21. '''Too many redirects were encountered.'''
  22. DEFAULT_HEADERS = [
  23. ('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'),
  24. ('Accept', '*/*'),
  25. ]
  26. '''The default HTTP headers sent on every request if not overridden'''