mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-13 22:00:32 +05:30
b1989c0a83
- Add new itags
40 lines
1.2 KiB
Java
40 lines
1.2 KiB
Java
package org.schabi.newpipe.extractor.playlist;
|
|
|
|
import org.schabi.newpipe.extractor.InfoItemCollector;
|
|
import org.schabi.newpipe.extractor.UrlIdHandler;
|
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
|
|
|
public class PlaylistInfoItemCollector extends InfoItemCollector {
|
|
public PlaylistInfoItemCollector(int serviceId) {
|
|
super(serviceId);
|
|
}
|
|
|
|
public PlaylistInfoItem extract(PlaylistInfoItemExtractor extractor) throws ParsingException {
|
|
final PlaylistInfoItem resultItem = new PlaylistInfoItem();
|
|
|
|
resultItem.name = extractor.getPlaylistName();
|
|
resultItem.service_id = getServiceId();
|
|
resultItem.url = extractor.getWebPageUrl();
|
|
|
|
try {
|
|
resultItem.thumbnail_url = extractor.getThumbnailUrl();
|
|
} catch (Exception e) {
|
|
addError(e);
|
|
}
|
|
try {
|
|
resultItem.streams_count = extractor.getStreamsCount();
|
|
} catch (Exception e) {
|
|
addError(e);
|
|
}
|
|
return resultItem;
|
|
}
|
|
|
|
public void commit(PlaylistInfoItemExtractor extractor) throws ParsingException {
|
|
try {
|
|
addItem(extract(extractor));
|
|
} catch (Exception e) {
|
|
addError(e);
|
|
}
|
|
}
|
|
}
|