优酷视频.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. var rule = {
  2. title: '优酷[官]',
  3. host: 'https://www.%79%6f%75%6b%75.com',
  4. homeUrl: '',
  5. searchUrl: 'https://search.%79%6f%75%6b%75.com/api/search?pg=fypage&keyword=**',
  6. searchable: 2,
  7. quickSearch: 0,
  8. filterable: 1,
  9. multi: 1,
  10. url: '/category/data?optionRefresh=1&pageNo=fypage&params=fyfilter',
  11. filter_url: '{{fl}}',
  12. filter: 'H4sIAAAAAAAAA+1cW28bu7X+K4Uf+lIFsHJ3Hw7Q3d1TbODgtA9FgYODDUNJdLKNJs6u46RIiw3IF9nyRfJNtiVLjnyRLd9081UaWdKfGXJm/sXhDMm1SElWnGxnuwECGE6+tTgccpFc6+Mix//qseJndm6CTOV6fvu//+r5W/Bdz297XgYGBvsDQ8FAj69nMPAyyEQkvOeM7ZF0icwaTPo28OJN0HtisIOSiXp+8gndRNhVsPq5wqzkSarOpVCIVoqtJZzdJJNiNXPtdcyVaLUBJZzMPpZwQaoOOqsRQ50LFJ09U0adCxQdXd1BHQM0fYS6E6VFLnCf+97VciMOB56/brWfVa6R9zNX2A+Vqv2c9UWa2JHd4gCNkrW3w0InAHQ5UqZjUicA1DlWJ5VRWScHUOdKGrvFgY/Ov7eOFrDnkYRpTMmec4DDnaKr0CQOwNKlKCstLc0BPDdyTsbm5HMcwHP5XTJ7IJ/jAN+36CT34X0eABPsN+3zaWkCDqTOrCXNxoacTxxA//K7qBMAdKNH1sqC1HEA76sf0M2IfB8H0M7COTHysp0cgC42QeaOpY4D0FVPzdq21HGAfU/T9QXouwfUGfguGBhqW8FuFfWrVjAo1Rl4t/fufSHz/qvI76H8niq/i/K7qtyPcr8q70V5ryL394Gc/VeRP0b5Y1X+CO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PV7h4AeqWJsN8Rs57SymkinHFFsr5r7c5pRVulwPGNmpUe4ROHyZ2kPMTsoLiOG+NJoivMgsrruLTbSsl+yE21eqLrsMKOV+pcB8bjODqwZwNvB14PvBpstatLyK48tkWl2hX100VsjHYD+mHnQXhwK5b9aOOJbwZu33g4J+9/0QYVH5x8cQa9qROMYgGvmAgAXvr8BHUCQMvm1Kspc9qllN9/8zuhcP8HXndxySnLczoBvogZIr52uv0Z0mU2fOarLy26D18xvu6fpuj6Jyc+kAh7+eb1wNN+b190Q1dj6GWcxMvKB2CAZYkXA2+DVqxEgKspApjoWyNkZ4WEK1YWprsqguXV5XM7Ui+7x1OxDH7hpongXd7c5GkM+S5VpJdjTA/ZkSbSy7X+HYVWqV765VutGIMtrVM/TtJEX8TyF18d3v7y/8gA8Zy1rf/JUGDwWWtDP4Gvut+/hMJ2dNsOwZGvKoL2LM6S6ol13LBn4NNyVYQbret9um03L8z6hvZptCaC8YssWGvj+ifUqgjKZaPW1D7bD9BIgoydkRIcUrcrcHPh5udZq0g+YTdT6ta2TQH9OzoyjThbgfjJniaCcrOHzD52aMS5lH/rRRPBStple7QNetogRTnamgjq8/4wmvs1OsxjTQR29S612iNxKwUnEaroMzAN+2zcLsDOnwPQ5bbtoswpCIChpIarQQAYmuOklVqUw8EBmKLLpTo+ZlLHAerO3Nyn+kWaJoKpHl1mW3S3QRAMNBHUx//IAJw3IoaautzItFIJa7QKvfAA9J5/VqFlW1SRXk5b2JoIRqE4Ts/kuAkAbSyNk0loIwfQxjxbY5CP4QCe63Z9MXpCV8/ZgsOnNRGW27Sm4FYqBzhzFu2pYzpVUL509ET/IWRfQIz56f8BvNNeN7lTAAA=',
  13. headers: {
  14. 'User-Agent': 'PC_UA',
  15. 'Cookie': 'cna=VvNvGX3e0ywCAavVEXlnA2bg; __ysuid=1626676228345Rl1; __ayft=1652434048647; __arycid=dm-1-00; __arcms=dm-1-00; __ayvstp=85; __arpvid=1667204023100cWWdgM-1667204023112; __ayscnt=10; __aypstp=60; isg=BBwcqxvvk3BxkWQGugbLpUSf7TrOlcC_U7GAj_YdfYfvQbzLHqYGT4Hgp6m5TvgX; tfstk=c3JOByYUH20ilVucLOhh0pCtE40lZfGc-PjLHLLfuX7SWNyAiQvkeMBsIw7PWDC..; l=eBQguS-PjdJFGJT-BOfwourza77OSIRA_uPzaNbMiOCPOb1B5UxfW6yHp4T6C3GVhsGJR3rp2umHBeYBqQd-nxvOF8qmSVDmn',
  16. 'Referer': 'https://www.youku.com',
  17. },
  18. timeout: 5000,
  19. class_name: '电视剧&电影&综艺&动漫&少儿&纪录片&文化&亲子&教育&搞笑&生活&体育&音乐&游戏',
  20. class_url: '电视剧&电影&综艺&动漫&少儿&纪录片&文化&亲子&教育&搞笑&生活&体育&音乐&游戏',
  21. limit: 20,
  22. play_parse: true,
  23. lazy: $js.toString(() => {
  24. input = {
  25. parse: 1,
  26. jx: 1,
  27. url: input
  28. };
  29. }),
  30. 一级: $js.toString(() => {
  31. let d = [];
  32. MY_FL.type = MY_CATE;
  33. let fl = stringify(MY_FL);
  34. fl = encodeUrl(fl);
  35. input = input.split("{")[0] + fl;
  36. if (MY_PAGE > 1) {
  37. let old_session = getItem("yk_session_" + MY_CATE, "{}");
  38. if (MY_PAGE === 2) {
  39. input = input.replace("optionRefresh=1", "session=" + encodeUrl(old_session))
  40. } else {
  41. input = input.replace("optionRefresh=1", "session=" + encodeUrl(old_session))
  42. }
  43. }
  44. let html = fetch(input, fetch_params);
  45. try {
  46. html = JSON.parse(html);
  47. let lists = html.data.filterData.listData;
  48. let session = html.data.filterData.session;
  49. session = stringify(session);
  50. if (session !== getItem("yk_session_" + MY_CATE, "{}")) {
  51. setItem("yk_session_" + MY_CATE, session)
  52. }
  53. lists.forEach(function (it) {
  54. let vid;
  55. if (it.videoLink.includes("id_")) {
  56. vid = it.videoLink.split("id_")[1].split(".html")[0]
  57. } else {
  58. vid = "msearch:"
  59. }
  60. d.push({
  61. title: it.title,
  62. img: it.img,
  63. desc: it.summary,
  64. url: "https://search.youku.com/api/search?appScene=show_episode&showIds=" + vid,
  65. content: it.subTitle
  66. })
  67. })
  68. } catch (e) {
  69. log("一级列表解析发生错误:" + e.message)
  70. }
  71. setResult(d);
  72. }),
  73. 二级: $js.toString(() => {
  74. var d = [];
  75. VOD = {};
  76. let html = request(input);
  77. let json = JSON.parse(html);
  78. if (/keyword/.test(input)) {
  79. input = "https://search.youku.com/api/search?appScene=show_episode&showIds=" + json.pageComponentList[0].commonData.showId;
  80. json = JSON.parse(fetch(MY_URL, fetch_params))
  81. }
  82. let video_lists = json.serisesList;
  83. var name = json.sourceName;
  84. if (/优酷/.test(name) && video_lists.length > 0) {
  85. let ourl = "https://v.youku.com/v_show/id_" + video_lists[0].videoId + ".html";
  86. let _img = video_lists[0].thumbUrl;
  87. let html = fetch(ourl, {
  88. headers: {
  89. Referer: "https://v.youku.com/",
  90. "User-Agent": PC_UA
  91. }
  92. });
  93. let json = /__INITIAL_DATA__/.test(html) ? html.split("window.__INITIAL_DATA__ =")[1].split(";")[0] : "{}";
  94. if (json === "{}") {
  95. log("触发了优酷人机验证");
  96. VOD.vod_remarks = ourl;
  97. VOD.vod_pic = _img;
  98. VOD.vod_name = video_lists[0].title.replace(/(\d+)/g, "");
  99. VOD.vod_content = "触发了优酷人机验证,本次未获取详情,但不影响播放(" + ourl + ")"
  100. } else {
  101. try {
  102. json = JSON.parse(json);
  103. let data = json.data.data;
  104. let data_extra = data.data.extra;
  105. let img = data_extra.showImgV;
  106. let model = json.data.model;
  107. let m = model.detail.data.nodes[0].nodes[0].nodes[0].data;
  108. let _type = m.showGenre;
  109. let _desc = m.updateInfo || m.subtitle;
  110. let JJ = m.desc;
  111. let _title = m.introTitle;
  112. VOD.vod_pic = img;
  113. VOD.vod_name = _title;
  114. VOD.vod_type = _type;
  115. VOD.vod_remarks = _desc;
  116. VOD.vod_content = JJ
  117. } catch (e) {
  118. log("海报渲染发生错误:" + e.message);
  119. print(json);
  120. VOD.vod_remarks = name
  121. }
  122. }
  123. }
  124. if (!/优酷/.test(name)) {
  125. VOD.vod_content = "非自家播放源,暂无视频简介及海报";
  126. VOD.vod_remarks = name
  127. }
  128. function adhead(url) {
  129. return urlencode(url)
  130. }
  131. play_url = play_url.replace("&play_url=", "&type=json&play_url=");
  132. video_lists.forEach(function (it) {
  133. let url = "https://v.youku.com/v_show/id_" + it.videoId + ".html";
  134. if (it.thumbUrl) {
  135. d.push({
  136. desc: it.showVideoStage ? it.showVideoStage.replace("期", "集") : it.displayName,
  137. pic_url: it.thumbUrl,
  138. title: it.title,
  139. url: play_url + adhead(url)
  140. })
  141. } else if (name !== "优酷") {
  142. d.push({
  143. title: it.displayName ? it.displayName : it.title,
  144. url: play_url + adhead(it.url)
  145. })
  146. }
  147. });
  148. VOD.vod_play_from = name;
  149. VOD.vod_play_url = d.map(function (it) {
  150. return it.title + "$" + it.url
  151. })
  152. .join("#");
  153. }),
  154. 搜索: $js.toString(() => {
  155. var d = [];
  156. let html = request(input);
  157. let json = JSON.parse(html);
  158. json.pageComponentList.forEach(function (it) {
  159. if (it.hasOwnProperty("commonData")) {
  160. it = it.commonData;
  161. d.push({
  162. title: it.titleDTO.displayName,
  163. img: it.posterDTO.vThumbUrl,
  164. desc: it.stripeBottom,
  165. content: it.updateNotice + " " + it.feature,
  166. url: "https://search.youku.com/api/search?appScene=show_episode&showIds=" + it.showId + "&appCaller=h5"
  167. })
  168. }
  169. });
  170. setResult(d)
  171. }),
  172. }