Skip to content

Commit

Permalink
fix: 400-client-error
Browse files Browse the repository at this point in the history
  • Loading branch information
poneoneo committed Sep 11, 2024
1 parent f43a13a commit eb2e118
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions your_daily_dose_malware/backends/malshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def scrap_malshare():
with Progress() as progress:
api_key = os.getenv("MALSHARE_API_KEY")
if api_key == "":
rich.print("[green]Skipping Malshare not api key")
rich.print("[red]Please set MALSHARE_API_KEY ")
return None
try:
response = requests.post(
Expand All @@ -28,11 +28,11 @@ def scrap_malshare():
hashes = response.json()
except requests.RequestException as err:
rich.print(f"[red] An error occurred: {err}")

return None
rich.print(f"[green] - Malshare: {len(hashes)} Samples")
sha256_ids = [hashe["sha256"] for hashe in hashes]
task = progress.add_task(
" - [green]Downloading Malware Files...", total=len(sha256_ids)
"-[green]Downloading Malware Files...", total=len(sha256_ids)
)
Path("Downloaded-Malwares").mkdir(exist_ok=True)
downloaded_malwares_path = Path("Downloaded-Malwares").absolute()
Expand Down
2 changes: 1 addition & 1 deletion your_daily_dose_malware/backends/malware_bazaar.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def all_most_recent(headers_info):

def scrap_malware_bazaar(hundred_recent):
if os.getenv("MALWARE_BAZAAR_API_KEY") == "":
rich.print("[green] Skipping Malware Bazaar not api key")
rich.print("[red]Please set MALWARE_BAZAAR_API_KEY")
return None
headers = {"API-KEY": os.getenv("MALWARE_BAZAAR_API_KEY")}
if hundred_recent:
Expand Down

0 comments on commit eb2e118

Please sign in to comment.