FAQ  •  Register  •  Login

Stepashka.com (Web Resource)

<<

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Tue Feb 21, 2012 5:53 pm

Stepashka.com (Web Resource)

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.
Attachments
Stepashka.groovy
Stepashka.com Web Resource plugin v 4.0
(8.33 KiB) Downloaded 969 times
Last edited by qanatoz on Wed Sep 18, 2013 11:25 am, edited 8 times in total.
<<

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Sat Nov 17, 2012 11:40 pm

Re: Stepashka.com (Web Resource)

The plugin updated

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

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Wed Nov 28, 2012 10:56 pm

Re: Stepashka.com (Web Resource)

The plugin updated

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

snexus

Serviio newbie

Posts: 1

Joined: Sat Jan 12, 2013 10:09 am

Post Sat Jan 12, 2013 10:14 am

Re: Stepashka.com (Web Resource)

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
<<

vsn

Serviio newbie

Posts: 8

Joined: Tue May 15, 2012 9:36 am

Post Sun Jan 13, 2013 12:49 pm

Re: Stepashka.com (Web Resource)

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
<<

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Sun Jan 20, 2013 9:40 pm

Re: Stepashka.com (Web Resource)

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.
<<

vsn

Serviio newbie

Posts: 8

Joined: Tue May 15, 2012 9:36 am

Post Tue Mar 05, 2013 8:22 pm

Re: Stepashka.com (Web Resource)

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
<<

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Wed Mar 06, 2013 4:27 pm

Re: Stepashka.com (Web Resource)

Unfortunately no. :-(
There is no different quality levels inside.
<<

vsn

Serviio newbie

Posts: 8

Joined: Tue May 15, 2012 9:36 am

Post Wed Mar 06, 2013 7:27 pm

Re: Stepashka.com (Web Resource)

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
<<

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Sat Mar 09, 2013 1:00 pm

Re: Stepashka.com (Web Resource)

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.
<<

vsn

Serviio newbie

Posts: 8

Joined: Tue May 15, 2012 9:36 am

Post Sun Mar 10, 2013 7:08 pm

Re: Stepashka.com (Web Resource)

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!
<<

ditr

Serviio newbie

Posts: 4

Joined: Tue Mar 19, 2013 5:45 am

Post Tue Mar 19, 2013 5:47 am

Re: Stepashka.com (Web Resource)

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.
<<

ditr

Serviio newbie

Posts: 4

Joined: Tue Mar 19, 2013 5:45 am

Post Tue Mar 19, 2013 7:49 am

Re: Stepashka.com (Web Resource)

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()
<<

In_vain

Serviio newbie

Posts: 2

Joined: Fri Mar 22, 2013 1:24 am

Post Fri Mar 22, 2013 1:27 am

Re: Stepashka.com (Web Resource)

I'm new in Serviio. And have 0 experience in Java.

Could you please explain how to apply this patch?

Thanks.
<<

In_vain

Serviio newbie

Posts: 2

Joined: Fri Mar 22, 2013 1:24 am

Post Sat Mar 23, 2013 1:08 pm

Re: Stepashka.com (Web Resource)

Never mind. Figured out.
<<

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Mon Mar 25, 2013 11:00 am

Re: Stepashka.com (Web Resource)

Plugin updated.

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

rimidalvr1966

Serviio newbie

Posts: 3

Joined: Mon Oct 01, 2012 5:36 pm

Post Fri Mar 29, 2013 12:24 am

Re: Stepashka.com (Web Resource)

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.
<<

ditr

Serviio newbie

Posts: 4

Joined: Tue Mar 19, 2013 5:45 am

Post Mon May 06, 2013 8:09 am

Re: Stepashka.com (Web Resource)

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.
<<

ditr

Serviio newbie

Posts: 4

Joined: Tue Mar 19, 2013 5:45 am

Post Mon May 06, 2013 8:11 am

Re: Stepashka.com (Web Resource)

P.S. qanatoz - does it make sense to put this on GutHub so it will be easier to open issues, do pull requests etc?
<<

qanatoz

User avatar

Serviio lover

Posts: 64

Joined: Sun Feb 19, 2012 8:33 pm

Post Sat Jun 01, 2013 5:09 pm

Re: Stepashka.com (Web Resource)

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 :)
Next

Return to Available plugins

Who is online

Users browsing this forum: No registered users and 36 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.