Page 1 of 1

StarCraft 2 and websites offering embedded Youtube videos.

PostPosted: Sun Sep 25, 2011 1:32 am
by sampath.mamilapo
Hi,

there are websites like http://sc2casts.com which offer a feed (http://sc2casts.com/rss) that includes URLs to their website where Youtube videos are embedded.

Obviously I would like to have a plugin that extracts the URLs from http://sc2casts.com/rss and then allow Serviio to list the embedded Youtube videos.

Cheers,
Sampy

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Sun Sep 25, 2011 10:07 am
by AMoo-Miki
Hi,

I have coded the plugin for you, but there is a minor problem. Java doesn't like the RSS feed sent over by SC2Casts. I am looking at a way to build an interface that will fix the feed, so that Java will play nice with it. Stay tuned :)

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Sun Sep 25, 2011 11:33 am
by AMoo-Miki
Here you go. Download the attached file which is named SC2Casts.groovy and place it in the plugins folder of your serviio installation.

The open the console of your serviio 0.6 and go to the library -> online sources. Hit add and paste this address in there: http://barahmand.com/serviio/sc2casts.php
The url above is to fix the BOM at the beginning of the rss feed, which Java doesn't like.

lemmi know if things don't go as expected.

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Sun Sep 25, 2011 12:03 pm
by sampath.mamilapo
Thanks a lot. I will try it immediately :D

I would be nice to modify the groovy code in a way that it directly can eat the original rss. Does it just throw an exception and then end or could you just catch it and it would be peachy?

Cheers,
Sampy

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Sun Sep 25, 2011 2:49 pm
by zip
AMoo-Miki wrote:Here you go. Download the attached file which is named SC2Casts.groovy and place it in the plugins folder of your serviio installation.

The open the console of your serviio 0.6 and go to the library -> online sources. Hit add and paste this address in there: http://barahmand.com/serviio/sc2casts.php
The url above is to fix the BOM at the beginning of the rss feed, which Java doesn't like.

lemmi know if things don't go as expected.

great, can you upload the plugin to the Available plugins section?

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Sun Sep 25, 2011 8:23 pm
by AMoo-Miki
The thing is Java's XML parser doesn't like the BOM at the beginning and an exception terminates the handling of the XML.
The source code to what i am serving is pretty simple:
  Code:
<?= preg_replace("#^[^<]*#", '', file_get_contents('http://sc2casts.com/rss/rss.php')); ?>


Maybe Serviio will implement a similar mechanism before it goes ahead with passing the content to the parser, coz this will not be the only feed that has BOM.

@zip: Sure :)

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Mon Sep 26, 2011 12:17 am
by sampath.mamilapo
I don't how you write these plugins but can't you 'modify' the BOM before handing it over to the XML parser? Or use a different parser that does not exit with this BOM?

On a different note, I tried the plugin and it works great except a little problem where it only extracts the last embedded Youtube video on a webpage.

Most webpages have more then one video embedded and in that case it only lists the last video in Serviio/on my TV.

Cheers,
Sampy

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Mon Sep 26, 2011 8:52 am
by zip

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Mon Sep 26, 2011 9:10 am
by AMoo-Miki
Sampy,

zip has it planned up to take care of BOM in the next release. Thereafter we wouldn't need my transformer and you can have the original feed used.

Also, i will make a change to make sure it loads them all. Gimmi a couple of hours though.

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Mon Sep 26, 2011 8:20 pm
by sampath.mamilapo
Don't worry...no rush. I am very greatful for your nice plugins :D

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Sat Oct 01, 2011 5:46 pm
by sampath.mamilapo
Ok...now I am wondering where the plugin is at :D

I said no rush but that was almost a week ago ;)

Re: StarCraft 2 and websites offering embedded Youtube video

PostPosted: Wed Oct 23, 2013 7:28 am
by venkat1926
Serviio newbie
Posts: 10
Joined: Sat Sep 24, 2011 11:52 pm
Post Sun Sep 25, 2011 5:03 pm
Re: StarCraft 2 and websites offering embedded Youtube video
Here you go. Download the attached file which is named SC2Casts.groovy and place it in the plugins folder of your serviio installation.

The open the console of your serviio 0.6 and go to the library -> online sources. Hit add and paste this address in there: http://barahmand.com/serviio/sc2casts.php
The url above is to fix the BOM at the beginning of the rss feed, which Java doesn't like.

lemmi know if things don't go as expected.
ATTACHMENTS
SC2Casts.groovy
SC2Casts Plugin
(5.89 KiB) Downloaded 46 times



thanks.
when I click scecasts.groovy error comes
error message comes
"w"indows want to know which progsrams to use to dowload this file

any suggestisons