import requests
import os

# file url
file_url = "https://api.viperhelmets.com/API/getAllStyleBrandProducts_csv.php"


download_folder = "/home/motortex836/public_html/ftp-test/viper/"


os.makedirs(download_folder, exist_ok=True)

csv_file = os.path.join(download_folder, "stock.csv")


# direct csv download
response = requests.get(file_url)

with open(csv_file, "wb") as file:
    file.write(response.content)

print("CSV file downloaded successfully")
