I’ve had limited XPath / Python experience but I thought I’d jump into some existing code and see if I could get a hand on things. I was going to try a plugin for South Park Studios but I can’t find the SWF that Plex would need. I just want to get a hard coded one playing before I dig in to parsing episodes and seasons.
The closest URL I could find to an actual episode is this. I’m not sure that would be the right thing anyway since you need to click Play for it to start. Given that URL, Plex logs “Compressed SWF format not supported.” It seems like that file may just be a pointer to the actual video. Are some sites just not going to work with this or am I missing something? (I’m assuming the latter!)
You may want to choose a site other than South Park Studios, it could end up being wasted effort in a few days time… 
I know what it looks like, we’re big plug-in hogs…We can’t help it, they’re easy, fun, and addictive to write 
So true. But nice to get to know to Python at the same time :rolleyes:
I can't say I didn't think that was a good possibility! Still I'm interested in getting my bearings with this for the future. Maybe when you (or whoever) finishes, you could let me know how you go about finding the path to each site's videos? Depending on when the doc is coming, that is.
Are you trying to load the SWF directly in Plex? This won’t work. The way we get Flash video playing is by loading the entire page in the media server using WebKit (it behaves exactly like loading the page in Safari). We then capture the output of the player and pass it along to Plex.
If you take a look inside SiteConfigurations.bundle, you’ll see the config files for the sites we currently support. You can create your own site configs by adding them to “~/Library/Application Support/Plex Media Server/Site Configurations”. Then, to play Flash video in Plex, your plugin needs to send a MediaContainer containing a WebVideoItem back to Plex containing the URL of the page containing the video. If everything’s been set up properly, the page will be loaded, the player will be captured & any mouse events you’ve defined to start the video will be sent.
Jam, you tha man =)
Can you point me in a direction to a specific app that would be useful to look at when we will try to create an App for www.svtplay.se this weekend? I know you guys are busy as heck, but I see some different solutions for each site and it drives me nuts while Im trying to figure out which app is closest to the ones that we want to write.
Kick-ass method by the way, I really like your thinking on this framework.
Thanks for the support!! Once things are a bit quieter we’ll be releasing updates for the framework that should hopefully reduce the amount of code you need to write even more, and smooth out some code conventions & naming inconsistencies between the different modules. This won’t break any existing code, but newer plug-ins will be able to target updated framework versions & benefit from the more streamlined API.
Yeah, it drove us nuts too working out some of the solutions! They’re all very different because the sites all present their information in different ways, so each plug-in targets a site very specifically. Luckily, the awesome lxml library included in the framework makes it very easy to grab content from pages using XPath.
The best ones for you to check out would probably be Hulu and Joost, as they’re the ones that present the most complicated content trees. Which part are you having trouble with? Creating the content tree, or getting data off the site? Yes, we are very busy at the moment as the new releases have generated quite a lot of buzz online, but please feel free to PM or email me if you have any questions - for us, the major part of the plug-in system is that anyone can write plug-ins, and we want to do everything we can to help & encourage developers
We want to get as many plug-ins in the App Store as possible!
Oh, and if you haven’t got it already, I highly recommend Firefox + the “XPath Checker” extension. This saves SO much time when trying to find the right XPath queries for sites.
Hmm... where should I right click to get correct Xpath?
It saves time mostly by matching as you type & giving you an instant preview of what items will be returned.
I have used FireBug extension to check XPaths… works as well. Though, I noticed that if I try to use too long absolute XPath I might run into problems. One neat feature in XPath, I found, is to find the specific element by its attribute, like this:
xpath("//div[@class='video']")
I had some problems with elements having multiple classes, though. But I found a solution. This finds all divs that are have a 'video' class declared:
xpath("//div[contains(@class, 'video')]")
Happy XPathing!
edit: typos
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.