MCPcopy Create free account
hub / github.com/FongMi/CatVodSpider / proxy

Method proxy

app/src/main/java/com/github/catvod/spider/Bili.java:206–225  ·  view source on GitHub ↗
(Map<String, String> params)

Source from the content-addressed store, hash-verified

204 }
205
206 @Override
207 public Object[] proxy(Map<String, String> params) {
208 String aid = params.get("aid");
209 String cid = params.get("cid");
210 String qn = params.get("qn");
211 String api = "https://api.bilibili.com/x/player/playurl?avid=" + aid + "&cid=" + cid + "&qn=" + qn + "&fnval=4048&fourk=1";
212 String json = OkHttp.string(api, getHeader());
213 Resp resp = Resp.objectFrom(json);
214 Dash dash = resp.getData().getDash();
215 StringBuilder video = new StringBuilder();
216 StringBuilder audio = new StringBuilder();
217 findAudio(dash, audio);
218 findVideo(dash, video, qn);
219 String mpd = getMpd(dash, video.toString(), audio.toString());
220 Object[] result = new Object[3];
221 result[0] = 200;
222 result[1] = "application/dash+xml";
223 result[2] = new ByteArrayInputStream(mpd.getBytes());
224 return result;
225 }
226
227 private HashMap<String, String> getAudioFormat() {
228 HashMap<String, String> audios = new HashMap<>();

Callers

nothing calls this directly

Calls 10

stringMethod · 0.95
getHeaderMethod · 0.95
objectFromMethod · 0.95
getDataMethod · 0.95
findAudioMethod · 0.95
findVideoMethod · 0.95
getMpdMethod · 0.95
getDashMethod · 0.80
toStringMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected