Add 'manual_run.py'
This commit is contained in:
		
							
								
								
									
										19
									
								
								manual_run.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								manual_run.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
import requests
 | 
			
		||||
import os.path
 | 
			
		||||
import json
 | 
			
		||||
from datetime import datetime
 | 
			
		||||
 | 
			
		||||
URL = "http://10.97.160.25/sample"
 | 
			
		||||
 | 
			
		||||
FILE = 'CommonStarling_100962.wav'
 | 
			
		||||
 | 
			
		||||
files = {
 | 
			
		||||
	"file": (os.path.basename(FILE), open(FILE,'rb').read(), 'audio/wave', {'Content-length' : os.path.getsize(FILE)}),
 | 
			
		||||
	"description" : (None, json.dumps({'date' : datetime.now().isoformat(), 'device_id' : '123'}), "application/json")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
r = requests.post(URL,files=files)
 | 
			
		||||
print("Content: ", r.content)
 | 
			
		||||
print("Headers:", r.headers)
 | 
			
		||||
r.raise_for_status()
 | 
			
		||||
		Reference in New Issue
	
	Block a user