mirror of https://github.com/testerSunshine/12306
change config file(cdn_list, station_name.txt) load manage
parent
fa85652feb
commit
cf904073c4
|
@ -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)
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in New Issue