The branch, frodo has been updated
via 31109ee2f3b7cd30ad99464221132e76e43a2faa (commit)
from 251b715354efe1c00c71dcce949f0a86299d0db4 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=31109ee2f3b7cd30ad99464221132e76e43a2faa
commit 31109ee2f3b7cd30ad99464221132e76e43a2faa
Author: beenje <[email protected]>
Date: Thu May 23 23:15:07 2013 +0200
[plugin.video.gametrailerscom] updated to version 1.0.2
diff --git a/plugin.video.gametrailerscom/addon.py
b/plugin.video.gametrailerscom/addon.py
index 7b84965..830849d 100644
--- a/plugin.video.gametrailerscom/addon.py
+++ b/plugin.video.gametrailerscom/addon.py
@@ -23,6 +23,7 @@
import xbmcaddon
import xbmcgui
import urllib2
+import urllib
from xbmcswift2 import Plugin
plugin = Plugin()
@@ -39,9 +40,11 @@ common.plugin = common.plugin = __plugin__ + __version__
video_base = "http://www.gametrailers.com/feeds/mediagen/?uri="
video_info_base = "http://www.gametrailers.com/feeds/mrss?uri="
video_list_base =
"http://www.gametrailers.com/feeds/line_listing_results/video_hub/6bc9c4b7-0147-4861-9dac-7bfe8db9a141/?sortBy=most_recent"
+search_base =
"http://www.gametrailers.com/feeds/search/child/c9c01382-1f7c-4a3a-b68f-2e5ecc67fdd3/?sortBy=most_recent&tabName=videos&keywords="
console_list_base = {
"xbox360":
"http://www.gametrailers.com/feeds/line_listing_results/platform_video_index/7735689f-1a2a-4784-b6af-7ebe6edc3dc5/?sortBy=most_recent",
+ "xbox-one":
"http://www.gametrailers.com/feeds/line_listing_results/platform_video_index/be374856-0c7e-4260-8027-283ea432f344/?sortBy=most_recent",
"ps4":
"http://www.gametrailers.com/feeds/line_listing_results/platform_video_index/d73075e8-95dd-4697-80df-67973db75705/?sortBy=most_recent",
"ps3":
"http://www.gametrailers.com/feeds/line_listing_results/platform_video_index/bf20b32b-16b6-4507-8402-ed038d7aa9ed/?sortBy=most_recent",
"wii-u":
"http://www.gametrailers.com/feeds/line_listing_results/platform_video_index/38970bbb-36e6-4403-a050-57edc1de0af2/?sortBy=most_recent",
@@ -83,12 +86,14 @@ def index():
{"label": get_string(40006), "icon": icon, "path":
plugin.url_for("get_videos", url=video_list_base + "&category=Features",
page=1, multi_part=False)},
{"label": get_string(40007), "icon": icon, "path":
plugin.url_for("get_videos", url=video_list_base + "&category=Preview", page=1,
multi_part=False)},
{"label": get_string(40008), "icon": icon, "path":
plugin.url_for("get_videos", url=video_list_base + "&category=Review", page=1,
multi_part=False)},
+ {"label": get_string(40018), "icon": icon, "path":
plugin.url_for("search")},
]
@plugin.route("/get_consoles/")
def get_consoles():
return [
+ {"label": get_string(40017), "icon": icon, "path":
plugin.url_for("get_console_categories", console="xbox-one")},
{"label": get_string(40010), "icon": icon, "path":
plugin.url_for("get_console_categories", console="xbox360")},
{"label": get_string(40011), "icon": icon, "path":
plugin.url_for("get_console_categories", console="ps4")},
{"label": get_string(40012), "icon": icon, "path":
plugin.url_for("get_console_categories", console="ps3")},
@@ -150,7 +155,18 @@ def get_show_episodes(url, multi_part):
def get_videos(url, page, multi_part):
list_items = list()
data = urllib2.urlopen(url + "¤tPage=" +
str(page)).read().decode("utf-8", "ignore")
- items = common.parseDOM(html=data, name="li")
+
+ if "feeds/search/child" in url: # Search results
+ # This is hacky but parseDOM can only get the content from DOM
element, not the element itself.
+ # Get the id of the element, get element content and then rebuild it.
+ ids = common.parseDOM(html=data, name="div", ret="data-contentId")
+ items = common.parseDOM(html=data, name="div", attrs={"class":
"video_information"})
+ for i in range(len(items)):
+ new_div = "<div class=\"video_information\" data-contentId=\"" +
ids[i] + "\">" + items[i] + "</div>"
+ items[i] = new_div
+ else:
+ items = common.parseDOM(html=data, name="li")
+
media_items = [x for x in items if "video_information" in x]
pagination = common.parseDOM(html=data, name="div", attrs={"class":
"pagination"})
@@ -160,7 +176,7 @@ def get_videos(url, page, multi_part):
title_b =
common.replaceHTMLCodes(common.stripTags(common.parseDOM(html=item,
name="h4")[0]))
title = "%s - %s" % (title_a, title_b)
image = common.parseDOM(html=item, name="meta", attrs={"itemprop":
"thumbnailUrl"}, ret="content")[0]
- is_playable = multi_part == "False"
+ is_playable = multi_part == "False" or multi_part == False
if is_playable == False:
path = plugin.url_for("get_multi_part", video_id=item_id,
image=image)
@@ -194,6 +210,17 @@ def get_multi_part(video_id, image):
return act_list
[email protected]("/search/")
+def search():
+ kb = xbmc.Keyboard("", get_string(40019), False)
+ kb.doModal()
+ if kb.isConfirmed():
+ text = urllib.quote_plus(kb.getText())
+ url = search_base + text
+ return get_videos(url=url, page=1, multi_part=False)
+ return
+
+
@plugin.route("/play/<path>/")
def play_video(path):
video_xml = urllib2.urlopen(path).read().decode("utf-8", "ignore")
diff --git a/plugin.video.gametrailerscom/addon.xml
b/plugin.video.gametrailerscom/addon.xml
index a0bcedb..142e5bc 100644
--- a/plugin.video.gametrailerscom/addon.xml
+++ b/plugin.video.gametrailerscom/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.gametrailerscom" version="1.0.1"
name="GameTrailers.com" provider-name="David Gray (N3MIS15)">
+<addon id="plugin.video.gametrailerscom" version="1.0.2"
name="GameTrailers.com" provider-name="David Gray (N3MIS15)">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.xbmcswift2" version="2.4.0" />
diff --git a/plugin.video.gametrailerscom/changelog.txt
b/plugin.video.gametrailerscom/changelog.txt
index 634a9eb..5acc06d 100644
--- a/plugin.video.gametrailerscom/changelog.txt
+++ b/plugin.video.gametrailerscom/changelog.txt
@@ -5,3 +5,7 @@
- Check video uri before trying to play it.
- If prefered quality does not exist, fallback to highest quality.
- Added forum link to addon.xml
+
+[B]Version 1.0.2[/B]
+- Added XBOX ONE page
+- Added search
diff --git
a/plugin.video.gametrailerscom/resources/language/English/strings.xml
b/plugin.video.gametrailerscom/resources/language/English/strings.xml
index d31df8b..21f384a 100644
--- a/plugin.video.gametrailerscom/resources/language/English/strings.xml
+++ b/plugin.video.gametrailerscom/resources/language/English/strings.xml
@@ -28,4 +28,7 @@
<string id="40014">PC</string>
<string id="40015">VITA</string>
<string id="40016">3DS</string>
+ <string id="40017">XBOX ONE</string>
+ <string id="40018">Search</string>
+ <string id="40019">Search Query</string>
</strings>
-----------------------------------------------------------------------
Summary of changes:
plugin.video.gametrailerscom/addon.py | 31 ++++++++++++++++++-
plugin.video.gametrailerscom/addon.xml | 2 +-
plugin.video.gametrailerscom/changelog.txt | 4 ++
.../resources/language/English/strings.xml | 3 ++
4 files changed, 37 insertions(+), 3 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons