Page 1 of 2

Stepashka.com (Web Resource)

PostPosted: Tue Feb 21, 2012 5:53 pm
by qanatoz
Image

Stepashka.com Web Resource plugin
Source type: Web Resource
Media type: Video
Version: 4

Allows playing online movies and series from Stepashka.com forum

Changes in version 1.3
  • Fixed resource title extraction
  • Fixed extraction of links in new format

Changes in version 1.4
  • Added play lists content decryption for series

Changes in version 1.4.1
  • Fixed bug of title extraction

Changes in version 2.0
  • Added support for new title format
  • Added fix with try\catch from @ditr
  • Added versioning support

Changes in version 3.0
  • Added URL redirect support

Changes in version 4.0
  • Added support for new type series playlists


Online movie example:
Online series example:

*Note: The URL’s must be configured as a Web Resource.

Re: Stepashka.com (Web Resource)

PostPosted: Sat Nov 17, 2012 11:40 pm
by qanatoz
The plugin updated

Changes in version 1.3
  • Fixed resource title extraction
  • Fixed extraction of links in new format

Re: Stepashka.com (Web Resource)

PostPosted: Wed Nov 28, 2012 10:56 pm
by qanatoz
The plugin updated

Changes in version 1.4
  • Added play lists content decryption for series

Re: Stepashka.com (Web Resource)

PostPosted: Sat Jan 12, 2013 10:14 am
by snexus
Hi,
Thank you for this useful plugin...However, it doesn't work for me:
Details from the log file
  Code:
2013-01-12 18:10:28,043 WARN  [FeedUpdaterThread] An error occured while scanning for online item information, will continue
java.io.IOException: Unexpected error while invoking plugin (Stepashka): index is out of range 0..-1 (index = 0)
   at org.serviio.library.online.WebResourceParser.parse(WebResourceParser.java:58)
   at org.serviio.library.online.OnlineLibraryManager.findResource(OnlineLibraryManager.java:171)
   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)
Caused by: java.lang.IndexOutOfBoundsException: index is out of range 0..-1 (index = 0)
   at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:6202)
   at org.codehaus.groovy.runtime.dgm$310.invoke(Unknown Source)
   at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
   at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
   at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
   at Stepashka.extractItems(Stepashka.groovy:37)
   at org.serviio.library.online.WebResourceUrlExtractor$1.executePluginMethod(WebResourceUrlExtractor.java:32)
   at org.serviio.library.online.WebResourceUrlExtractor$1.executePluginMethod(WebResourceUrlExtractor.java:29)
   at org.serviio.library.online.PluginExecutionProcessor$1.call(PluginExecutionProcessor.java:50)


I've added these series as a web resource:
http://online.stepashka.com/serialy/eng ... -2012.html

Looking forward for your assitance,

Thanks

Re: Stepashka.com (Web Resource)

PostPosted: Sun Jan 13, 2013 12:49 pm
by vsn
Hi there,

Exactly the same problem as snexus suffers using the following link http://online.stepashka.com/filmy/dramy/12293-temnyy-rycar-vozrozhdenie-legendy-the-dark-knight-rises-2012.html. I am using Serviio 1.1 + Stepashka 1.4, Ubuntu 10.4 and OpenJDK Java 6. Please tell me if you need more info.

PS great plugin, thanks for your job.

BR,

vsn

Re: Stepashka.com (Web Resource)

PostPosted: Sun Jan 20, 2013 9:40 pm
by qanatoz
The plugin updated

Changes in version 1.4.1
  • Fixed bug of title extraction


@vsn/ @snexus

Please let me know if this version fixes the problem.

Re: Stepashka.com (Web Resource)

PostPosted: Tue Mar 05, 2013 8:22 pm
by vsn
Hi qanatoz,

Yes, I can confirm it works now. Great job. Sorry for delay...

Btw is there any possibility to improve the quality of streaming?

Thx!

BR

VSN

Re: Stepashka.com (Web Resource)

