up云搜.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #coding=utf-8
  2. #!/usr/bin/python
  3. import sys
  4. sys.path.append('..')
  5. from base.spider import Spider
  6. import requests
  7. import json
  8. import base64
  9. class Spider(Spider):
  10. def getDependence(self):
  11. return ['py_ali']
  12. def getName(self):
  13. return "py_yunso"
  14. def init(self,extend):
  15. self.ali = extend[0]
  16. print("============py_yunso============")
  17. pass
  18. def isVideoFormat(self,url):
  19. pass
  20. def manualVideoCheck(self):
  21. pass
  22. def homeContent(self,filter):
  23. result = {}
  24. return result
  25. def homeVideoContent(self):
  26. result = {}
  27. return result
  28. def categoryContent(self,tid,pg,filter,extend):
  29. result = {}
  30. return result
  31. header = {
  32. "User-Agent": "Mozilla/5.0 (Linux; Android 12; V2049A Build/SP1A.210812.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36",
  33. "origin": "https://www.upyunso.com/"
  34. }
  35. def detailContent(self,array):
  36. return self.ali.detailContent(array)
  37. def searchContent(self,key,quick):
  38. url = "https://api.upyunso.com/search?keyword={0}&page=1&s_type=2".format(key)
  39. rsp = requests.get(url=url, headers=self.header)
  40. vodList = json.loads(base64.b64decode(rsp.text))['result']['items']
  41. videos = []
  42. for vod in vodList:
  43. vid =vod['page_url']
  44. name = vod['title']
  45. if 'aliyundrive.com' in vid:
  46. videos.append({
  47. "vod_id": vid,
  48. "vod_name": name,
  49. "vod_pic": "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000",
  50. "vod_remarks": vod['insert_time']
  51. })
  52. result = {
  53. 'list':videos
  54. }
  55. return result
  56. def playerContent(self,flag,id,vipFlags):
  57. return self.ali.playerContent(flag,id,vipFlags)
  58. config = {
  59. "player": {},
  60. "filter": {}
  61. }
  62. header = {}
  63. def localProxy(self,param):
  64. return [200, "video/MP2T", action, ""]