Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void collectVideos(
JsonArray results
) throws ParsingException {
for (int i = 0; i < results.size(); i++) {
collector.commit(new BilibiliChannelInfoItemClientAPIExtractor(results.getObject(i), extractor.getName(), extractor.getAvatarUrl()));
collector.commit(new BilibiliChannelInfoItemClientAPIExtractor(results.getObject(i), extractor.getAvatarUrl()));
}
}

Expand Down Expand Up @@ -312,7 +312,7 @@ public void collectVideos(
JsonArray results
) throws ParsingException {
for (int i = 0; i < results.size(); i++) {
collector.commit(new BilibiliChannelInfoItemWebAPIExtractor(results.getObject(i), extractor.getName(), extractor.getAvatarUrl()));
collector.commit(new BilibiliChannelInfoItemWebAPIExtractor(results.getObject(i), null, null));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
public class BilibiliChannelInfoItemClientAPIExtractor implements StreamInfoItemExtractor {

protected final JsonObject item;
public String name;
public String face;
private final String face;

public BilibiliChannelInfoItemClientAPIExtractor(final JsonObject json, String name, String face) {
public BilibiliChannelInfoItemClientAPIExtractor(final JsonObject json, String face) {
item = json;
this.name = name;
this.face = face;
}

Expand Down Expand Up @@ -64,7 +62,7 @@ public long getViewCount() throws ParsingException {

@Override
public String getUploaderName() throws ParsingException {
return name;
return item.getString("author");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
public class BilibiliChannelInfoItemWebAPIExtractor implements StreamInfoItemExtractor {

protected final JsonObject item;
public String name;
public String face;
private final String name;
private final String face;

public BilibiliChannelInfoItemWebAPIExtractor(final JsonObject json, String name, String face) {
item = json;
Expand Down Expand Up @@ -63,7 +63,7 @@ public long getViewCount() throws ParsingException {

@Override
public String getUploaderName() throws ParsingException {
return name;
return Optional.of(item.getString("author")).orElse(name);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public InfoItemsPage<StreamInfoItem> getPage(Page page) throws IOException, Extr
}
final StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId());
for (int i = 0; i < results.size(); i++) {
collector.commit(new BilibiliChannelInfoItemWebAPIExtractor(results.getObject(i), page.getUrl().split("username=")[1], null));
collector.commit(new BilibiliChannelInfoItemWebAPIExtractor(results.getObject(i), getUploaderName(), getUploaderAvatarUrl()));
}
return new InfoItemsPage<>(collector, new Page(utils.getNextPageFromCurrentUrl(page.getUrl(), type.equals("seasons_archives") ? "page_num" : "pn", 1), getDefaultCookies()));
}
Expand Down