aboutsummaryrefslogtreecommitdiffstats
path: root/python/sandcrawler/ia.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-08-11 17:07:07 -0700
committerBryan Newbold <bnewbold@archive.org>2020-08-11 17:07:09 -0700
commit5c7f9bc60b372006adac8e47ee2f4f1f73b84897 (patch)
tree521d771057a71b40b4ebb8a85a16da2c568f4269 /python/sandcrawler/ia.py
parent33cc50939619d1c30bdfa800aba2137397a7ee0d (diff)
downloadsandcrawler-5c7f9bc60b372006adac8e47ee2f4f1f73b84897.tar.gz
sandcrawler-5c7f9bc60b372006adac8e47ee2f4f1f73b84897.zip
refactor: force_get -> force_simple_get
For clarity. The SPNv2 API hasn't changed, just changing the variable/parameter name.
Diffstat (limited to 'python/sandcrawler/ia.py')
-rw-r--r--python/sandcrawler/ia.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py
index 150de53..7b623bc 100644
--- a/python/sandcrawler/ia.py
+++ b/python/sandcrawler/ia.py
@@ -769,7 +769,7 @@ class SavePageNowClient:
self.poll_count = 60
self.poll_seconds = 3.0
- def save_url_now_v2(self, request_url, force_get=0, capture_outlinks=0):
+ def save_url_now_v2(self, request_url, force_simple_get=0, capture_outlinks=0):
"""
Returns a "SavePageNowResult" (namedtuple) if SPN request was processed
at all, or raises an exception if there was an error with SPN itself.
@@ -811,7 +811,7 @@ class SavePageNowClient:
'capture_outlinks': capture_outlinks,
'capture_screenshot': 0,
'if_not_archived_within': '1d',
- 'force_get': force_get,
+ 'force_get': force_simple_get,
'skip_first_archive': 1,
'outlinks_availability': 0,
'js_behavior_timeout': 0,
@@ -886,7 +886,7 @@ class SavePageNowClient:
None,
)
- def crawl_resource(self, start_url, wayback_client, force_get=0):
+ def crawl_resource(self, start_url, wayback_client, force_simple_get=0):
"""
Runs a SPN2 crawl, then fetches body from wayback.
@@ -895,9 +895,9 @@ class SavePageNowClient:
# HACK: capture CNKI domains with outlinks (for COVID-19 crawling)
if 'gzbd.cnki.net/' in start_url:
- spn_result = self.save_url_now_v2(start_url, force_get=force_get, capture_outlinks=1)
+ spn_result = self.save_url_now_v2(start_url, force_simple_get=force_simple_get, capture_outlinks=1)
else:
- spn_result = self.save_url_now_v2(start_url, force_get=force_get)
+ spn_result = self.save_url_now_v2(start_url, force_simple_get=force_simple_get)
if not spn_result.success:
status = spn_result.status