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.
 
 
 

29 lines
997 B

  1. diff --git a/libgrabsite/wpull_tweaks.py b/libgrabsite/wpull_tweaks.py
  2. index 6bef92d..401b3d9 100644
  3. --- a/libgrabsite/wpull_tweaks.py
  4. +++ b/libgrabsite/wpull_tweaks.py
  5. @@ -4,6 +4,7 @@ import functools
  6. from wpull.database.sqltable import SQLiteURLTable
  7. from wpull.document.html import HTMLReader
  8. +from wpull.network.dns import Resolver
  9. from wpull.processor.rule import ProcessingRule
  10. from libgrabsite import dupespotter
  11. @@ -55,8 +56,15 @@ class DupeSpottingProcessingRule(ProcessingRule):
  12. super().scrape_document(item_session)
  13. +class NoDnspythonResolver(Resolver):
  14. + def __init__(self, *args, **kwargs):
  15. + super().__init__(*args, **kwargs)
  16. + self.dns_python_enabled = False
  17. +
  18. +
  19. def activate(app_session):
  20. app_session.factory.class_map['URLTableImplementation'] = NoFsyncSQLTable
  21. + app_session.factory.class_map['Resolver'] = NoDnspythonResolver
  22. if int(os.environ["DUPESPOTTER_ENABLED"]):
  23. dupes_db_location = os.path.join(os.environ["GRAB_SITE_WORKING_DIR"], "dupes_db")