mirror of
				https://github.com/taixingyiji/openit.git
				synced 2025-10-31 01:52:15 +00:00 
			
		
		
		
	Update main.py
This commit is contained in:
		| @@ -7,10 +7,12 @@ import time | ||||
| import yaml | ||||
| import requests | ||||
|  | ||||
| headers = {'User-Agent': 'clash', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive'} | ||||
|  | ||||
| def fetch(proxy_list, filename): | ||||
|     current_date = time.strftime("%Y_%m_%d", time.localtime()) | ||||
|     baseurl = 'https://raw.githubusercontent.com/changfengoss/pub/main/data/' | ||||
|     working = yaml.safe_load(requests.get(url=baseurl + current_date + '/' + filename, ).text) | ||||
|     working = yaml.safe_load(requests.get(url=baseurl + current_date + '/' + filename, timeout=10).text) | ||||
|     data_out = [] | ||||
|     for x in working['proxies']: | ||||
|         data_out.append(x) | ||||
| @@ -19,7 +21,7 @@ def fetch(proxy_list, filename): | ||||
| def url(proxy_list, link): | ||||
|     try: | ||||
|         data_out=[] | ||||
|         working = yaml.safe_load(requests.get(url=link).text) | ||||
|         working = yaml.safe_load(requests.get(url=link,timeout=10, headers=headers).text) | ||||
|         for x in working['proxies']: | ||||
|             data_out.append(x) | ||||
|         proxy_list.append(data_out) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user