change config file(cdn_list, station_name.txt) load manage

pull/73/head
ttdevs 2019-01-04 11:00:10 +08:00
parent fa85652feb
commit cf904073c4
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# encoding=utf8
import collections
import json
import os
import re
import sys
import csv
@ -53,7 +54,8 @@ class CDNProxy:
def open_cdn_file(self):
cdn = []
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():
# print(i.replace("\n", ""))
cdn_list = re.findall(cdn_re, i)

View File

@ -1,6 +1,7 @@
# -*- coding=utf-8 -*-
import datetime
import random
import os
import socket
import sys
import threading
@ -118,7 +119,8 @@ class select:
:param station:
: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('@')
del info[0]
station_name = {}