def RecentVideos(): dir = MediaContainer(FILE_DEFAULT_ART, title1=TEXT_IGN, title2=TEXT_RECENT_VIDEOS) first = True for row in LoadUrl(URL_ALL, CACHE_INT_RECENT).xpath(XPATH_RECENT_VIDEOS): if first: # Need to skip header row (Hey IGN, use a thead like the rest of us!) first = False continue url = row.find("td//a").get("href") name = row.find("td//a").text.strip() # Need to label category icon = row.find("td/img").get("src") # Again, IGN, how about some alt text? begin = icon.find("icon_") + 5 end = icon.find(".gif") label = icon[begin:end] if label == "video": nameLabeled = name else: nameLabeled = "[" + _L(label) + "] " + name dir.AppendItem(DirectoryItem(_E(url) + "||" + name, nameLabeled, None)) return dir.ToXML()
def RecentVideos(): dir = MediaContainer(FILE_DEFAULT_ART, title1=TEXT_IGN, title2=TEXT_RECENT_VIDEOS) first = True for row in LoadUrl(URL_ALL, CACHE_INT_RECENT).xpath(XPATH_RECENT_VIDEOS): if first: # Need to skip header row (Hey IGN, use a thead like the rest of us!) first = False continue url = row.find("td//a").get("href") name = row.find("td//a").text.strip() # Need to label category icon = row.find("td/img").get( "src") # Again, IGN, how about some alt text? begin = icon.find("icon_") + 5 end = icon.find(".gif") label = icon[begin:end] if label == "video": nameLabeled = name else: nameLabeled = "[" + _L(label) + "] " + name dir.AppendItem(DirectoryItem(_E(url) + "||" + name, nameLabeled, None)) return dir.ToXML()
IGN_PREFIX = "/video/ign" URL_HOME = "http://video.ign.com/" URL_ALL = "http://www.ign.com/index/videos.html" URL_VIDEO_SERIES = "http://video.ign.com/index/videoseries.html" CACHE_INT_HOME = 1800 # 30 Minutes CACHE_INT_VIDEO_PAGE = 604800 # 1 Week CACHE_INT_SERIES_LIST = 604800 # 1 Week CACHE_INT_VIDEO_SERIES = 86400 # 1 Day CACHE_INT_RECENT = 86400 # 1 Day LIMIT_SERIES_EPISODES = 7 # 8 rows in MediaStream List mode, leaves room for All Episodes option TEXT_IGN = _L("ign") TEXT_TOP_VIDEOS = _L("topVideos") TEXT_LATEST_VIDEOS = _L("latestVideos") TEXT_GAME_TRAILERS = _L("gameTrailers") TEXT_MOVIE_TRAILERS = _L("movieTrailers") TEXT_REVIEWS = _L("reviews") TEXT_PREVIEWS = _L("previews") TEXT_VIDEO_SERIES = _L("videoSeries") TEXT_ALL_SERIES = _L("allSeries") TEXT_ALL_EPISODES = _L("allEpisodes") TEXT_HIT_LIST = _L("hitList") TEXT_RECENT_VIDEOS = _L("recentVideos") TEXT_ALL_VIDEOS = _L("allVideos") TEXT_INSIDER_IND = "[" + _L("insider") + "]" PATH_TOP_VIDEOS = "top"
def Start(): Plugin.AddRequestHandler(PLUGIN_PREFIX, HandleRequest, _L("Arcade"), "icon-default.png", "art-default.jpg") Plugin.AddViewGroup("InfoList", viewMode="InfoList", contentType="items")