-
Notifications
You must be signed in to change notification settings - Fork 0
/
route.py
111 lines (75 loc) · 4.63 KB
/
route.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# -*- coding: utf-8 -
# This file - route.py, is part of directord.
import re
import random
def dispatchvod (medianame):
return random.choice(("10.49.34.67", "10.49.34.68", "10.49.34.69", "10.49.34.70", "10.49.34.71"))
def route (medianame):
if re.match ("^VOD\S+", medianame): # VOD find
return dispatchvod (medianame)
if re.match ("^41243\S+", medianame): # CCTV-1 find
return random.choice (("10.49.34.67", "10.49.34.68"))
if re.match ("^41242\S+", medianame): # CCTV-2 find
return random.choice (("10.49.34.67", "10.49.34.68"))
if re.match ("^41241\S+", medianame): # CCTV-3 find
return random.choice (("10.49.34.67", "10.49.34.68"))
if re.match ("^41240\S+", medianame): # CCTV-4 find
return random.choice (("10.49.34.67", "10.49.34.68"))
if re.match ("^41239\S+", medianame): # CCTV-5 find
return random.choice (("10.49.34.67", "10.49.34.68"))
if re.match ("^41238\S+", medianame): # CCTV-6 find
return random.choice (("10.49.34.67", "10.49.34.68"))
if re.match ("^41237\S+", medianame): # CCTV-8 find
return random.choice (("10.49.34.68", "10.49.34.69"))
if re.match ("^41236\S+", medianame): # CCTV-10 find
return random.choice (("10.49.34.68", "10.49.34.69"))
if re.match ("^41235\S+", medianame): # CCTV-xinwen find
return random.choice (("10.49.34.68", "10.49.34.69"))
if re.match ("^41234\S+", medianame): # An Hui find
return random.choice (("10.49.34.68", "10.49.34.69"))
if re.match ("^41233\S+", medianame): # Hu Nani find
return random.choice (("10.49.34.68", "10.49.34.69"))
if re.match ("^41232\S+", medianame): # Dong Fang Wei Shi find
return random.choice (("10.49.34.68", "10.49.34.69"))
if re.match ("^41231\S+", medianame): # Zhe Jiang Wei Shi find
return random.choice (("10.49.34.69", "10.49.34.70"))
if re.match ("^41230\S+", medianame): # Jiang Su Wei Shi find
return random.choice (("10.49.34.69", "10.49.34.70"))
if re.match ("^41229\S+", medianame): # Chang Zhou Xin Wen find
return random.choice (("10.49.34.69", "10.49.34.70"))
if re.match ("^41228\S+", medianame): # Hu Bei Wei Shi find
return random.choice (("10.49.34.69", "10.49.34.70"))
if re.match ("^41227\S+", medianame): # Shan Dong Wei Shi find
return random.choice (("10.49.34.69", "10.49.34.70"))
if re.match ("^41226\S+", medianame): # Guang Dong Wei Shi find
return random.choice (("10.49.34.69", "10.49.34.70"))
if re.match ("^41225\S+", medianame): # Wu Jin Xin Wen find
return random.choice (("10.49.34.70", "10.49.34.71"))
if re.match ("^41224\S+", medianame): # He Nan Wei Shi find
return random.choice (("10.49.34.70", "10.49.34.71"))
if re.match ("^41223\S+", medianame): # Dong Zuo Dian Ying find
return random.choice (("10.49.34.70", "10.49.34.71"))
if re.match ("^41222\S+", medianame): # Jia Ting Ying Yuan find
return random.choice (("10.49.34.70", "10.49.34.71"))
if re.match ("^41221\S+", medianame): # Di Yi Ju Chang find
return random.choice (("10.49.34.70", "10.49.34.71"))
if re.match ("^41220\S+", medianame): # 7 Cai xi ju find
return random.choice (("10.49.34.70", "10.49.34.71"))
if re.match ("^41219\S+", medianame): # Feng Yun Yin Yue find
return random.choice (("10.49.34.71", "10.49.34.67"))
if re.match ("^41218\S+", medianame): # You Xi Feng Yun find
return random.choice (("10.49.34.71", "10.49.34.67"))
if re.match ("^41217\S+", medianame): # Dong Man Xiu Chang find
return random.choice (("10.49.34.71", "10.49.34.67"))
if re.match ("^41216\S+", medianame): # Jin Bao Ti Yu find
return random.choice (("10.49.34.71", "10.49.34.67"))
if re.match ("^41215\S+", medianame): # Feng Yun Zu Qiu find
return random.choice (("10.49.34.71", "10.49.34.67"))
if re.match ("^41214\S+", medianame): # 4 Hai Diao Yu find
return random.choice (("10.49.34.71", "10.49.34.67"))
return None
if __name__ == "__main__":
medianame = "VODC2011011613583204.ts"
print "%s ---> %s" % (medianame, route (medianame))
medianame = "412432011011613583204.ts"
print "%s ---> %s" % (medianame, route (medianame))