change config file(cdn_list, station_name.txt) load manage
							parent
							
								
									fa85652feb
								
							
						
					
					
						commit
						cf904073c4
					
				|  | @ -1,6 +1,7 @@ | ||||||
| # encoding=utf8 | # encoding=utf8 | ||||||
| import collections | import collections | ||||||
| import json | import json | ||||||
|  | import os | ||||||
| import re | import re | ||||||
| import sys | import sys | ||||||
| import csv | import csv | ||||||
|  | @ -53,7 +54,8 @@ class CDNProxy: | ||||||
|     def open_cdn_file(self): |     def open_cdn_file(self): | ||||||
|         cdn = [] |         cdn = [] | ||||||
|         cdn_re = re.compile("CONNECT (\S+) HTTP/1.1") |         cdn_re = re.compile("CONNECT (\S+) HTTP/1.1") | ||||||
|         with open("./cdn_list", "r") as f: |         path = os.path.join(os.path.dirname(__file__), '../cdn_list') | ||||||
|  |         with open(path, "r") as f: | ||||||
|             for i in f.readlines(): |             for i in f.readlines(): | ||||||
|                 # print(i.replace("\n", "")) |                 # print(i.replace("\n", "")) | ||||||
|                 cdn_list = re.findall(cdn_re, i) |                 cdn_list = re.findall(cdn_re, i) | ||||||
|  |  | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| # -*- coding=utf-8 -*- | # -*- coding=utf-8 -*- | ||||||
| import datetime | import datetime | ||||||
| import random | import random | ||||||
|  | import os | ||||||
| import socket | import socket | ||||||
| import sys | import sys | ||||||
| import threading | import threading | ||||||
|  | @ -118,7 +119,8 @@ class select: | ||||||
|         :param station: |         :param station: | ||||||
|         :return: |         :return: | ||||||
|         """ |         """ | ||||||
|         result = open('station_name.txt') |         path = os.path.join(os.path.dirname(__file__), '../station_name.txt') | ||||||
|  |         result = open(path) | ||||||
|         info = result.read().split('=')[1].strip("'").split('@') |         info = result.read().split('=')[1].strip("'").split('@') | ||||||
|         del info[0] |         del info[0] | ||||||
|         station_name = {} |         station_name = {} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 ttdevs
						ttdevs