PostPosted: Wed Mar 06, 2013 4:27 pm
by qanatoz
Unfortunately no. :-(
There is no different quality levels inside.

Re: Stepashka.com (Web Resource)

PostPosted: Wed Mar 06, 2013 7:27 pm
by vsn
do you feel like to develop a simular plug in for vk.com? They have a huge media collection, fast servers and goot quality. I'm not a developer, but I took a fast look at your code and it doesn't seem to be a big affort. What do you think?

BR

VSN

PS http://forum.serviio.org/viewtopic.php?f=21&t=6631

Re: Stepashka.com (Web Resource)

PostPosted: Sat Mar 09, 2013 1:00 pm
by qanatoz
vsn wrote:do you feel like to develop a simular plug in for vk.com? They have a huge media collection, fast servers and goot quality. I'm not a developer, but I took a fast look at your code and it doesn't seem to be a big affort. What do you think?


I'm not familiar with VK.com site.
Did it require user authentication to watch videos?
Can you post some links examples? I will take a look.

Re: Stepashka.com (Web Resource)

PostPosted: Sun Mar 10, 2013 7:08 pm
by vsn
qanatoz wrote:Did it require user authentication to watch videos?
Can you post some links examples? I will take a look.


Hi,

regarding authentication - yes, but there are some ways how to handle it.

Try with this one

http://vk.com/video_ext.php?oid=25977524&id=161038916&hash=8445b0cf2091a72d&hd=3

As you can see video id, user id, hash and video qulity are defind in the link.

Good luck!

Re: Stepashka.com (Web Resource)

PostPosted: Tue Mar 19, 2013 5:47 am
by ditr
qanatoz - many thanks for plugin. Just thought may be it makes sense to add try-catch around webResourceTitle so even if it fails the moive will work. Better experience than everything after some movie that has broken html page (or whatever else can be the cause) just not being added/played at all.


Thanks.

Re: Stepashka.com (Web Resource)

PostPosted: Tue Mar 19, 2013 7:49 am
by ditr
A quick patch for "out of bounds" I started to get a day ago. Shall be backward compatible too

  Code:
21c21
<  * @version 1.4.2
---
>  * @version 1.4.1
25c25
<     final static WEB_RESOURCE_TITLE                         = /(?s)<h1 class=\"?btl\"?>(.*?)<\/h1>/
---
>     final static WEB_RESOURCE_TITLE                         = /(?s)<h1 class=\"btl\">(.*?)<\/h1>/
39,44c39
<         String webResourceTitle;
<         try {
<             webResourceTitle = (((pageSource =~ WEB_RESOURCE_TITLE)[0]-null)[-1]).trim()
<         } catch (Exception ex) {
<             webResourceTitle = "Unknown title";
<         }
---
>         String webResourceTitle =(((pageSource =~ WEB_RESOURCE_TITLE)[0]-null)[-1]).trim()

Re: Stepashka.com (Web Resource)

PostPosted: Fri Mar 22, 2013 1:27 am
by In_vain
I'm new in Serviio. And have 0 experience in Java.

Could you please explain how to apply this patch?

Thanks.

Re: Stepashka.com (Web Resource)

PostPosted: Sat Mar 23, 2013 1:08 pm
by In_vain
Never mind. Figured out.

Re: Stepashka.com (Web Resource)

PostPosted: Mon Mar 25, 2013 11:00 am
by qanatoz
Plugin updated.

Changes in version 2.0
  • Added support for new title format
  • Added fix with try\catch from @ditr
  • Added versioning support

Re: Stepashka.com (Web Resource)

PostPosted: Fri Mar 29, 2013 12:24 am
by rimidalvr1966
Have the same problem as snexus and vsn. Downloaded new plugin, added http://online.stepashka.com/god-2013/25 ... -2013.html as web resource and still no go.Here is my log
2013-03-28 19:23:25,758 WARN [FeedUpdaterThread] An error occured while scanning for online item information, will continue
java.io.IOException: Unexpected error while invoking plugin (Stepashka): assert videoResources.size() > 0
| | |
| 0 false
java.util.regex.Matcher[pattern=(?s)(&amp;|&)pl=(.*?)" region=0,96074 lastmatch=]
at org.serviio.library.online.WebResourceParser.parse(WebResourceParser.java:58)
at org.serviio.library.online.OnlineLibraryManager.findResource(OnlineLibraryManager.java:171)
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)
Caused by: Assertion failed:

assert videoResources.size() > 0
| | |
| 0 false
java.util.regex.Matcher[pattern=(?s)(&amp;|&)pl=(.*?)" region=0,96074 lastmatch=]

at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:386)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:658)
at Stepashka.extractItems(Stepashka.groovy:55)
at org.serviio.library.online.WebResourceUrlExtractor$1.executePluginMethod(WebResourceUrlExtractor.java:32)
at org.serviio.library.online.WebResourceUrlExtractor$1.executePluginMethod(WebResourceUrlExtractor.java:29)
at org.serviio.library.online.PluginExecutionProcessor$1.call(PluginExecutionProcessor.java:50)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

