Page 1 of 1

Vevo Plugin

PostPosted: Wed Apr 24, 2013 3:19 am
by brunohansen
I'm thinking about to create a Vevo plugin but I'm having no success adding a Web Resource plugin!

What is the problem with this plugin?

  Code:
import org.serviio.library.metadata.*
import org.serviio.library.online.*

class VevoBeta extends WebResourceUrlExtractor {
   
    String getExtractorName() {
      log("---> test")
      return getClass().getName()
    }
   
   int getVersion() {
      return 3
   }
   
    boolean extractorMatches(URL resourceUrl) {
      log("---> test2")
      return true
    }

   WebResourceContainer extractItems(URL resourceUrl, int maxItemsToRetrieve) {
      return null
   }
   
    ContentURLContainer extractUrl(WebResourceItem item, PreferredQuality requestedQuality) {
      return null
    }
}


thx

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 8:52 am
by zip
So when you copy it to the plugins folder, it won't show in the log as added? It might take a minute.

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 1:37 pm
by brunohansen
It doesn't show in the log! Don't mind how long I wait it doesn't show!

I've created a feed plugin and it does show in the log, maybe there's some problem with Web Resource Plugins!

It'll be amazing to create a Vevo plugin!

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 1:56 pm
by Illico
Do you try enable detailed logging ?

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 3:14 pm
by brunohansen
Illico wrote:Do you try enable detailed logging ?


No, but plugins don't show up in /rest/plugins.

I'll try to enable detailed logging.

Anyone could try my plugin? Maybe my code has some problem.

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 4:23 pm
by Illico
I will try...
You have to copy/paste your code to a ./serviio/plugins/vevo.groovy file
Do you have another groovy file on plugins folder ?

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 4:47 pm
by zip
Actually should be VevoBeta.groovy

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 5:08 pm
by brunohansen
Illico wrote:I will try...
You have to copy/paste your code to a ./serviio/plugins/vevo.groovy file
Do you have another groovy file on plugins folder ?


I've deleted all plugins from plugins folder so it only has VevoBeta.groovy inside.

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 6:39 pm
by Illico
So I have tested copy/paste your code into "VevoBeta.groovy" file.

And Serviio detect the plugin on log:

2013-04-24 20:37:37,828 INFO [PluginCompilerThread] Looking for plugins at C:\Program Files\Serviio\bin\..\plugins
2013-04-24 20:37:37,828 INFO [PluginCompilerThread] Started looking for plugins
2013-04-24 20:37:37,828 DEBUG [PluginCompilerThread] Starting plugin VevoBeta.groovy compilation

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 6:51 pm
by Illico
Suggest this code :
VevoBeta.groovy
(768 Bytes) Downloaded 800 times


Add WebResource url on serviio console: http://www.vevo.com


log:
2013-04-24 20:48:28,213 INFO [PluginCompilerThread] Looking for plugins at C:\Program Files\Serviio\bin\..\plugins
2013-04-24 20:48:28,213 INFO [PluginCompilerThread] Started looking for plugins
2013-04-24 20:48:28,213 DEBUG [PluginCompilerThread] Starting plugin VevoBeta.groovy compilation
...
2013-04-24 20:48:28,750 INFO [PluginCompilerThread] Added Web Resouce plugin VevoBeta (VevoBeta.groovy), version: 1
...
2013-04-24 20:48:54,564 DEBUG [OnlineLibraryManager] Resource http://www.vevo.com not in cache yet, loading it
2013-04-24 20:48:54,564 DEBUG [WebResourceParser] Parsing web resource 'http://www.vevo.com'
2013-04-24 20:48:54,565 DEBUG [WebResourceParser] Found matching url extractor (VevoBeta) for resource http://www.vevo.com
2013-04-24 20:48:54,565 DEBUG [FeedItemUrlExtractor] VevoBeta: Starting parsing resource: http://www.vevo.com
2013-04-24 20:48:54,665 DEBUG [FeedItemUrlExtractor] VevoBeta: ---> WebResourceContainer
2013-04-24 20:48:54,665 WARN [WebResourceParser] Plugin returned null container
2013-04-24 20:48:54,666 WARN [OnlineContentCacheDecorator] Could not store object to local cache (online_feeds): Value must not be null
2013-04-24 20:48:54,666 WARN [FeedUpdaterThread] An error occured while scanning for online item information, will continue
java.lang.NullPointerException
at org.serviio.library.online.OnlineLibraryManager.getEarliestItemExpiryDate(OnlineLibraryManager.java:313)
at org.serviio.library.online.OnlineLibraryManager.storeResourceExpiryDate(OnlineLibraryManager.java:358)
at org.serviio.library.online.OnlineLibraryManager.findResource(OnlineLibraryManager.java:177)
at org.serviio.library.online.OnlineLibraryManager.findResourceInCacheOrParse(OnlineLibraryManager.java:186)
at org.serviio.library.online.metadata.FeedUpdaterThread.getOnlineItems(FeedUpdaterThread.java:159)
at org.serviio.library.online.metadata.FeedUpdaterThread.run(FeedUpdaterThread.java:96)

Re: Plugin not added

PostPosted: Wed Apr 24, 2013 11:30 pm
by brunohansen
Illico wrote:Suggest this code :
VevoBeta.groovy


Add WebResource url on serviio console: http://www.vevo.com



Thanks! Now it's worked, but I don't know why...

Just more few questions:

- Serviio comes with some lib to parse Json or XML, like Jax-B or Jackson? It would help a lot when developing plugins!
- Can a plugins use other plugin, like youtube plugin? It would help a lot to!
- Is there a way to send filters by DLNA?
- Is there a way to show more than 20 results and use something like pagination?
- Is there a way to configure buffer size, to work with bad conections?

- I'm using a Wd Tv Live 3 generation, I've selected its profile but i can play you tube videos when high resolution is selected on online sources. Wd Tv says there's no media in current folder... I'm not using you tube plugin. I'll try to use it.

Thanks again!

Re: Plugin not added

PostPosted: Thu Apr 25, 2013 12:29 am
by brunohansen
It worked nice with YouTube plugin!

Re: Plugin not added

PostPosted: Thu Apr 25, 2013 4:40 am
by brunohansen
I've generate feeds links like this one https://gdata.youtube.com/feeds/api/vid ... ults=1&v=2

Is there a way to delegate to YouTube plugin process it?

Re: Plugin not added

PostPosted: Thu Apr 25, 2013 8:49 am
by zip
I guess you could just instantiate it and call a method on it. But it'd require the user to have both plugins installed, which is not so great.

Re xml/json - it's built into Groovy, look at the other plugins or examples (jsonparser/jsonslupres/xmlparser/xmlsluprer)

Re: Plugin not added

PostPosted: Thu Apr 25, 2013 1:37 pm
by brunohansen
zip wrote:I guess you could just instantiate it and call a method on it. But it'd require the user to have both plugins installed, which is not so great.


Yes, I can instantiate it. But FeedPlugin wait for a Map<String,URL> links provided for some Serviio Class so wich Serviio Class can I use to process a https://gdata.youtube.com/feeds/api... URL to get Map<String,URL> links?

  Code:
ContentURLContainer extractUrl(Map<String,URL> links, PreferredQuality requestedQuality)


zip wrote:Re xml/json - it's built into Groovy, look at the other plugins or examples (jsonparser/jsonslupres/xmlparser/xmlsluprer)


I've found it after I asked. Now I'm using jsonslupres, it's really nice!