Kodi Community Forum

Full Version: [RELEASE] WatchMeLater (Video Plugin) Addon - Add "Watch Me Later" to YouTube & Vimeo
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have made a add-on that reads a RSS feed, finds links to youtube and vimeo and lists these. I find it useful for collecting videos in a blog (usually from work) and letting me watch them later.

Depends on the youtube or youtube-beta and the vimeo or vimeo beta

Configure url to your rss feed and select your preferred youtube plugin

Grab it here , plugin.video.watchmelater.zip

UPDATE Bug fix, added vimeo and changed icon.
Really hoping that you're still working on this plugin! I'm using Radbox as my preferred watch-it-later site because of their instapaper styled bookmarklet, which really makes it easy to save my videos for viewing later. However their RSS feed doesn't work in XBMC. Your plugin sounds like it would function for this with some work, so I've run my Radbox RSS through some Yahoo piping to make it return an RSS with links to youtube and vimeo. You can find it here:

http://feeds.feedburner.com/radboxguysie

(using feedburner because the yahoo pipes link is waaay too long to fit into the xbmc window)

Sadly the script just fails when it tries to load this feed. Is it something I'm doing wrong, or something wrong with the feed, or maybe something I don't yet understand about the script?

Edit: Feedburner is being a total b*tch, so here's the pipe and a tinyurl instead:
http://pipes.yahoo.com/pipes/pipe.run?_i...render=rss
http://tinyurl.com/5u6g22r
If it helps, the xbmc.log tells me:

06:51:30 T:2823162768 M:114360320 ERROR: Error Type: exceptions.IndexError
06:51:30 T:2823162768 M:114421760 ERROR: Error Contents: list index out of range
06:51:30 T:2823162768 M:114421760 ERROR: Traceback (most recent call last):
File "/home/xbmc/.xbmc/addons/plugin.video.watchmelater/default.py", line 133, in ?
listFeed(feedUrl)
File "/home/xbmc/.xbmc/addons/plugin.video.watchmelater/default.py", line 63, in listFeed
itemUrl = items[n]('description')[0].contents[0] #encode('UTF-8'))
IndexError: list index out of range
06:51:30 T:3043182432 M:114421760 ERROR: GetDirectory - Error getting plugin://plugin.video.watchmelater/
06:51:30 T:3043182432 M:114421760 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.watchmelater/) failed
Fun to see someone else using it Big Grin
I use blogger and the blog this! extension to chrome.
The reason of the error are partly due to slappy coding from me and it seems as if one tag is missing in the feed. The code expects one "description" tag per item and it is there I parse out the vimeo or youtube links..
Code:
<item>
         <title>TED Blog | Phil Zimbardo and the Heroic Imagination Project: TED Blog exclusive video</title>
         <link>http://radbox.me/watch/video/35155</link>
         <guid isPermaLink="false">http://radbox.me/watch/video/35155</guid>
         <pubDate>Tue, 08 Feb 2011 04:29:53 +0000</pubDate>
      </item>
Popeye Wrote:. The code expects one "description" tag per item and it is there I parse out the vimeo or youtube links..

Thanks, I pulled that out of the feed and the script runs succesfully now! But still shows 0 hits in the directory. I think it's because you're using different strings to parse out the vimeo/youtube links. When I parse them from Radbox's RSS feed the vimeo/youtube links look like this:

http://player.vimeo.com/video/19474258
http://www.youtube.com/v/SYweCrksFWI?version=3

while your code seems to be looking for
Code:
re_vimeo = 'http://vimeo.com/(\d+)"'
re_youtube = 'http://www.youtube.com/watch\?.*v=(.*?)["&]'

I don't actually understand python so I gave it a try by editing the code to this:

Code:
re_vimeo = 'http://player.vimeo.com/video/(\d+)"'
re_youtube = 'http://www.youtube.com/v/(.*?)["&]'

But that still wouldn't work.
Okay, so I figured I'd tackle the problem from the other side - by changing the Yahoo Pipe around some more and have all the youtube/vimeo links parsed the way your addon wants them. The feedburner/pipe link above now have video's in the description that are formed just right, i.e.:

http://vimeo.com/19474258
http://www.youtube.com/watch?v=SYweCrksFWI

But still nothing shows up when I click on the Watch Me Later script...
I have fixed your problems Big Grin Grab the master zip from github

vimeo.com/video/231323 and youtube.com/v/jahsdgkashd should be working as well as the "old" style.
Thanks for working with me on this Popeye! I still can't get it to work though, 0 of anything in the directory when I run Watch Me Later... if you run my feed into your plugin, does it work at your end? I'm thinking I must be doing something wrong in my feed, but I can't figure out what.
GuySie Wrote:Thanks for working with me on this Popeye! I still can't get it to work though, 0 of anything in the directory when I run Watch Me Later... if you run my feed into your plugin, does it work at your end? I'm thinking I must be doing something wrong in my feed, but I can't figure out what.

Glad to help out and it solved non working vimeo links for me. Going to clean up the code a bit during the week.
I'm getting confused on what feed you are working with ;D but loking at the feedburner link i see

Code:
<description>http://www.youtube.com/watch?v=ZlUHx4h5zxw</description>
My code expects a proper html link since I used a fully working blogg as my source

Code:
<description>&lt;a href="http://vimeo.com/19115071"&gt;The Thomas Beale Cipher on Vimeo&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' alt='' /&gt;&lt;/div&gt;</description>
....
<description>&lt;a href="http://www.youtube.com/watch?v=hpwiU5Kigic&amp;amp;feature=player_embedded"&gt;YouTube - DOs and DON&amp;#39;Ts of Mobile Strategy&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' alt='' /&gt;&lt;/div&gt;</description>
You, sir, rock. That was all it took! (and it shows me that i'm really not a coder. I thought this might be the issue earlier, but didn't see anything in the code that made me think it was looking for an href, so I dropped it)

