Error on plugin!!
I wrote a plugin to extract the image feed. But its failing with following error. Please help me to fix this. I am not very familiar with plugin code, just picked up existing one and tried to modify them. Appreciate any help.
Error log says
2012-02-11 02:18:59,959 DEBUG [OnlineRepositoryDAOImpl] Reading an OnlineRepository (id = 138)
2012-02-11 02:18:59,960 DEBUG [OnlineLibraryManager] Resource http://feeds.feedburner.com/Pixses not in cache yet, loading it
2012-02-11 02:18:59,960 DEBUG [FeedParser] Parsing feed 'http://feeds.feedburner.com/Pixses'
2012-02-11 02:19:01,005 DEBUG [FeedParser] Found matching url extractor (PixsesURLextract) for resource http://feeds.feedburner.com/Pixses
2012-02-11 02:19:01,006 DEBUG [FeedItemUrlExtractor] PixsesURLextract: Starting extraction of url for item: NRI Beauty Preeti Desai Sizzles on Screen
2012-02-11 02:19:02,005 DEBUG [FeedItemUrlExtractor] PixsesURLextract: Extract URL: http://www.pixses.com/nri-beauty-preeti ... creen.html
2012-02-11 02:19:02,017 DEBUG [FeedItemUrlExtractor] PixsesURLextract: Finished extraction of url: ContentURLContainer [fileType=IMAGE, contentUrl=http://www.pixses.com/wp-content/uploads/preeti_desai_07.jpg, live=false, expiresImmediately=false, ]
2012-02-11 02:19:02,017 DEBUG [FeedParser] Cannot add feed entry of feed PIXSES | Hot Picture Special Collection because of invalid metadata. Message: Unknown online item image container.
And here is my plugin code
- Code:
import org.serviio.library.metadata.*
import org.serviio.library.online.*
import org.serviio.util.*
/** Pixses.com content URL extractor plugin.
*
* Based on Youtube.groovy by Petr Nejedly
*
* @author Erwin Bovendeur
*
*/
class PixsesURLextract extends FeedItemUrlExtractor {
final VALID_FEED_URL = '^http://feeds.feedburner.com/Pixses*'
String getExtractorName() {
return getClass().getName();
}
boolean extractorMatches(URL feedUrl) {
return feedUrl ==~ VALID_FEED_URL;
}
ContentURLContainer extractUrl(Map links, PreferredQuality requestedQuality) {
def linkUrl = links.alternate != null ? links.alternate : links.default
String pageHtml = linkUrl.getText()
def seqVarMatcher = pageHtml =~ 'http://www.pixses.com/wp-content/uploads.+jpg'
assert seqVarMatcher != null
def contentUrl = seqVarMatcher[0]
log("Extract URL: " + linkUrl)
return new ContentURLContainer(fileType: MediaFileType.IMAGE, contentUrl: contentUrl)
}
/* Groovy test method */
static void main(args) {
PixsesURLextract extractor = new PixsesURLextract()
assert extractor.extractorMatches( new URL("http://feeds.feedburner.com/Pixses"))
Map links = ['default': new URL("http://www.pixses.com/nri-beauty-preeti-desai-sizzles-on-screen.html")]
ContentURLContainer result = extractor.extractUrl(links, PreferredQuality.MEDIUM)
println "Result: $result"
}
}
Thanks
Ritz