What did I do wrong? Thank you.
P.S. Forgot to mention, I use Serviio 1.2.1 if it makes any difference.
Thank you.

Re: Stepashka.com (Web Resource)

PostPosted: Mon May 06, 2013 8:09 am
by ditr
You are probably watching series. They recently shuffled some file locations on server and old locations are now returning redirects, that plugin doesn't support. As a workaround before fix - get your url, paste it into browser, you'll see that when it opens the url is changed and is now different. Re-add your series with new url.

Or if you feel adventurous apply this diff

  Code:
--- stepashka.groovy    2013-03-25 03:53:44.000000000 -0700
+++ stepashka.groovy.new        2013-05-06 01:07:31.717540179 -0700
@@ -68,18 +68,35 @@
     }

     private String openURL(URL url){
-        Request request = new Request(Method.GET, url.toString());
         Client client = new Client(Protocol.HTTP);
         ClientInfo info = new ClientInfo();
         info.setAgent(USER_AGENT);
-        request.setClientInfo(info);
-        Response response = client.handle(request);
-        String orPageSource
-        if(Status.SUCCESS_OK.equals(response.getStatus())){
-            return response.getEntityAsText()
-        }
+        Response response = null;
+        int followed = 0;
+        while (response == null && followed < 10) {
+            log("Retrieving URL " + url.toString());
+            Request request = new Request(Method.GET, url.toString());
+            request.setClientInfo(info);
+            response = client.handle(request);
+            String orPageSource
+            if(Status.SUCCESS_OK.equals(response.getStatus())){
+                return response.getEntityAsText()
+            } else if (
+                Status.REDIRECTION_PERMANENT.equals(response.getStatus()) ||
+                Status.REDIRECTION_TEMPORARY.equals(response.getStatus()) ||
+                Status.REDIRECTION_FOUND.equals(response.getStatus())
+             ){
+                url = response.getLocationRef().toUrl();
+                response = null;
+                log("Is redirect to " + url.toString());
+            } else  {
+                break;
+            }
+            ++followed;
+        };
         return ""
     }
+
     /**
      * Finds all actual video links and titles in received data
      * @param data to search


by running copy-pasting this into stepashka.groovy.patch and doing

  Code:
patch stepashka.groovy < stepashka.groovy.patch




There is probably better way of following redirects in java restlets, but I never encountered them before so this is pretty much quick and dirty fix.

Re: Stepashka.com (Web Resource)

PostPosted: Mon May 06, 2013 8:11 am
by ditr
P.S. qanatoz - does it make sense to put this on GutHub so it will be easier to open issues, do pull requests etc?

Re: Stepashka.com (Web Resource)

PostPosted: Sat Jun 01, 2013 5:09 pm
by qanatoz
Plugin updated

Changes in version 3.0
  • Added URL redirect support

Hi @ditr,
I not think that it's making some sense to put one, small file to version control :)