Hi,
The code below works fine in plex, the only problem is that only one result is shown in plex after I parse the content from break.com into plex.
How is it possible that only one items shows up instead of all the twelve items that are available on the website?
# -*- coding: utf-8 -*-<br />
from PMS import *<br />
from PMS.Objects import *<br />
from PMS.Shortcuts import *<br />
<br />
VIDEO_TITLE = 'Break.com'<br />
VIDEO_PREFIX = '/video/break'<br />
BREAK_ROOT = 'http://www.break.com'<br />
BREAK_NEWEST = 'http://www.break.com/videos/newest/'<br />
BREAK_MVDAILY = 'http://www.break.com/videos/most-viewed-daily/'<br />
BREAK_MVWEEKLY = 'http://www.break.com/videos/most-viewed-weekly/'<br />
BREAK_MVMONTHLY = 'http://www.break.com/videos/most-viewed-monthly/'<br />
BREAK_MVALLTIME = 'http://www.break.com/videos/most-viewed/'<br />
BREAK_TRDAILY = 'http://www.break.com/videos/top-rated-daily/'<br />
BREAK_TRWEEKLY = 'http://www.break.com/videos/top-rated-weekly/'<br />
BREAK_TRMONTHLY = 'http://www.break.com/videos/top-rated-monthly/'<br />
BREAK_TRALLTIME = 'http://www.break.com/videos/top-rated/'<br />
BREAK_MDDAILY = 'http://www.break.com/videos/most-discussed-daily/'<br />
BREAK_MDWEEKLY = 'http://www.break.com/videos/most-discussed-weekly/'<br />
BREAK_MDMONTHLY = 'http://www.break.com/videos/most-discussed-monthly/'<br />
BREAK_MDALLTIME = 'http://www.break.com/videos/most-discussed/'<br />
BREAK_MSDAILY = 'http://www.break.com/videos/most-shared-daily/'<br />
BREAK_MSWEEKLY = 'http://www.break.com/videos/most-shared-weekly/'<br />
BREAK_MSMONTHLY = 'http://www.break.com/videos/most-shared-monthly/'<br />
BREAK_MSALLTIME = 'http://www.break.com/videos/most-shared/'<br />
<br />
XPATH_VIDEOS = "//div[@class='cat-cnt-item-th']"<br />
<br />
ART = 'art-back.png'<br />
ICON = 'icon-main.png'<br />
<br />
<br />
####################################################################################################<br />
<br />
def Start():<br />
<br />
Plugin.AddPrefixHandler(VIDEO_PREFIX, MainMenu, "Break.com", ICON, ART)<br />
<br />
Plugin.AddViewGroup("InfoList", viewMode="InfoList", mediaType="items")<br />
Plugin.AddViewGroup("List", viewMode="List", mediaType="items")<br />
<br />
MediaContainer.art = R('art-default.png')<br />
MediaContainer.title1 = "BREAK Videos"<br />
DirectoryItem.thumb = R('icon-default.png')<br />
<br />
####################################################################################################<br />
<br />
def MainMenu():<br />
<br />
dir = MediaContainer(viewGroup="InfoList")<br />
<br />
dir.Append(Function(DirectoryItem(Video, "Newest",thumb=R(ICON),art=R(ART)), url=BREAK_NEWEST))<br />
<br />
dir.Append(Function(DirectoryItem(Video, "Most Viewed - Daily",thumb=R(ICON),art=R(ART)), url=BREAK_MVDAILY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Viewed - Weekly",thumb=R(ICON),art=R(ART)), url=BREAK_MVWEEKLY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Viewed - Monthly",thumb=R(ICON),art=R(ART)), url=BREAK_MVMONTHLY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Viewed - All Time",thumb=R(ICON),art=R(ART)), url=BREAK_MVALLTIME))<br />
<br />
dir.Append(Function(DirectoryItem(Video, "Top Rated - Daily",thumb=R(ICON),art=R(ART)), url=BREAK_TRDAILY))<br />
dir.Append(Function(DirectoryItem(Video, "Top Rated - Weekly",thumb=R(ICON),art=R(ART)), url=BREAK_TRWEEKLY))<br />
dir.Append(Function(DirectoryItem(Video, "Top Rated - Monthly",thumb=R(ICON),art=R(ART)), url=BREAK_TRMONTHLY))<br />
dir.Append(Function(DirectoryItem(Video, "Top Rated - All Time",thumb=R(ICON),art=R(ART)), url=BREAK_TRALLTIME))<br />
<br />
dir.Append(Function(DirectoryItem(Video, "Most Discussed - Daily",thumb=R(ICON),art=R(ART)), url=BREAK_MDDAILY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Discussed - Weekly",thumb=R(ICON),art=R(ART)), url=BREAK_MDWEEKLY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Discussed - Monthly",thumb=R(ICON),art=R(ART)), url=BREAK_MDMONTHLY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Discussed - All Time",thumb=R(ICON),art=R(ART)), url=BREAK_MDALLTIME))<br />
<br />
dir.Append(Function(DirectoryItem(Video, "Most Shared - Daily",thumb=R(ICON),art=R(ART)), url=BREAK_MSDAILY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Shared - Weekly",thumb=R(ICON),art=R(ART)), url=BREAK_MSWEEKLY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Shared - Monthly",thumb=R(ICON),art=R(ART)), url=BREAK_MSMONTHLY))<br />
dir.Append(Function(DirectoryItem(Video, "Most Shared - All Time",thumb=R(ICON),art=R(ART)), url=BREAK_MSALLTIME))<br />
<br />
return dir<br />
<br />
####################################################################################################<br />
<br />
def Video(sender, url):<br />
<br />
dir = MediaContainer(title3=sender.itemTitle, art=R(ART), viewGroup="InfoList")<br />
<br />
videos = XML.ElementFromURL(url, isHTML=True, errors='ignore').xpath(XPATH_VIDEOS)<br />
for content in videos:<br />
title = content.xpath("./a/span")[0].text<br />
thumb = content.xpath("./a/img")[0].get('src')<br />
summary = content.xpath("./a")[0].get('title')<br />
for content2 in videos:<br />
url = content.xpath("./a")[0].get('href')<br />
dir.Append(Function(VideoItem(PlayVideo, title=title, summary=summary, thumb=thumb), url=url))<br />
<br />
return dir<br />
<br />
####################################################################################################<br />
<br />
def PlayVideo(sender, url):<br />
<br />
......<br />