diff --git a/util/reptileutil.js b/util/reptileutil.js index 0d00b95..0a8d677 100644 --- a/util/reptileutil.js +++ b/util/reptileutil.js @@ -3,11 +3,13 @@ import cheerio from "cheerio" import axios from "axios" class Reptile { + // 初始化代理 constructor(proxy) { if (proxy) { axios.defaults.proxy = proxy } } + // 通过名字搜索 async find(name) { let url = `https://dmhy.anoneko.com/topics/list?keyword=${name}` url = encodeURI(url) @@ -30,6 +32,7 @@ class Reptile { }) console.log(JSON.stringify(list)) } + // 获取[]中间的内容 目前通过这个获取第几集 async getepisode(name) { // let re = /\[.*?\]/g let episode = name.match( /(?<=\[).*?(?=\])/g)