Channel not showing up after putting in bundle.

Hey, I’ve been dabbling in making a simple plex channel.
Basically I wanted to use this site http://sugoideas.com/variety-shows/fengshui/ and take the links and youtube videos in there and just play them.

http://www.pastebin.ca/3058123

This is the code I have written up. It’s based off another plugin. Any thing wrong with it?

But yeah, I was able to use the channel for a second at some point and then it worked until I got up to the video and it said the channel is not responding.

Any idea why the channel isn’t appearing? I put the bundle with contents and code folder all inside plugins folder appdata/local/plex/plugins.

Thank you for any help.

Change
video_url = page_data.xpath("//iframe[@class='youtube-player]/@src")
to
video_url = page_data.xpath("//iframe[@class='youtube-player]/@src")[0]
on line 83. I think that should do the trick.

Thanks sander1, that makes sense and I fixed that.

However, main problem is that the channel won’t show up under channels in plex.

I should be seeing FengShui there, but it’s not showing up. Is there a reason that this could happen?

Update: I was able to fix the problem of the channel not appearing by deleting the cache and data of the channel in the plugin-support folder.

However now I think I’m just having problems with channel responding. After further playing around with it, I was able to figure out that one of the links work. However, for some reason I don’t understand why only that one works.

The src is the xpath I’m trying to get so I did,

def Play(ep_url,ep_title):

oc = ObjectContainer()
pagedata = HTML.ElementFromURL(ep_url)
video_url = pagedata.xpath("//div//span//iframe[@class='youtube-player']/@src")[0]
oc.add(VideoClipObject(url=video_url, title=ep_title))
return oc

Looking at the logs, I get when it works:

2015-07-12 15:27:02,799 (894) : DEBUG (runtime:717) - Handling request GET /video/FengShui/play?ep_title=%E9%A2%A8%E6%B0%B4%21+%E6%9C%89%E9%97%9C%E4%BF%82+2015-06-27&ep_url=http%3A%2F%2Fscgoideas.com%2F%25e9%25a2%25a8%25e6%25b0%25b4-%25e6%259c%2589%25e9%2597%259c%25e4%25bf%2582-2015-06-27%2F
2015-07-12 15:27:02,802 (894) : DEBUG (runtime:814) - Found route matching /video/FengShui/play
2015-07-12 15:27:02,805 (894) : DEBUG (networking:172) - Requesting ‘http://scgoideas.com/風水-有關係-2015-06-27/
2015-07-12 15:27:02,862 (894) : DEBUG (services:616) - Found a service matching ‘http://www.youtube.com/embed/ZTsCTuFC2qA?version=3&rel=0&fs=1&showsearch=0&showinfo=0&iv_load_policy=3&wmode=transparent&theme=light&modestbranding&autoplay=1’ - YouTube (com.plexapp.plugins.youtube)
2015-07-12 15:27:02,867 (894) : DEBUG (services:616) - Found a service matching ‘http://www.youtube.com/embed/ZTsCTuFC2qA?version=3&rel=0&fs=1&showsearch=0&showinfo=0&iv_load_policy=3&wmode=transparent&theme=light&modestbranding&autoplay=1’ - YouTube (com.plexapp.plugins.youtube)
2015-07-12 15:27:02,868 (894) : DEBUG (services:616) - Found a service matching ‘https://www.youtube.com/watch?v=ZTsCTuFC2qA’ - YouTube (com.plexapp.plugins.youtube)
2015-07-12 15:27:02,875 (894) : DEBUG (runtime:106) - Sending packed state data (593 bytes)
2015-07-12 15:27:02,875 (894) : DEBUG (runtime:918) - Response: [200] MediaContainer, 4892 bytes

And I get when it does channel is not responding.

2015-07-12 15:42:43,734 (1298) : DEBUG (runtime:717) - Handling request GET /video/FengShui
2015-07-12 15:42:43,736 (1298) : DEBUG (runtime:814) - Found route matching /video/FengShui
2015-07-12 15:42:43,737 (1298) : DEBUG (base:117) - Checking if com.plexapp.plugins.fengshui is broken
2015-07-12 15:42:43,739 (1298) : DEBUG (networking:172) - Requesting ‘http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjgKY29tLnBsZXhhcHAucGx1Z2lucy5mZW5nc2h1aXMxMAppZGVudGlmaWVycjAK
2015-07-12 15:42:43,750 (1298) : DEBUG (runtime:106) - Sending packed state data (109 bytes)
2015-07-12 15:42:43,750 (1298) : DEBUG (runtime:918) - Response: [200] MediaContainer, 574 bytes

Any ideas?