RSS parser class
And btw., is it possible to get from one plugin a list of available plugins?
mqojdn wrote:Is the built in RSS parser available from plugins? I.e. calling its extractorMatches()?
And btw., is it possible to get from one plugin a list of available plugins?
zip wrote:You could call the REST API to get that.
zip wrote:Serviio ships with Rome RSS parsing library, so you have that to your disposal. Although if that changed in future your plugin would stop working.
mqojdn wrote:zip wrote:You could call the REST API to get that.
How is that?
And isn't there some Groovy way to get that? Like a master WebResourceUrlExtractor or something?
zip wrote:Serviio ships with Rome RSS parsing library, so you have that to your disposal. Although if that changed in future your plugin would stop working.
zip wrote:yes, check the lib folder
will wrote:org.apache.commons.lang.StringEscapeUtils is in the commons-lang.jar file, so yes you can use that
private void populatePluginList() {
pluginList = ["YouTube"];
// How would I get the list from org.serviio.library.online.AbstractOnlineItemParser.getListOfPlugins()?
}
private FeedItemUrlExtractor getClassByName(String name) {
def instance = this.class.classLoader.loadClass(name, true, false)?.newInstance();
return instance;
}
private FeedItemUrlExtractor getPluginByURL(String url) {
FeedItemUrlExtractor plugin = null;
pluginList.each {
FeedItemUrlExtractor test = getClassByName(it);
if(test) {
if(test.extractorMatches(new URL(url))) {
plugin = test;
}
}
}
return plugin;
}
@Override
protected ContentURLContainer extractUrl(Map links, PreferredQuality preferredQuality) {
populatePluginList();
URL linkUrl = links.default;
FeedItemUrlExtractor plugin = getPluginByURL(linkUrl.toString());
if(plugin) {
pluginLog("Loaded: " + plugin.getExtractorName());
} else {
pluginLog("Loaded: NULL");
return null;
// How would I pass that to the default Serviio's RSS parser?
// i.e. return defaultPlugin.extractUrl(links, preferredQuality);
}
return plugin.extractUrl(links, preferredQuality);
}
mqojdn wrote:For example in a feed I have mixed entries, form Youtube, and I forward these to the Youtube plugin, and "normal" ones, that are supported by the built in RSS parser. How would I pass these "normal" entries to the built in parser? Where Serviio passes these when no matching plugin is found?
miksa wrote:RSS plug-in : url is pre-loaded and parsed for items collection by serviio. plug-ih has to return media items from the collection.
Webresource plug-in : url should be loaded and parsed for items collection by plug-in and then it has to return media items from this collection.
Users browsing this forum: No registered users and 19 guests