Metrics:
Total lines of code: 199
Total lines skipped (#nosec): 0

request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/comfyui_lumaAPI/generator.py
Line number: 16
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
12	}
13	
14	def get_video_response(ids):
15	    api_url = f"{lumalabs_internal_url}/{ids}"
16	    response = requests.get(url = api_url,headers = COMMON_HEADERS)
17	    return response.json()
18	
19	def get_video(ids):
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/comfyui_lumaAPI/generator.py
Line number: 31
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
27	    params = {
28	        'file_type': 'image',
29	        'filename': 'file.jpg'
30	    }
31	    response = requests.post(full_url, params = params, cookies = Cookie)
32	    presigned_url, public_url = response.json()["presigned_url"], response.json()["public_url"]
33	    print(presigned_url)
34	    print(public_url)
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/comfyui_lumaAPI/generator.py
Line number: 42
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
38	    try:
39	        presigned_url, public_url =  get_upload_link(Cookie)
40	        time.sleep(1)
41	        with open(file_path, 'rb') as file:
42	            response = requests.put(presigned_url, data=file,
43	                        headers={'Content-Type': "image/*", "Referer": "https://lumalabs.ai/", "origin": "https://lumalabs.ai"})
44	
45	        if response.status_code == 200:
46	            print("Upload successful:", public_url)
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/comfyui_lumaAPI/generator.py
Line number: 58
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
54	def upload_file_comfyui(Cookie, binary_image):
55	    try:
56	        presigned_url, public_url = get_upload_link(Cookie)
57	        time.sleep(1)
58	        response = requests.put(presigned_url, data=binary_image,
59	                        headers={'Content-Type': "image/*", "Referer": "https://lumalabs.ai/", "origin": "https://lumalabs.ai"})
60	
61	        if response.status_code == 200:
62	            print("Upload successful:", public_url)
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/comfyui_lumaAPI/generator.py
Line number: 93
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
89	        else:
90	            return "Something Wrong"
91	
92	
93	    response = requests.post(lumalabs_internal_url, json=payload, cookies = Cookie_dict, headers=COMMON_HEADERS)
94	    response_json = response.json()
95	    return response_json
96	
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/comfyui_lumaAPI/generator.py
Line number: 101
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
97	def check_res(Cookie = str):
98	    try:
99	        url =  "https://internal-api.virginia.labs.lumalabs.ai/api/photon/v1/user/generations/"
100	        params = {"offset": "0", "limit": "10"}
101	        res = requests.get(url,headers = {"Cookie":Cookie},params = params)
102	        return res.json()
103	    except Exception as ex:
104	        print("Failed to get result: %s"%ex)
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/comfyui_lumaAPI/generator.py
Line number: 113
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
109	        if ids == i['id']:
110	            video_url = i["video"]['url']
111	            if download:
112	                with open(output_name, 'wb') as file:
113	                    response = requests.get(video_url, stream=True)
114	                    for chunk in response.iter_content(chunk_size=1024):
115	                        if chunk:
116	                            file.write(chunk)