From 5040ba8a7e0e8b377452ae3c06325f83d4c48c6b Mon Sep 17 00:00:00 2001 From: matan Date: Wed, 18 Oct 2023 11:20:36 +0300 Subject: [PATCH 1/2] init --- CHANGES | 4 ++++ intezer_sdk/__init__.py | 2 +- intezer_sdk/analysis.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index c8fdcb7..78a1c48 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1.19.5 +------ +- Latest URL analysis fallback. + 1.19.4 ------ - Add global API custom instance setter. diff --git a/intezer_sdk/__init__.py b/intezer_sdk/__init__.py index d81ac8e..7816d82 100644 --- a/intezer_sdk/__init__.py +++ b/intezer_sdk/__init__.py @@ -1 +1 @@ -__version__ = '1.19.4' +__version__ = '1.19.5' diff --git a/intezer_sdk/analysis.py b/intezer_sdk/analysis.py index eb1a86f..92de101 100644 --- a/intezer_sdk/analysis.py +++ b/intezer_sdk/analysis.py @@ -400,8 +400,9 @@ def from_latest_analysis(cls, api=api) all_analyses_reports = analysis_history_url_result.all() + analyses_ids = [report['analysis_id'] for report in all_analyses_reports - if url in (report['scanned_url'], report['submitted_url'])] + if url in (report.get('scanned_url'), report.get('submitted_url'))] if not analyses_ids and not exact_match: analyses_ids = [report['analysis_id'] for report in all_analyses_reports if _clean_url(url) in (_clean_url(report['scanned_url']), _clean_url(report['submitted_url']))] From e291047a4054bba60dd894a82fb9c3cdfc19e853 Mon Sep 17 00:00:00 2001 From: matan Date: Wed, 18 Oct 2023 11:22:50 +0300 Subject: [PATCH 2/2] init --- intezer_sdk/analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intezer_sdk/analysis.py b/intezer_sdk/analysis.py index 92de101..7f16078 100644 --- a/intezer_sdk/analysis.py +++ b/intezer_sdk/analysis.py @@ -405,7 +405,7 @@ def from_latest_analysis(cls, if url in (report.get('scanned_url'), report.get('submitted_url'))] if not analyses_ids and not exact_match: analyses_ids = [report['analysis_id'] for report in all_analyses_reports - if _clean_url(url) in (_clean_url(report['scanned_url']), _clean_url(report['submitted_url']))] + if _clean_url(url) in (_clean_url(report.get('scanned_url', '')), _clean_url(report.get('submitted_url', '')))] if not analyses_ids: return None