策驰影院.py 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. """
  2. 作者 凯悦宾馆 🚓 内容均从互联网收集而来 仅供交流学习使用 版权归原创者所有 如侵犯了您的权益 请通知作者 将及时删除侵权内容
  3. ====================kaiyuebinguan====================
  4. """
  5. from Crypto.Util.Padding import unpad
  6. from urllib.parse import unquote
  7. from Crypto.Cipher import ARC4
  8. from base.spider import Spider
  9. from bs4 import BeautifulSoup
  10. import urllib.request
  11. import urllib.parse
  12. import binascii
  13. import requests
  14. import base64
  15. import json
  16. import time
  17. import sys
  18. import re
  19. import os
  20. sys.path.append('..')
  21. xurl = "https://www.ccy1.com"
  22. headerx = {
  23. 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36'
  24. }
  25. pm = ''
  26. class Spider(Spider):
  27. global xurl
  28. global headerx
  29. def getName(self):
  30. return "首页"
  31. def init(self, extend):
  32. pass
  33. def isVideoFormat(self, url):
  34. pass
  35. def manualVideoCheck(self):
  36. pass
  37. def extract_middle_text(self, text, start_str, end_str, pl, start_index1: str = '', end_index2: str = ''):
  38. if pl == 3:
  39. plx = []
  40. while True:
  41. start_index = text.find(start_str)
  42. if start_index == -1:
  43. break
  44. end_index = text.find(end_str, start_index + len(start_str))
  45. if end_index == -1:
  46. break
  47. middle_text = text[start_index + len(start_str):end_index]
  48. plx.append(middle_text)
  49. text = text.replace(start_str + middle_text + end_str, '')
  50. if len(plx) > 0:
  51. purl = ''
  52. for i in range(len(plx)):
  53. matches = re.findall(start_index1, plx[i])
  54. output = ""
  55. for match in matches:
  56. match3 = re.search(r'(?:^|[^0-9])(\d+)(?:[^0-9]|$)', match[1])
  57. if match3:
  58. number = match3.group(1)
  59. else:
  60. number = 0
  61. if 'http' not in match[0]:
  62. output += f"#{'📽️丢丢👉' + match[1]}${number}{xurl}{match[0]}"
  63. else:
  64. output += f"#{'📽️丢丢👉' + match[1]}${number}{match[0]}"
  65. output = output[1:]
  66. purl = purl + output + "$$$"
  67. purl = purl[:-3]
  68. return purl
  69. else:
  70. return ""
  71. else:
  72. start_index = text.find(start_str)
  73. if start_index == -1:
  74. return ""
  75. end_index = text.find(end_str, start_index + len(start_str))
  76. if end_index == -1:
  77. return ""
  78. if pl == 0:
  79. middle_text = text[start_index + len(start_str):end_index]
  80. return middle_text.replace("\\", "")
  81. if pl == 1:
  82. middle_text = text[start_index + len(start_str):end_index]
  83. matches = re.findall(start_index1, middle_text)
  84. if matches:
  85. jg = ' '.join(matches)
  86. return jg
  87. if pl == 2:
  88. middle_text = text[start_index + len(start_str):end_index]
  89. matches = re.findall(start_index1, middle_text)
  90. if matches:
  91. new_list = [f'✨丢丢👉{item}' for item in matches]
  92. jg = '$$$'.join(new_list)
  93. return jg
  94. def homeContent(self, filter):
  95. result = {}
  96. result = {"class": [{"type_id": "77", "type_name": "丢丢电影🌠"},
  97. {"type_id": "78", "type_name": "丢丢剧集🌠"},
  98. {"type_id": "80", "type_name": "丢丢动漫🌠"},
  99. {"type_id": "164", "type_name": "丢丢4K🌠"},
  100. {"type_id": "79", "type_name": "丢丢综艺🌠"},
  101. {"type_id": "166", "type_name": "丢丢体育🌠"},
  102. {"type_id": "170", "type_name": "丢丢演唱会🌠"},
  103. {"type_id": "165", "type_name": "丢丢短剧🌠"}],
  104. "list": [],
  105. "filters": {"77": [{"key": "年代",
  106. "name": "年代",
  107. "value": [{"n": "全部", "v": "0"},
  108. {"n": "80年代", "v": "42"},
  109. {"n": "90年代", "v": "43"},
  110. {"n": "00年代", "v": "44"},
  111. {"n": "10年代", "v": "45"},
  112. {"n": "20年代", "v": "46"}]}],
  113. "78": [{"key": "年代",
  114. "name": "年代",
  115. "value": [{"n": "全部", "v": "0"},
  116. {"n": "80年代", "v": "42"},
  117. {"n": "90年代", "v": "43"},
  118. {"n": "00年代", "v": "44"},
  119. {"n": "10年代", "v": "45"},
  120. {"n": "20年代", "v": "46"}]}],
  121. "80": [{"key": "年代",
  122. "name": "年代",
  123. "value": [{"n": "全部", "v": "0"},
  124. {"n": "80年代", "v": "42"},
  125. {"n": "90年代", "v": "43"},
  126. {"n": "00年代", "v": "44"},
  127. {"n": "10年代", "v": "45"},
  128. {"n": "20年代", "v": "46"}]}],
  129. "164": [{"key": "年代",
  130. "name": "年代",
  131. "value": [{"n": "全部", "v": "0"},
  132. {"n": "80年代", "v": "42"},
  133. {"n": "90年代", "v": "43"},
  134. {"n": "00年代", "v": "44"},
  135. {"n": "10年代", "v": "45"},
  136. {"n": "20年代", "v": "46"}]}],
  137. "79": [{"key": "年代",
  138. "name": "年代",
  139. "value": [{"n": "全部", "v": "0"},
  140. {"n": "80年代", "v": "42"},
  141. {"n": "90年代", "v": "43"},
  142. {"n": "00年代", "v": "44"},
  143. {"n": "10年代", "v": "45"},
  144. {"n": "20年代", "v": "46"}]}],
  145. "166": [{"key": "年代",
  146. "name": "年代",
  147. "value": [{"n": "全部", "v": "0"},
  148. {"n": "80年代", "v": "42"},
  149. {"n": "90年代", "v": "43"},
  150. {"n": "00年代", "v": "44"},
  151. {"n": "10年代", "v": "45"},
  152. {"n": "20年代", "v": "46"}]}],
  153. "170": [{"key": "年代",
  154. "name": "年代",
  155. "value": [{"n": "全部", "v": "0"},
  156. {"n": "80年代", "v": "42"},
  157. {"n": "90年代", "v": "43"},
  158. {"n": "00年代", "v": "44"},
  159. {"n": "10年代", "v": "45"},
  160. {"n": "20年代", "v": "46"}]}],
  161. "165": [{"key": "年代",
  162. "name": "年代",
  163. "value": [{"n": "全部", "v": "0"},
  164. {"n": "80年代", "v": "42"},
  165. {"n": "90年代", "v": "43"},
  166. {"n": "00年代", "v": "44"},
  167. {"n": "10年代", "v": "45"},
  168. {"n": "20年代", "v": "46"}]}]}}
  169. return result
  170. def homeVideoContent(self):
  171. videos = []
  172. try:
  173. detail = requests.get(url=xurl, headers=headerx)
  174. detail.encoding = "utf-8"
  175. res = detail.text
  176. doc = BeautifulSoup(res, "lxml")
  177. soups = doc.find_all('div', class_="hide-b-20")
  178. if soups and len(soups) > 1:
  179. soups = soups[1]
  180. vods = soups.find_all('div', class_="public-list-box")
  181. for vod in vods:
  182. names = vod.find('div', class_="public-list-div")
  183. name = names.find('a')['title']
  184. id = names.find('a')['href']
  185. pic = vod.find('img')['data-src']
  186. if 'http' not in pic:
  187. pic = xurl + pic
  188. remarks = vod.find('span', class_="public-list-prb hide")
  189. remark = remarks.text.strip()
  190. video = {
  191. "vod_id": id,
  192. "vod_name": '丢丢📽️' + name,
  193. "vod_pic": pic,
  194. "vod_remarks": '丢丢▶️' + remark
  195. }
  196. videos.append(video)
  197. result = {'list': videos}
  198. return result
  199. except:
  200. pass
  201. def categoryContent(self, cid, pg, filter, ext):
  202. result = {}
  203. videos = []
  204. if pg:
  205. page = int(pg)
  206. else:
  207. page = 1
  208. if '年代' in ext.keys():
  209. NdType = ext['年代']
  210. else:
  211. NdType = ''
  212. if page == '1':
  213. url = f'{xurl}/vod/list/1/{cid}/0/0/0/0/0/0'
  214. else:
  215. url = f'{xurl}/vod/list/{str(page)}/{cid}/0/{NdType}/0/0/0/0'
  216. try:
  217. detail = requests.get(url=url, headers=headerx)
  218. detail.encoding = "utf-8"
  219. res = detail.text
  220. doc = BeautifulSoup(res, "lxml")
  221. soups = doc.find_all('div', class_="border-box")
  222. for soup in soups:
  223. vods = soup.find_all('div', class_="public-list-box")
  224. for vod in vods:
  225. name = vod.find('img')['alt']
  226. ids = vod.find('a', class_="public-list-exp")
  227. id = ids['href']
  228. pic = vod.find('img')['src']
  229. if 'http' not in pic:
  230. pic = xurl + pic
  231. remarks = vod.find('span', class_="public-list-prb")
  232. remark = remarks.text.strip()
  233. video = {
  234. "vod_id": id,
  235. "vod_name": '丢丢📽️' + name,
  236. "vod_pic": pic,
  237. "vod_remarks": '丢丢▶️' + remark
  238. }
  239. videos.append(video)
  240. except:
  241. pass
  242. result = {'list': videos}
  243. result['page'] = pg
  244. result['pagecount'] = 9999
  245. result['limit'] = 90
  246. result['total'] = 999999
  247. return result
  248. def detailContent(self, ids):
  249. global pm
  250. did = ids[0]
  251. result = {}
  252. videos = []
  253. if 'http' not in did:
  254. did = xurl + did
  255. res1 = requests.get(url=did, headers=headerx)
  256. res1.encoding = "utf-8"
  257. res = res1.text
  258. url = 'https://fs-im-kefu.7moor-fs1.com/ly/4d2c3f00-7d4c-11e5-af15-41bf63ae4ea0/1732697392729/didiu.txt'
  259. response = requests.get(url)
  260. response.encoding = 'utf-8'
  261. code = response.text
  262. name = self.extract_middle_text(code, "s1='", "'", 0)
  263. Jumps = self.extract_middle_text(code, "s2='", "'", 0)
  264. content = '😸丢丢🎉为您介绍剧情📢本资源来源于网络🚓侵权请联系删除👉' + self.extract_middle_text(res,'class="text cor3" >','</div>', 0)
  265. if name not in content:
  266. bofang = Jumps
  267. else:
  268. bofang = self.extract_middle_text(res, '<ul class="anthology-list-play', '</ul>', 3, 'href="(.*?)" class="hide" style="width:100px">\s+(.*?)\s+</a>')
  269. xianlu = self.extract_middle_text(res, '<div class="swiper-wrapper"','</div>',2, '</i>&nbsp;(.*?)</a>')
  270. videos.append({
  271. "vod_id": did,
  272. "vod_actor": '😸皮皮 😸灰灰',
  273. "vod_director": '😸丢丢',
  274. "vod_content": content,
  275. "vod_play_from": xianlu,
  276. "vod_play_url": bofang
  277. })
  278. result['list'] = videos
  279. return result
  280. def playerContent(self, flag, id, vipFlags):
  281. parts = id.split("http")
  282. xiutan = 0
  283. if xiutan == 0:
  284. if len(parts) > 1:
  285. before_https, after_https = parts[0], 'http' + parts[1]
  286. if '239755956819.mp4' in after_https:
  287. url = after_https
  288. else:
  289. res = requests.get(url=after_https, headers=headerx)
  290. res = res.text
  291. url = self.extract_middle_text(res, '?url=', "'", 0).replace('\\', '')
  292. result = {}
  293. result["parse"] = xiutan
  294. result["playUrl"] = ''
  295. result["url"] = url
  296. result["header"] = headerx
  297. return result
  298. def searchContent(self, key, quick):
  299. return self.searchContentPage(key, quick, '1')
  300. def localProxy(self, params):
  301. if params['type'] == "m3u8":
  302. return self.proxyM3u8(params)
  303. elif params['type'] == "media":
  304. return self.proxyMedia(params)
  305. elif params['type'] == "ts":
  306. return self.proxyTs(params)
  307. return None