Skip to content

Commit

Permalink
fix: wogg 图片加载
Browse files Browse the repository at this point in the history
  • Loading branch information
Greatwallcorner committed Jul 15, 2024
1 parent 701a4c4 commit 007851e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file modified jar/spider.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions src/main/java/com/github/catvod/spider/Wogg.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.catvod.spider;

import cn.hutool.core.util.URLUtil;
import com.github.catvod.bean.Class;
import com.github.catvod.bean.Result;
import com.github.catvod.bean.Vod;
Expand All @@ -13,6 +14,7 @@
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -81,6 +83,9 @@ private List<Vod> parseVodListFromDoc(Document doc) {
for (Element e : elements) {
String vodId = e.selectFirst(".video-name a").attr("href");
String vodPic = e.selectFirst(".module-item-pic > img").attr("data-src");
if(!vodPic.startsWith("http")){
vodPic = URLUtil.completeUrl(siteUrl, vodPic);
}
String vodName = e.selectFirst(".video-name").text();
String vodRemarks = e.selectFirst(".module-item-text").text();
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
Expand Down

0 comments on commit 007851e

Please sign in to comment.