I'll do a bigger write-up for other Radbox users later. I'll also need to test what happens when a non-vimeo/youtube site gets added to the RSS (Radbox handles most well known video sites natively). But as proof-of-concepts go, this has completely made my day Big Grin
Thank you!
If you have a non-matching item it will not be added to the feed. If there exists add-ons for other sites handled by Radbox I'll might be able to add these depending on how they are coded..
As promised a more detailed write-up of what all this experimentation was good for:

Radbox is a video bookmarking site that lets you save your online videos for later viewing. It works similar to Instapaper - hit their bookmarklet on any video site, it will recognize the video and push it to their system. Log in later and you can see all your bookmarked videos. The cross-platform use makes this superior to using any single platform's watch-later functionality.

I've used Radbox for a few months now and love it, but one thing's missing - getting those video's into XBMC instead of just on my desktop. Doing that would make it the XBMC equivalent of Boxee's awesome queue function. Sadly Radbox doesn't have its own XBMC add-on yet and I haven't seen any dev interest in doing one, so this is the best solution in the meantime.

The WatchMeLater add-on by Popeye searches the descriptions in an RSS feed for links to YouTube or Vimeo, pulls out their video ID's and pushes these to the (previously installed) YouTube and Vimeo plugins on XBMC. Radbox has an mRSS feed, but not in the right format for WatchMeLater to parse. That's where Yahoo Pipes comes in - it pulls in the Radbox RSS, changes it up a bit, and the result is ready for WatchMeLater.

Radbox outputs the video's like this:
Code:
<item>
<pubDate>Mon, 14 Feb 2011 20:26:38 EST</pubDate>
<title>Gareth Pearson - Paranoid Android (Radiohead) - Solo Acoustic Guitar</title>
<link>http://radbox.me/watch/video/36577</link>
<guid>http://radbox.me/watch/video/36577</guid>
<description>Paranoid Android (Radiohead) arrangement by Gareth Pearson on his CD "Urban Echoes Vol 1" available at http://www.candyrat.com amazon.com, and itunes

Visit Gareth Pearson at http://www.myspace.com/garethpearson and http://www.garethpearson.com/</description>
<media:title>Gareth Pearson - Paranoid Android (Radiohead) - Solo Acoustic Guitar</media:title>
<media:description type="html">Paranoid Android (Radiohead) arrangement by Gareth Pearson on his CD "Urban Echoes Vol 1" available at http://www.candyrat.com amazon.com, and itunes

Visit Gareth Pearson at http://www.myspace.com/garethpearson and http://www.garethpearson.com/</media:description>
<media:thumbnail url="http://i2.ytimg.com/vi/QiC35isSciM/hqdefault.jpg" width="160" height="120" />
<media:content url="http://www.youtube.com/v/QiC35isSciM?version=3" type="application/x-shockwave-flash" medium="video" width="640" height="480" />
</item>
Note that this links to the Radbox page for the video, but still has the original video url in the media:content tag.

That's good, because WatchMeLater wants it to look like this (Actually, this is just a guess. Correct me, Popeye?):
Code:
<item>
<title>Gareth Pearson - Paranoid Android (Radiohead) - Solo Acoustic Guitar</title>
<description><a href="http://www.youtube.com/v/QiC35isSciM?version=3">Gareth Pearson - Paranoid Android (Radiohead) - Solo Acoustic Guitar</a></description>
</item>

So I've setup Yahoo Pipes to build a hyperlink from the URL in media:content.url and put it in the description. That Pipe is running here:
http://pipes.yahoo.com/pipes/pipe.info?_...481c153b21

As the resulting RSS URL from the Yahoo Pipe is so big I run it through TinyURL to get something I can easily enter on XBMC through a remote, and that's all there is to it.

Image

And voila, my Radbox videos ready to be played on the XBMC bigscreen:

Image

Limitations:
- Only newest 20 items in the Radbox RSS feed
- Currently depends on Yahoo Pipes, so slow to update (once every 30m?)
- Currently only supports YouTube and Vimeo. That's probably the mainstay of watched video's though
- RSS only so no API connection back to radbox, and no way to archive/favorite/delete from the XBMC interface
- Yahoo Pipes sometimes chokes on the Radbox RSS and stops parsing, giving you an empty feed. Not sure yet what causes it, but it goes away if you remove the offending video in Radbox...

Stuff I'd like to try in a Radbox oriented fork (would love Popeye's help on that?):
- Getting the video ID directly from Radbox's RSS (media:content.url) to remove the slow Pipes from the chain
- Getting more video details like description (media:description) and thumbnail (media:thumbnail.url) from that same RSS
- Adding more video sites that are supported by both Radbox and installed XBMC add-ons.
GuySie, great write-up!

My guesstimate of what you have described would make it quite easy to write a add-on for Radbox. If you could do some research of compatible stream providers and xbmc add-ons and an example feed/xml file for testing. I could then look at how to parse these and also how to hook into the compatible xbmc add-ons. Then it's just a matter of finding the time to code Big Grin
Popeye Wrote:If you could do some research of compatible stream providers and xbmc add-ons and an example feed/xml file for testing. I could then look at how to parse these and also how to hook into the compatible xbmc add-ons. Then it's just a matter of finding the time to code Big Grin

No problem, I can do the research! Could you build a quickie version that no longer needs Pipes but reads the video ID's from the Radbox RSS directly? That would solve most of my current problems, as Pipes turns out to be really laggy.
Could you try change "description" to "media:content" on line 56-57 ish?
Pages: 1 2