chuzhong.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. #coding=utf-8
  2. #!/usr/bin/python
  3. import sys
  4. sys.path.append('..')
  5. from base.spider import Spider
  6. import json
  7. import time
  8. import base64
  9. class Spider(Spider): # 元类 默认的元类 type
  10. def getName(self):
  11. return "初中"
  12. def init(self,extend=""):
  13. print("============{0}============".format(extend))
  14. pass
  15. def isVideoFormat(self,url):
  16. pass
  17. def manualVideoCheck(self):
  18. pass
  19. def homeContent(self,filter):
  20. result = {}
  21. cateManual = {
  22. "初一语文":"初一语文",
  23. "初一数学":"初一数学",
  24. "初一英语":"初一英语",
  25. "初一历史":"初一历史",
  26. "初一地理":"初一地理",
  27. "初一生物":"初一生物",
  28. "初一化学":"初一化学",
  29. "初二语文":"初二语文",
  30. "初二数学":"初二数学",
  31. "初二英语":"初二英语",
  32. "初二历史":"初二历史",
  33. "初二地理":"初二地理",
  34. "初二化学":"初二化学",
  35. "初三语文":"初三语文",
  36. "初三数学":"初三数学",
  37. "初三英语":"初三英语",
  38. "初三历史":"初三历史",
  39. "初三地理":"初三地理",
  40. "初三生物":"初三生物",
  41. "初三物理":"初三物理",
  42. "初三化学":"初三化学"
  43. }
  44. classes = []
  45. for k in cateManual:
  46. classes.append({
  47. 'type_name':k,
  48. 'type_id':cateManual[k]
  49. })
  50. result['class'] = classes
  51. if(filter):
  52. result['filters'] = self.config['filter']
  53. return result
  54. def homeVideoContent(self):
  55. result = {
  56. 'list':[]
  57. }
  58. return result
  59. cookies = ''
  60. def getCookie(self):
  61. import requests
  62. import http.cookies
  63. # 这里填cookie
  64. raw_cookie_line = "innersign=0;buvid3=E0C6010B-08CF-AE9C-FD18-0EC14F2AA35429667infoc; b_lsid=D101097FB2_187C825C5D7; _uuid=29167C75-10922-A764-5757-EC106517B471831442infoc; buvid4=59789C83-B64B-148E-A8FD-585BB3D0300830827-123042821-WOiBDeHIjjEhSRIFCi5kfQ%3D%3D; buvid_fp=3ee98313cd55b76fe3cb63a36d9d41c9; b_nut=100; SESSDATA=4fe90c6b%2C1698242168%2C30912%2A41; bili_jct=faffed7de17218860f3aa958182ca2ee; DedeUserID=516036434; DedeUserID__ckMd5=4e5107a4bc891865; sid=q2dc0y62"
  65. simple_cookie = http.cookies.SimpleCookie(raw_cookie_line)
  66. cookie_jar = requests.cookies.RequestsCookieJar()
  67. cookie_jar.update(simple_cookie)
  68. return cookie_jar
  69. def get_dynamic(self,pg):
  70. result = {}
  71. url= 'https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=all&page={0}'.format(pg)
  72. rsp = self.fetch(url,cookies=self.getCookie())
  73. content = rsp.text
  74. jo = json.loads(content)
  75. if jo['code'] == 0:
  76. videos = []
  77. vodList = jo['data']['items']
  78. for vod in vodList:
  79. if vod['type'] == 'DYNAMIC_TYPE_AV':
  80. ivod = vod['modules']['module_dynamic']['major']['archive']
  81. aid = str(ivod['aid']).strip()
  82. title = ivod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
  83. img = ivod['cover'].strip()
  84. remark = str(ivod['duration_text']).strip()
  85. videos.append({
  86. "vod_id":aid,
  87. "vod_name":title,
  88. "vod_pic":img,
  89. "vod_remarks":remark
  90. })
  91. result['list'] = videos
  92. result['page'] = pg
  93. result['pagecount'] = 9999
  94. result['limit'] = 90
  95. result['total'] = 999999
  96. return result
  97. def get_hot(self,pg):
  98. result = {}
  99. url= 'https://api.bilibili.com/x/web-interface/popular?ps=20&pn={0}'.format(pg)
  100. rsp = self.fetch(url,cookies=self.getCookie())
  101. content = rsp.text
  102. jo = json.loads(content)
  103. if jo['code'] == 0:
  104. videos = []
  105. vodList = jo['data']['list']
  106. for vod in vodList:
  107. aid = str(vod['aid']).strip()
  108. title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
  109. img = vod['pic'].strip()
  110. remark = str(vod['duration']).strip()
  111. videos.append({
  112. "vod_id":aid,
  113. "vod_name":title,
  114. "vod_pic":img,
  115. "vod_remarks":remark
  116. })
  117. result['list'] = videos
  118. result['page'] = pg
  119. result['pagecount'] = 9999
  120. result['limit'] = 90
  121. result['total'] = 999999
  122. return result
  123. def get_rank(self):
  124. result = {}
  125. url= 'https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all'
  126. rsp = self.fetch(url,cookies=self.getCookie())
  127. content = rsp.text
  128. jo = json.loads(content)
  129. if jo['code'] == 0:
  130. videos = []
  131. vodList = jo['data']['list']
  132. for vod in vodList:
  133. aid = str(vod['aid']).strip()
  134. title = vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
  135. img = vod['pic'].strip()
  136. remark = str(vod['duration']).strip()
  137. videos.append({
  138. "vod_id":aid,
  139. "vod_name":title,
  140. "vod_pic":img,
  141. "vod_remarks":remark
  142. })
  143. result['list'] = videos
  144. result['page'] = 1
  145. result['pagecount'] = 1
  146. result['limit'] = 90
  147. result['total'] = 999999
  148. return result
  149. def categoryContent(self,tid,pg,filter,extend):
  150. result = {}
  151. if tid == "热门":
  152. return self.get_hot(pg=pg)
  153. if tid == "排行榜" :
  154. return self.get_rank()
  155. if tid == '动态':
  156. return self.get_dynamic(pg=pg)
  157. url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={0}&page={1}'.format(tid,pg)
  158. if len(self.cookies) <= 0:
  159. self.getCookie()
  160. rsp = self.fetch(url,cookies=self.getCookie())
  161. content = rsp.text
  162. jo = json.loads(content)
  163. if jo['code'] != 0:
  164. rspRetry = self.fetch(url,cookies=self.getCookie())
  165. content = rspRetry.text
  166. jo = json.loads(content)
  167. videos = []
  168. vodList = jo['data']['result']
  169. for vod in vodList:
  170. aid = str(vod['aid']).strip()
  171. title = tid + ":" + vod['title'].strip().replace("<em class=\"keyword\">","").replace("</em>","")
  172. img = 'https:' + vod['pic'].strip()
  173. remark = str(vod['duration']).strip()
  174. videos.append({
  175. "vod_id":aid,
  176. "vod_name":title,
  177. "vod_pic":img,
  178. "vod_remarks":remark
  179. })
  180. result['list'] = videos
  181. result['page'] = pg
  182. result['pagecount'] = 9999
  183. result['limit'] = 90
  184. result['total'] = 999999
  185. return result
  186. def cleanSpace(self,str):
  187. return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','')
  188. def detailContent(self,array):
  189. aid = array[0]
  190. url = "https://api.bilibili.com/x/web-interface/view?aid={0}".format(aid)
  191. rsp = self.fetch(url,headers=self.header,cookies=self.getCookie())
  192. jRoot = json.loads(rsp.text)
  193. jo = jRoot['data']
  194. title = jo['title'].replace("<em class=\"keyword\">","").replace("</em>","")
  195. pic = jo['pic']
  196. desc = jo['desc']
  197. typeName = jo['tname']
  198. vod = {
  199. "vod_id":aid,
  200. "vod_name":title,
  201. "vod_pic":pic,
  202. "type_name":typeName,
  203. "vod_year":"",
  204. "vod_area":"bilidanmu",
  205. "vod_remarks":"",
  206. "vod_actor":jo['owner']['name'],
  207. "vod_director":jo['owner']['name'],
  208. "vod_content":desc
  209. }
  210. ja = jo['pages']
  211. playUrl = ''
  212. for tmpJo in ja:
  213. cid = tmpJo['cid']
  214. part = tmpJo['part']
  215. playUrl = playUrl + '{0}${1}_{2}#'.format(part,aid,cid)
  216. vod['vod_play_from'] = 'B站'
  217. vod['vod_play_url'] = playUrl
  218. result = {
  219. 'list':[
  220. vod
  221. ]
  222. }
  223. return result
  224. def searchContent(self,key,quick):
  225. search = self.categoryContent(tid=key,pg=1,filter=None,extend=None)
  226. result = {
  227. 'list':search['list']
  228. }
  229. return result
  230. def playerContent(self,flag,id,vipFlags):
  231. # https://www.555dianying.cc/vodplay/static/js/playerconfig.js
  232. result = {}
  233. ids = id.split("_")
  234. url = 'https://api.bilibili.com:443/x/player/playurl?avid={0}&cid=%20%20{1}&qn=112'.format(ids[0],ids[1])
  235. rsp = self.fetch(url,cookies=self.getCookie())
  236. jRoot = json.loads(rsp.text)
  237. jo = jRoot['data']
  238. ja = jo['durl']
  239. maxSize = -1
  240. position = -1
  241. for i in range(len(ja)):
  242. tmpJo = ja[i]
  243. if maxSize < int(tmpJo['size']):
  244. maxSize = int(tmpJo['size'])
  245. position = i
  246. url = ''
  247. if len(ja) > 0:
  248. if position == -1:
  249. position = 0
  250. url = ja[position]['url']
  251. result["parse"] = 0
  252. result["playUrl"] = ''
  253. result["url"] = url
  254. result["header"] = {
  255. "Referer":"https://www.bilibili.com",
  256. "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
  257. }
  258. result["contentType"] = 'video/x-flv'
  259. return result
  260. config = {
  261. "player": {},
  262. "filter": {
  263. "初一语文": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一语文"},
  264. {"n": "沪教版","v": "沪教版初一语文"},
  265. {"n": "人教版","v": "人教版初一语文"},
  266. {"n": "北师大版","v": "北师大版初一语文"},
  267. {"n": "苏教版","v": "苏教版初一语文"}]},
  268. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  269. {"n": "60分钟以上","v": "4"},
  270. {"n": "30~60分钟","v": "3"},
  271. {"n": "10~30分钟","v": "2"},
  272. {"n": "10分钟以下","v": "1"}]}],
  273. "初一英语": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一英语"},
  274. {"n": "沪教版","v": "沪教版初一英语"},
  275. {"n": "人教版","v": "人教版初一英语"},
  276. {"n": "北师大版","v": "北师大版初一英语"},
  277. {"n": "苏教版","v": "苏教版初一英语"}]},
  278. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  279. {"n": "60分钟以上","v": "4"},
  280. {"n": "30~60分钟","v": "3"},
  281. {"n": "10~30分钟","v": "2"},
  282. {"n": "10分钟以下","v": "1"}]}],
  283. "初一数学": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一数学"},
  284. {"n": "沪教版","v": "沪教版初一数学"},
  285. {"n": "人教版","v": "人教版初一数学"},
  286. {"n": "北师大版","v": "北师大版初一数学"},
  287. {"n": "苏教版","v": "苏教版初一数学"}]},
  288. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  289. {"n": "60分钟以上","v": "4"},
  290. {"n": "30~60分钟","v": "3"},
  291. {"n": "10~30分钟","v": "2"},
  292. {"n": "10分钟以下","v": "1"}]}],
  293. "初一化学": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一化学"},
  294. {"n": "沪教版","v": "沪教版初一化学"},
  295. {"n": "人教版","v": "人教版初一化学"},
  296. {"n": "北师大版","v": "北师大版初一化学"},
  297. {"n": "苏教版","v": "苏教版初一化学"}]},
  298. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  299. {"n": "60分钟以上","v": "4"},
  300. {"n": "30~60分钟","v": "3"},
  301. {"n": "10~30分钟","v": "2"},
  302. {"n": "10分钟以下","v": "1"}]}],
  303. "初一物理": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一物理"},
  304. {"n": "沪教版","v": "沪教版初一物理"},
  305. {"n": "人教版","v": "人教版初一物理"},
  306. {"n": "北师大版","v": "北师大版初一物理"},
  307. {"n": "苏教版","v": "苏教版初一物理"}]},
  308. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  309. {"n": "60分钟以上","v": "4"},
  310. {"n": "30~60分钟","v": "3"},
  311. {"n": "10~30分钟","v": "2"},
  312. {"n": "10分钟以下","v": "1"}]}],
  313. "初一生物": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一生物"},
  314. {"n": "沪教版","v": "沪教版初一生物"},
  315. {"n": "人教版","v": "人教版初一生物"},
  316. {"n": "北师大版","v": "北师大版初一生物"},
  317. {"n": "苏教版","v": "苏教版初一生物"}]},
  318. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  319. {"n": "60分钟以上","v": "4"},
  320. {"n": "30~60分钟","v": "3"},
  321. {"n": "10~30分钟","v": "2"},
  322. {"n": "10分钟以下","v": "1"}]}],
  323. "初一地理": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一地理"},
  324. {"n": "沪教版","v": "沪教版初一地理"},
  325. {"n": "人教版","v": "人教版初一地理"},
  326. {"n": "北师大版","v": "北师大版初一地理"},
  327. {"n": "苏教版","v": "苏教版初一地理"}]},
  328. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  329. {"n": "60分钟以上","v": "4"},
  330. {"n": "30~60分钟","v": "3"},
  331. {"n": "10~30分钟","v": "2"},
  332. {"n": "10分钟以下","v": "1"}]}],
  333. "初一历史": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初一历史"},
  334. {"n": "沪教版","v": "沪教版初一历史"},
  335. {"n": "人教版","v": "人教版初一历史"},
  336. {"n": "北师大版","v": "北师大版初一历史"},
  337. {"n": "苏教版","v": "苏教版初一历史"}]},
  338. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  339. {"n": "60分钟以上","v": "4"},
  340. {"n": "30~60分钟","v": "3"},
  341. {"n": "10~30分钟","v": "2"},
  342. {"n": "10分钟以下","v": "1"}]}],
  343. "初二语文": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二语文"},
  344. {"n": "沪教版","v": "沪教版初二语文"},
  345. {"n": "人教版","v": "人教版初二语文"},
  346. {"n": "北师大版","v": "北师大版初二语文"},
  347. {"n": "苏教版","v": "苏教版初二语文"}]},
  348. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  349. {"n": "60分钟以上","v": "4"},
  350. {"n": "30~60分钟","v": "3"},
  351. {"n": "10~30分钟","v": "2"},
  352. {"n": "10分钟以下","v": "1"}]}],
  353. "初二英语": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二英语"},
  354. {"n": "沪教版","v": "沪教版初二英语"},
  355. {"n": "人教版","v": "人教版初二英语"},
  356. {"n": "北师大版","v": "北师大版初二英语"},
  357. {"n": "苏教版","v": "苏教版初二英语"}]},
  358. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  359. {"n": "60分钟以上","v": "4"},
  360. {"n": "30~60分钟","v": "3"},
  361. {"n": "10~30分钟","v": "2"},
  362. {"n": "10分钟以下","v": "1"}]}],
  363. "初二数学": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二数学"},
  364. {"n": "沪教版","v": "沪教版初二数学"},
  365. {"n": "人教版","v": "人教版初二数学"},
  366. {"n": "北师大版","v": "北师大版初二数学"},
  367. {"n": "苏教版","v": "苏教版初二数学"}]},
  368. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  369. {"n": "60分钟以上","v": "4"},
  370. {"n": "30~60分钟","v": "3"},
  371. {"n": "10~30分钟","v": "2"},
  372. {"n": "10分钟以下","v": "1"}]}],
  373. "初二化学": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二化学"},
  374. {"n": "沪教版","v": "沪教版初二化学"},
  375. {"n": "人教版","v": "人教版初二化学"},
  376. {"n": "北师大版","v": "北师大版初二化学"},
  377. {"n": "苏教版","v": "苏教版初二化学"}]},
  378. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  379. {"n": "60分钟以上","v": "4"},
  380. {"n": "30~60分钟","v": "3"},
  381. {"n": "10~30分钟","v": "2"},
  382. {"n": "10分钟以下","v": "1"}]}],
  383. "初二物理": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二物理"},
  384. {"n": "沪教版","v": "沪教版初二物理"},
  385. {"n": "人教版","v": "人教版初二物理"},
  386. {"n": "北师大版","v": "北师大版初二物理"},
  387. {"n": "苏教版","v": "苏教版初二物理"}]},
  388. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  389. {"n": "60分钟以上","v": "4"},
  390. {"n": "30~60分钟","v": "3"},
  391. {"n": "10~30分钟","v": "2"},
  392. {"n": "10分钟以下","v": "1"}]}],
  393. "初二生物": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二生物"},
  394. {"n": "沪教版","v": "沪教版初二生物"},
  395. {"n": "人教版","v": "人教版初二生物"},
  396. {"n": "北师大版","v": "北师大版初二生物"},
  397. {"n": "苏教版","v": "苏教版初二生物"}]},
  398. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  399. {"n": "60分钟以上","v": "4"},
  400. {"n": "30~60分钟","v": "3"},
  401. {"n": "10~30分钟","v": "2"},
  402. {"n": "10分钟以下","v": "1"}]}],
  403. "初二地理": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二地理"},
  404. {"n": "沪教版","v": "沪教版初二地理"},
  405. {"n": "人教版","v": "人教版初二地理"},
  406. {"n": "北师大版","v": "北师大版初二生物"},
  407. {"n": "苏教版","v": "苏教版初二地理"}]},
  408. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  409. {"n": "60分钟以上","v": "4"},
  410. {"n": "30~60分钟","v": "3"},
  411. {"n": "10~30分钟","v": "2"},
  412. {"n": "10分钟以下","v": "1"}]}],
  413. "初二历史": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初二历史"},
  414. {"n": "沪教版","v": "沪教版初二历史"},
  415. {"n": "人教版","v": "人教版初二历史"},
  416. {"n": "北师大版","v": "北师大版初二历史"},
  417. {"n": "苏教版","v": "苏教版初二历史"}]},
  418. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  419. {"n": "60分钟以上","v": "4"},
  420. {"n": "30~60分钟","v": "3"},
  421. {"n": "10~30分钟","v": "2"},
  422. {"n": "10分钟以下","v": "1"}]}],
  423. "初三语文": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三语文"},
  424. {"n": "沪教版","v": "沪教版初三语文"},
  425. {"n": "人教版","v": "人教版初三语文"},
  426. {"n": "北师大版","v": "北师大版初三语文"},
  427. {"n": "苏教版","v": "苏教版初三语文"}]},
  428. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  429. {"n": "60分钟以上","v": "4"},
  430. {"n": "30~60分钟","v": "3"},
  431. {"n": "10~30分钟","v": "2"},
  432. {"n": "10分钟以下","v": "1"}]}],
  433. "初三英语": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三英语"},
  434. {"n": "沪教版","v": "沪教版初三英语"},
  435. {"n": "人教版","v": "人教版初三英语"},
  436. {"n": "北师大版","v": "北师大版初三英语"},
  437. {"n": "苏教版","v": "苏教版初三英语"}]},
  438. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  439. {"n": "60分钟以上","v": "4"},
  440. {"n": "30~60分钟","v": "3"},
  441. {"n": "10~30分钟","v": "2"},
  442. {"n": "10分钟以下","v": "1"}]}],
  443. "初三数学": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三数学"},
  444. {"n": "沪教版","v": "沪教版初三数学"},
  445. {"n": "人教版","v": "人教版初三数学"},
  446. {"n": "北师大版","v": "北师大版初三数学"},
  447. {"n": "苏教版","v": "苏教版初三数学"}]},
  448. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  449. {"n": "60分钟以上","v": "4"},
  450. {"n": "30~60分钟","v": "3"},
  451. {"n": "10~30分钟","v": "2"},
  452. {"n": "10分钟以下","v": "1"}]}],
  453. "初三地理": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三地理"},
  454. {"n": "沪教版","v": "沪教版初三地理"},
  455. {"n": "人教版","v": "人教版初三地理"},
  456. {"n": "北师大版","v": "北师大版初三地理"},
  457. {"n": "苏教版","v": "苏教版初三地理"}]},
  458. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  459. {"n": "60分钟以上","v": "4"},
  460. {"n": "30~60分钟","v": "3"},
  461. {"n": "10~30分钟","v": "2"},
  462. {"n": "10分钟以下","v": "1"}]}],
  463. "初三化学": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三化学"},
  464. {"n": "沪教版","v": "沪教版初三化学"},
  465. {"n": "人教版","v": "人教版初三化学"},
  466. {"n": "北师大版","v": "北师大版初三化学"},
  467. {"n": "苏教版","v": "苏教版初三化学"}]},
  468. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  469. {"n": "60分钟以上","v": "4"},
  470. {"n": "30~60分钟","v": "3"},
  471. {"n": "10~30分钟","v": "2"},
  472. {"n": "10分钟以下","v": "1"}]}],
  473. "初三物理": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三物理"},
  474. {"n": "沪教版","v": "沪教版初三物理"},
  475. {"n": "人教版","v": "人教版初三物理"},
  476. {"n": "北师大版","v": "北师大版初三物理"},
  477. {"n": "苏教版","v": "苏教版初三物理"}]},
  478. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  479. {"n": "60分钟以上","v": "4"},
  480. {"n": "30~60分钟","v": "3"},
  481. {"n": "10~30分钟","v": "2"},
  482. {"n": "10分钟以下","v": "1"}]}],
  483. "初三生物": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三生物"},
  484. {"n": "沪教版","v": "沪教版初三生物"},
  485. {"n": "人教版","v": "人教版初三生物"},
  486. {"n": "北师大版","v": "北师大版初三生物"},
  487. {"n": "苏教版","v": "苏教版初三生物"}]},
  488. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  489. {"n": "60分钟以上","v": "4"},
  490. {"n": "30~60分钟","v": "3"},
  491. {"n": "10~30分钟","v": "2"},
  492. {"n": "10分钟以下","v": "1"}]}],
  493. "初三历史": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "初三历史"},
  494. {"n": "沪教版","v": "沪教版初三历史"},
  495. {"n": "人教版","v": "人教版初三历史"},
  496. {"n": "北师大版","v": "北师大版初三历史"},
  497. {"n": "苏教版","v": "苏教版初三历史"}]},
  498. {"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},
  499. {"n": "60分钟以上","v": "4"},
  500. {"n": "30~60分钟","v": "3"},
  501. {"n": "10~30分钟","v": "2"},
  502. {"n": "10分钟以下","v": "1"}]}]
  503. }
  504. }
  505. header = {}
  506. def localProxy(self,param):
  507. return [200, "video/MP2T", action, ""]