Commit eb2e118 1 parent f43a13a commit eb2e118 Copy full SHA for eb2e118
File tree 2 files changed +4
-4
lines changed
your_daily_dose_malware/backends
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def scrap_malshare():
16
16
with Progress () as progress :
17
17
api_key = os .getenv ("MALSHARE_API_KEY" )
18
18
if api_key == "" :
19
- rich .print ("[green]Skipping Malshare not api key " )
19
+ rich .print ("[red]Please set MALSHARE_API_KEY " )
20
20
return None
21
21
try :
22
22
response = requests .post (
@@ -28,11 +28,11 @@ def scrap_malshare():
28
28
hashes = response .json ()
29
29
except requests .RequestException as err :
30
30
rich .print (f"[red] An error occurred: { err } " )
31
-
31
+ return None
32
32
rich .print (f"[green] - Malshare: { len (hashes )} Samples" )
33
33
sha256_ids = [hashe ["sha256" ] for hashe in hashes ]
34
34
task = progress .add_task (
35
- " - [green]Downloading Malware Files..." , total = len (sha256_ids )
35
+ "- [green]Downloading Malware Files..." , total = len (sha256_ids )
36
36
)
37
37
Path ("Downloaded-Malwares" ).mkdir (exist_ok = True )
38
38
downloaded_malwares_path = Path ("Downloaded-Malwares" ).absolute ()
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ def all_most_recent(headers_info):
116
116
117
117
def scrap_malware_bazaar (hundred_recent ):
118
118
if os .getenv ("MALWARE_BAZAAR_API_KEY" ) == "" :
119
- rich .print ("[green] Skipping Malware Bazaar not api key " )
119
+ rich .print ("[red]Please set MALWARE_BAZAAR_API_KEY " )
120
120
return None
121
121
headers = {"API-KEY" : os .getenv ("MALWARE_BAZAAR_API_KEY" )}
122
122
if hundred_recent :
You can’t perform that action at this time.
0 commit comments