The branch, eden has been updated
via 8625f3601c2dad5f4b72803d836e44593240508f (commit)
from 3da68abbab1b97402679b3ed68a437345567dede (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=8625f3601c2dad5f4b72803d836e44593240508f
commit 8625f3601c2dad5f4b72803d836e44593240508f
Author: spiff <[email protected]>
Date: Wed May 30 21:06:14 2012 +0200
[plugin.video.cinemassacre] updated to version 0.0.5
diff --git a/plugin.video.cinemassacre/addon.xml
b/plugin.video.cinemassacre/addon.xml
index 988dece..dbad898 100644
--- a/plugin.video.cinemassacre/addon.xml
+++ b/plugin.video.cinemassacre/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.cinemassacre" name="cinemassacre" version="0.0.4"
provider-name="dethfeet">
+<addon id="plugin.video.cinemassacre" name="cinemassacre" version="0.0.5"
provider-name="dethfeet">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="xbmc.gui" version="2.11"/>
@@ -10,8 +10,9 @@
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
- <summary lang="en">cinemassacre.com</summary>
- <description lang="en">Home of the Angry Video Game Nerd, Monster
Madness, movie reviews, top 10's, and commentary, retro and classic video
gaming and more.</description>
+ <language>en</language>
+ <summary>cinemassacre.com</summary>
+ <description>Home of the Angry Video Game Nerd, Monster Madness, movie
reviews, top 10's, and commentary, retro and classic video gaming and
more.</description>
<platform>all</platform>
</extension>
</addon>
diff --git a/plugin.video.cinemassacre/changelog.txt
b/plugin.video.cinemassacre/changelog.txt
index 005e454..7354dd0 100644
--- a/plugin.video.cinemassacre/changelog.txt
+++ b/plugin.video.cinemassacre/changelog.txt
@@ -1,3 +1,5 @@
+0.0.5 - Remove unneeded categories
+ moved showEpisode to a seperate file
0.0.4 - Using youtube and blip.tv plugins for playback
Updated icon.png
Preparing for adding to official Repo
diff --git a/plugin.video.cinemassacre/default.py
b/plugin.video.cinemassacre/default.py
index d3e5c05..f22e103 100644
--- a/plugin.video.cinemassacre/default.py
+++ b/plugin.video.cinemassacre/default.py
@@ -4,17 +4,25 @@ import xbmcaddon
import sys
import urllib, urllib2
import re
+import showEpisode
addon = xbmcaddon.Addon(id='plugin.video.cinemassacre')
thisPlugin = int(sys.argv[1])
+
baseLink = "http://cinemassacre.com/"
+hideMenuItem = []
+hideMenuItem.append("412") # Gallery
+hideMenuItem.append("486") # Fan Stuff
+hideMenuItem.append("402") # Full list of AVGN Videos
+hideMenuItem.append("225") # Game Collection
+
_regex_extractMenu = re.compile("<ul id=\"navlist\">(.*?)<ul
id=\"navpages\">", re.DOTALL);
-_regex_extractMenuItem = re.compile("<li class=\"cat-item
cat-item-[0-9]{1,4}\"><a
href=\"(http://cinemassacre.com/category/[a-z0-9\-]*/)\"
title=\"(.*?)\">(.*?)</a>", re.DOTALL);
-_regex_extractMenuItemSub = re.compile("<li class=\"cat-item
cat-item-[0-9]{1,4}\"><a
href=\"(http://cinemassacre.com/category/[a-z0-9\-]*/[a-z0-9\-]*/)\"
title=\"(.*?)\">(.*?)</a>", re.DOTALL);
-_regex_extractMenuItemSubSub = re.compile("<li class=\"cat-item
cat-item-[0-9]{1,4}\"><a
href=\"(http://cinemassacre.com/category/[a-z0-9\-]*/[a-z0-9\-]*/[a-z0-9\-]*/)\"
title=\"(.*?)\">(.*?)</a>", re.DOTALL);
+_regex_extractMenuItem = re.compile("<li class=\"cat-item
cat-item-([0-9]{1,4})\"><a
href=\"(http://cinemassacre.com/category/[a-z0-9\-]*/)\"
title=\"(.*?)\">(.*?)</a>", re.DOTALL);
+_regex_extractMenuItemSub = re.compile("<li class=\"cat-item
cat-item-([0-9]{1,4})\"><a
href=\"(http://cinemassacre.com/category/[a-z0-9\-]*/[a-z0-9\-]*/)\"
title=\"(.*?)\">(.*?)</a>", re.DOTALL);
+_regex_extractMenuItemSubSub = re.compile("<li class=\"cat-item
cat-item-([0-9]{1,4})\"><a
href=\"(http://cinemassacre.com/category/[a-z0-9\-]*/[a-z0-9\-]*/[a-z0-9\-]*/)\"
title=\"(.*?)\">(.*?)</a>", re.DOTALL);
_regex_extractShow = re.compile("<!-- content -->(.*?)<!-- /content -->",
re.DOTALL)
_regex_extractRecent = re.compile("<!-- videos -->(.*?)<!-- /videos -->",
re.DOTALL);
@@ -24,29 +32,6 @@ _regex_extractEpisodeLink = re.compile("<h3><a
href=\"(.*?)\">(.*?)</a></h3>", r
_regex_extractEpisodeImg = re.compile("<img src=\"(.*?)\" alt=\"(.*?)\" />",
re.DOTALL)
_regex_extractEpisodeImg2 = re.compile("<img width=\"[0-9]*\"
height=\"[0-9]*\" src=\"(.*?)\" class=\".*?\" alt=\"(.*?)\" title=\".*?\" />",
re.DOTALL)
-#Bip.tv
-_regex_extractVideoBip = re.compile("(<!-- video -->|<!-- content
-->).*?(http://blip.tv/play/.*?)\".*?(<!-- /video -->|<!-- comments -->)",
re.DOTALL);
-_regex_extractVideoFeedURL = re.compile("file=(.*?)&", re.DOTALL);
-_regex_extractVideoFeedURL2 = re.compile("file=(.*)", re.DOTALL);
-
-#Youtube
-_regex_extractVideoYoutube = re.compile("<!-- (content|features) -->.*?<!--
video -->.*?(http://www\.youtube\.com/.*?/.*?)[\?|\"].*?<!-- /video -->.*?<!--
/(content|features) -->", re.DOTALL);
-_regex_extractVideoYoutubeId =
re.compile("http://www.youtube.com/(embed|v)/(.*)")
-
-#Gametrailers
-_regex_extractVideoGametrailers = re.compile("<a
href=\"(http://www.gametrailers.com/video/angry-video-screwattack/(.*))\"
target=\"_blank\">")
-_regex_extractVideoGametrailersXML = re.compile("<media:content
type=\"text/xml\" medium=\"video\" isDefault=\"true\" duration=\"[0-9]{1,4}\"
url=\"(.*?)\"/>")
-_regex_extractVideoGametrailersStreamURL = re.compile("<src>(.*?)</src>")
-
-#Springboard
-_regex_extractVideoSpringboard = re.compile("<!-- (video|content)
-->.*?http://(cinemassacre\.springboardplatform\.com|www\.springboardplatform\.com)/mediaplayer/springboard/video/(.*?)/(.*?)/(.*?)/.*?<!--
/(video|content) -->", re.DOTALL);
-_regex_extractVideoSpringboardStream = re.compile("<media:content
duration=\"[0-9]*?\" medium=\"video\" bitrate=\"[0-9]*?\" fileSize=\"[0-9]*?\"
url=\"(.*?)\" type=\".*?\" />");
-
-#Spike.com
-_regex_extractVideoSpike = re.compile("<!-- video -->.*?<a
href=\"(http://www.spike.com/.*?)\".*?<!-- /video -->", re.DOTALL);
-_regex_extraxtVideoSpikeId = re.compile("<meta property=\"og:video\"
content=\"(http://media.mtvnservices.com/mgid:arc:video:spike.com:(.*?))\" />");
-_regex_extractVideoSpikeSreamURL = re.compile("<rendition
bitrate=\"(.*?)\".*?<src>(.*?)</src>.*?</rendition>",re.DOTALL)
-
def mainPage():
global thisPlugin
@@ -90,21 +75,32 @@ def extractMenu(page):
menuList = []
parent = -1;
+ parentHidden = True
+ parent2Hidden = True
for line in menu.split("\n"):
menuItem = _regex_extractMenuItem.search(line)
if menuItem is not None:
- parent = parent + 1
- parent2 = -1
- menuList.append({"name" : menuItem.group(3), "link" :
menuItem.group(1), "children" : []})
- else:
+ if not menuItem.group(1) in hideMenuItem:
+ parentHidden = False
+ parent = parent + 1
+ parent2 = -1
+ menuList.append({"name" : menuItem.group(4), "link" :
menuItem.group(2), "children" : []})
+ else:
+ parentHidden = True
+ elif not parentHidden:
menuItemSub = _regex_extractMenuItemSub.search(line)
if menuItemSub is not None:
- parent2 = parent2 + 1
- menuList[parent]['children'].append({"name" :
menuItemSub.group(3), "link" : menuItemSub.group(1), "children" : []});
- else:
+ if not menuItemSub.group(1) in hideMenuItem:
+ parent2Hidden = False
+ parent2 = parent2 + 1
+ menuList[parent]['children'].append({"name" :
menuItemSub.group(4), "link" : menuItemSub.group(2), "children" : []});
+ else:
+ parent2Hidden = True
+ elif not parent2Hidden:
menuItemSubSub = _regex_extractMenuItemSubSub.search(line)
if menuItemSubSub is not None:
-
menuList[parent]['children'][parent2]['children'].append({"name" :
menuItemSubSub.group(3), "link" : menuItemSubSub.group(1), "children" : []});
+ if not menuItemSubSub.group(1) in hideMenuItem:
+
menuList[parent]['children'][parent2]['children'].append({"name" :
menuItemSubSub.group(4), "link" : menuItemSubSub.group(2), "children" : []});
return menuList
def showPage(link):
@@ -127,109 +123,11 @@ def extractEpisodes(show):
addDirectoryItem(episod_title, {"action" : "episode", "link":
episode_link}, episode_img, False)
xbmcplugin.endOfDirectory(thisPlugin)
-def showEpisodeBip(videoItem):
- url = videoItem.group(2)
-
- #GET the 301 redirect URL
- req = urllib2.Request(url)
- response = urllib2.urlopen(req)
- fullURL = response.geturl()
-
- feedURL = _regex_extractVideoFeedURL.search(fullURL)
- if feedURL is None:
- feedURL = _regex_extractVideoFeedURL2.search(fullURL)
- feedURL = urllib.unquote(feedURL.group(1))
-
- blipId = feedURL[feedURL.rfind("/")+1:]
-
- stream_url = "plugin://plugin.video.bliptv/?action=play_video&videoid=" +
blipId
- item = xbmcgui.ListItem(path=stream_url)
- return xbmcplugin.setResolvedUrl(thisPlugin, True, item)
-
-def showEpisodeYoutube(videoItem):
- global thisPlugin
- url = videoItem.group(2)
-
- youtubeID = _regex_extractVideoYoutubeId.search(url).group(2)
-
- stream_url = "plugin://plugin.video.youtube/?action=play_video&videoid=" +
youtubeID
- item = xbmcgui.ListItem(path=stream_url)
- return xbmcplugin.setResolvedUrl(thisPlugin, True, item)
-
-def showEpisodeGametrailers(videoItem):
- url = videoItem.group(1)
- videoId = videoItem.group(2)
- urlXml =
"http://www.gametrailers.com/neo/?page=xml.mediaplayer.Mrss&mgid=mgid%3Amoses%3Avideo%3Agametrailers.com%3A"
+ videoId + "&keyvalues={keyvalues}"
- xml1 = load_page(urlXml)
- urlXml = _regex_extractVideoGametrailersXML.search(xml1).group(1)
- urlXml = urlXml.replace("&", "&")
- xml2 = load_page(urlXml)
- stream_url = _regex_extractVideoGametrailersStreamURL.search(xml2).group(1)
- item = xbmcgui.ListItem(stream_url)
- xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(stream_url, item)
-
-def showEpisodeSpringboard(videoItem):
- siteId = videoItem.group(4)
- contentId = videoItem.group(5)
- feedUrl =
"http://cms.springboard.gorillanation.com/xml_feeds_advanced/index/" + siteId +
"/rss3/" + contentId + "/"
- feed = load_page(feedUrl)
- feedItem = _regex_extractVideoSpringboardStream.search(feed);
- stream_url = feedItem.group(1)
- item = xbmcgui.ListItem(stream_url)
- xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(stream_url, item)
-
-def showEpisodeSpike(videoItem):
- videoUrl = videoItem.group(1)
- videoPage = load_page(videoUrl)
- swfUrl = _regex_extraxtVideoSpikeId.search(videoPage).group(1)
- #GET the 301 redirect URL
- req = urllib2.Request(swfUrl)
- response = urllib2.urlopen(req)
- swfUrl = response.geturl()
-
- videoId = _regex_extraxtVideoSpikeId.search(videoPage).group(2)
- feedUrl =
"http://udat.mtvnservices.com/service1/dispatch.htm?feed=mediagen_arc_feed&account=spike.com&mgid=mgid%3Aarc%3Acontent%3Aspike.com%3A"+videoId+"&site=spike.com&segment=0&mgidOfMrssFeed=mgid%3Aarc%3Acontent%3Aspike.com%3A"+videoId
- videoFeed = load_page(feedUrl)
- videoStreamUrls = _regex_extractVideoSpikeSreamURL.finditer(videoFeed)
-
- curStream = None
- curBitrate = 0
- for stream in videoStreamUrls:
- streamUrl = stream.group(2)
- streamBitrate = int(stream.group(1))
- if streamBitrate>curBitrate:
- curStream = streamUrl.replace(" ","%20")
- curBitrate = streamBitrate
-
- url = curStream + " swfUrl="+swfUrl+" swfVfy=1"
- if curStream is not None:
- item = xbmcgui.ListItem(url)
- xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(url, item)
-def showEpisode(link):
+def playEpisode(link):
link = urllib.unquote(link)
page = load_page(link)
-
- videoItem = _regex_extractVideoBip.search(page)
-
- if videoItem is not None:
- showEpisodeBip(videoItem)
- else:
- videoItem = _regex_extractVideoYoutube.search(page)
- if videoItem is not None: #Youtube
- showEpisodeYoutube(videoItem)
- else:
- videoItem = _regex_extractVideoGametrailers.search(page)
- if videoItem is not None: #Gametrailers.com
- showEpisodeGametrailers(videoItem)
- else:
- videoItem = _regex_extractVideoSpringboard.search(page)
- if videoItem is not None: #Springboard
- showEpisodeSpringboard(videoItem)
- else:
- videoItem = _regex_extractVideoSpike.search(page)
- if videoItem is not None: #Spike.com
- showEpisodeSpike(videoItem)
+ showEpisode.showEpisode(page)
def load_page(url):
print url
@@ -286,6 +184,6 @@ else:
recentPage()
elif params['action'] == "episode":
print "Episode"
- showEpisode(params['link'])
+ playEpisode(params['link'])
else:
mainPage()
-----------------------------------------------------------------------
Summary of changes:
plugin.video.cinemassacre/addon.xml | 7 +-
plugin.video.cinemassacre/changelog.txt | 2 +
plugin.video.cinemassacre/default.py | 168 ++++++------------------------
plugin.video.cinemassacre/showEpisode.py | 159 ++++++++++++++++++++++++++++
4 files changed, 198 insertions(+), 138 deletions(-)
create mode 100644 plugin.video.cinemassacre/showEpisode.py
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons