The branch, dharma has been updated
via cf901007a4e7d09a871916a4e37f1313a573c817 (commit)
via ec9d50e182b9d9f6853e9c9ec62bc3ba18aeedff (commit)
from 479cf5d8048c40e52a0dd8e4694c6b90de1a6e4b (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=cf901007a4e7d09a871916a4e37f1313a573c817
commit cf901007a4e7d09a871916a4e37f1313a573c817
Author: spiff <[email protected]>
Date: Thu Feb 9 17:02:49 2012 +0100
[plugin.video.diy] updated to version 0.0.3
diff --git a/plugin.video.diy/addon.xml b/plugin.video.diy/addon.xml
index e203da6..8aeb699 100644
--- a/plugin.video.diy/addon.xml
+++ b/plugin.video.diy/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.diy"
name="DIY Network"
- version="0.0.2"
+ version="0.0.3"
provider-name="divingmule">
<requires>
<import addon="xbmc.python" version="1.0"/>
@@ -13,7 +13,7 @@
</extension>
<extension point="xbmc.addon.metadata">
<summary>Videos from diynetwork.com.</summary>
- <description>Play full episodes from the Do It Yourself Network,
diynetwork.com.</description>
+ <description>Play full episodes from the Do It Yourself Network,
diynetwork.com. These videos seem to be restricted to the U.S.
only.</description>
<disclaimer>Some parts of this addon may not be legal in your country of
residence - please check with your local laws before installing.</disclaimer>
<platform>all</platform>
</extension>
diff --git a/plugin.video.diy/changelog.txt b/plugin.video.diy/changelog.txt
index 6902565..bd2b76a 100644
--- a/plugin.video.diy/changelog.txt
+++ b/plugin.video.diy/changelog.txt
@@ -1,3 +1,6 @@
+Version 0.0.3
+we now scrape the main show list from
http://www.diynetwork.com/full-episodes/package/index.html and then hard-code
other shows in the 'More' directory.
+
Version 0.0.2
icon update
diff --git a/plugin.video.diy/default.py b/plugin.video.diy/default.py
index c137b62..7de0d11 100644
--- a/plugin.video.diy/default.py
+++ b/plugin.video.diy/default.py
@@ -1,5 +1,9 @@
-import urllib,urllib2,re,os
-import xbmcplugin,xbmcgui,xbmcaddon
+import urllib,urllib2
+import re
+import os
+import xbmcplugin
+import xbmcgui
+import xbmcaddon
from BeautifulSoup import BeautifulSoup
__settings__ = xbmcaddon.Addon(id='plugin.video.diy')
@@ -7,171 +11,155 @@ __language__ = __settings__.getLocalizedString
home = __settings__.getAddonInfo('path')
icon = xbmc.translatePath( os.path.join( home, 'icon.png' ) )
+def getRequest(url):
+ headers = {'User-agent' : ' Mozilla/5.0 (Windows NT 6.1; WOW64;
rv:10.0) Gecko/20100101 Firefox/10.0',
+ 'Referer' : 'http://www.diynetwork.com'}
+ req = urllib2.Request(url,None,headers)
+ response = urllib2.urlopen(req)
+ link=response.read()
+ response.close()
+ return link
+
def getShows():
- addDir(__language__(30000),
'/diy-10-grand-in-your-hand/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/05/28/tenGrand_lg_100.jpg')
- addDir(__language__(30001),
'/diy-10-killer-kitchen-projects/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/08/22/spShow_10-Killer-Kitchen-Projects_s994x100.jpg')
- addDir(__language__(30002),
'/diy-10-killer-weekend-projects/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/09/08/spShow_10-Killer-Weekend-Projects_s994x100.jpg')
- addDir(__language__(30003),
'/diy-10-things-you-must-know2/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/06/04/spShow_10-things-you-must-know_s994x200.jpg')
- addDir(__language__(30004),
'/diy-americas-most-desperate-landscape2/videos/index.html',1,'http://img.diynetwork.com/DIY/2011/02/16/spShow_AMDL_s994x200.jpg')
- addDir(__language__(30005),
'/diy-b-original-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/B-Original-sm-100.jpg')
- addDir(__language__(30006),
'/diy-bathtastic-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2011/01/06/spShow_BATHtastic_s994x200.jpg')
- addDir(__language__(30007),
'/diy-backyard-blitz/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/02/23/spShow_Backyard-Blitz_s994x100.jpg')
- addDir(__language__(30008),
'/diy-backyard-stadiums/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/09/16/spShow_Backyard-Stadiums_s994x100.jpg')
- addDir(__language__(30009),
'/diy-barkitecture/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/Barkitecture-sm-100.jpg')
- addDir(__language__(30010),
'/diy-bath-crashers/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/06/04/spShow_Bath-Crashers_s994x200.jpg')
- addDir(__language__(30011),
'/diy-bathroom-renovations-episodes/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/BathroomRenovations-lg-110.jpg')
- addDir(__language__(30012),
'/diy-carol-duvall-show-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/05/01/CarolDuvallShow-sm-100.jpg')
- addDir(__language__(30013),
'/diy-carter-can-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/CarterCan-sm-100.jpg')
- addDir(__language__(30014),
'/diy-cool-tools-episodes/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/11/02/spShow_Cool-Tools_s994x200.jpg')
- addDir(__language__(30015),
'/diy-cool-tools-inventors-challenge/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/10/23/spShow_cool-tools-inventors_s994x200.jpg')
- addDir(__language__(30016),
'/diy-cool-tools-hardware-show/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/10/23/spShow_cool-tools-hardware-show_s994x200.jpg')
- addDir(__language__(30017),
'/diy-creative-juice-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/05/28/CreativeJuice-sm-100.jpg')
- addDir(__language__(30018),
'/diy-diy-dominator/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/05/18/spShow_DIY-Dominator_s994x200.jpg')
- addDir(__language__(30019),
'/diy-diy-to-the-rescue-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/DIYToTheRescue-lg-100.jpg')
- addDir(__language__(30020),
'/diy-deconstruction-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/Deconstruction-lg-100.jpg')
- addDir(__language__(30021),
'/diy-desperate-landscapes-episodes/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/DesperateLandscapes-lg-111.jpg')
- addDir(__language__(30022),
'/diy-desperate-landscapes-top-10/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/02/08/spShow_Desperate-Landscapes-Top-10_s994x200.jpg')
- addDir(__language__(30023),
'/diy-disaster-house/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/09/02/spShow_Disaster-House_s994x200.jpg')
- addDir(__language__(30024),
'/diy-dream-house/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/29/DreamHouse-sm-100.jpg')
- addDir(__language__(30025),
'/diy-dream-house-log-cabin/videos/index.html',1,'http://img.diynetwork.com/DIY/2011/01/05/spShow_dream-house-log-cabin_s994x100.jpg')
- addDir(__language__(30026),
'/diy-family-renovation/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/05/26/spShow_Family-Renovation_s994x100.jpg')
- addDir(__language__(30027),
'/diy-freeform-furniture/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/09/16/spShow_Freeform-Furniture_s994x100.jpg')
- addDir(__language__(30028),
'/diy-fresh-from-the-orchard/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/10/21/sp100_fresh-from-the-orchard_s994x100.jpg')
- addDir(__language__(30029),
'/diy-fresh-from-the-garden/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/05/05/FreshFromTheGarden-sm-110.jpg')
- addDir(__language__(30030),
'/diy-garage-mahal-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/03/03/spShow_Garage-Mahal-Bill_s994x200.jpg')
- addDir(__language__(30031),
'/diy-hammered/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/12/11/spShow_Hammered_s994x100.jpg')
- addDir(__language__(30032),
'/diy-haulin-house/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/haulinHouse-sm-100.jpg')
- addDir(__language__(30033),
'/diy-house-crashers/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/06/14/spShow_House-Crashers_s994x200.jpg')
- addDir(__language__(30034),
'/diy-i-hate-my-kitchen/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/08/22/spShow_I-Hate-My-Kitchen_s994x200.jpg')
- addDir(__language__(30035),
'/diy-indoors-out-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2011/02/02/spShow_Indoors-Out_s994x200.jpg')
- addDir(__language__(30036),
'/diy2/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/KitchenImpossible-lg-100.jpg')
- addDir(__language__(30037),
'/diy12/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/20/KitchenRenovations-lg_100.jpg')
- addDir(__language__(30038),
'/diy-make-a-move-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/MakeAMove-sm-101.jpg')
- addDir(__language__(30039),
'/diy-man-caves-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/16/ManCaves_lg-105.jpg')
- addDir(__language__(30040),
'/diy-mega-dens/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/11/09/spShow_Mega-Dens_s994x200.jpg')
- addDir(__language__(30041),
'/diy-money-hunters/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/04/13/spShow_Money-Hunters_s994x200.jpg')
- addDir(__language__(30042),
'/diy-project-xtreme-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/ProjectXtreme-lg-100.jpg')
- addDir(__language__(30043),
'/diy-rehab-addict/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/10/29/spShow_Rehab-Addict_s994x200.jpg')
- addDir(__language__(30044),
'/diy-renovation-realities-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/RenovationRealities-lg-100.jpg')
- addDir(__language__(30045),
'/diy-rescue-renovation2/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/05/10/spShow_Rescue-Renovation_s994x200.jpg')
- addDir(__language__(30046),
'/diy-rock-solid-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/20/RockSolid_lg-100.jpg')
- addDir(__language__(30047),
'/diy-run-my-renovation2/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/07/23/spFeature_Run-My-Renovation_s994x200.jpg')
- addDir(__language__(30048),
'/diy-studfinder/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/10/20/sp100_studfinder_s994x100.jpg')
- addDir(__language__(30049),
'/diy-sweat-equity-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/09/19/spShow_Sweat-Equity_s994x200.jpg')
- addDir(__language__(30050),
'/diy14/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/KingOfDirt-lg-110.jpg')
- addDir(__language__(30051),
'/diy-the-vanilla-ice-project/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/09/20/spShow_The-Vanilla-Ice-Project_SPack_s994x200.jpg')
- addDir(__language__(30052),
'/diy-this-new-house/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/05/10/spShow_This-New-House_s994x200.jpg')
- addDir(__language__(30053),
'/diy-turf-war/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/02/08/spShow_Turf-War_s994x200.jpg')
- addDir(__language__(30054),
'/diy-under-construction-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/UnderConstruction-sm-102.jpg')
- addDir(__language__(30055),
'/diy-wasted-spaces/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/WastedSpaces-sm-100.jpg')
- addDir(__language__(30056),
'/diy-yard-crashers-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/17/YardCrashers_lg-101.jpg')
- addDir(__language__(30057),
'/diy-yard-crashers-top-10/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/02/08/spShow_Yard-Crashers-Top-10_s994x200.jpg')
-
-
-def index(url):
- url='http://www.diynetwork.com'+url
- req = urllib2.Request(url)
- req.addheaders = [('Referer', 'http://www.diynetwork.com'),
- ('Mozilla/5.0 (Windows; U; Windows NT 6.1;
en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)')]
- response = urllib2.urlopen(req)
- link=response.read()
- response.close()
- soup = BeautifulSoup(link)
- if soup.find('div', attrs={'id' : "more-videos-from-show"}):
- shows = soup.find('div', attrs={'id' :
"more-videos-from-show"})('h4')
- for show in shows:
- name = show.string
- url =
show.next.next.next('a')[0]['href']
- addDir(name,url,1,'')
- showID=re.compile("var snap = new
SNI.DIY.Player.FullSize\(\\'.+?\\',\\'(.+?)\\', \\'\\'\);").findall(link)
- if len(showID)<1:
- showID=re.compile("var snap = new
SNI.DIY.Player.FullSize\(\'.+?','(.+?)', '.+?'\);").findall(link)
- print'--------> '+showID[0]
-
url='http://www.hgtv.com/hgtv/channel/xml/0,,'+showID[0]+',00.xml'
- req = urllib2.Request(url)
- req.addheaders = [('Referer', 'http://www.diynetwork.com'),
- ('Mozilla/5.0 (Windows; U; Windows NT 6.1;
en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)')]
- response = urllib2.urlopen(req)
- link=response.read()
- response.close()
- soup = BeautifulSoup(link)
- videos = soup('video')
- for video in videos:
- name = video('clipname')[0].string
- length = video('length')[0].string
- thumb = video('thumbnailurl')[0].string
- description = video('abstract')[0].string
- link = video('videourl')[0].string
- playpath =
link.replace('http://wms.scrippsnetworks.com','').replace('.wmv','')
- url =
'rtmp://flash.scrippsnetworks.com:1935/ondemand?ovpfv=1.1
swfUrl="http://common.scrippsnetworks.com/common/snap/snap-3.0.3.swf"
playpath='+playpath
- addLink(name,url,description,length,thumb)
+ url = 'http://www.diynetwork.com/full-episodes/package/index.html'
+ soup = BeautifulSoup(getRequest(url),
convertEntities=BeautifulSoup.HTML_ENTITIES)
+ shows = soup('div', attrs={'id' : "full-episodes"})[0]('li')[8:]
+ Shows_list=[]
+ for i in shows:
+ name = i('img')[0]['alt']
+ if name.startswith(' '):
+ name = name[1:]
+ url = i('a')[1]['href']
+ thumbnail = i('img')[0]['src'].replace(' ','')
+ show = (name, url, thumbnail)
+ if not show in Shows_list:
+ Shows_list.append(show)
+ for i in Shows_list:
+ addDir(i[0], i[1], 1, i[2])
+ addDir(__language__(30019),'getMoreShows',2,icon)
+
+
+def getMoreShows():
+
addDir(__language__(30000),'/diy-10-killer-kitchen-projects/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/08/22/spShow_10-Killer-Kitchen-Projects_s994x100.jpg')
#10 Killer Kitchen Projects
+
addDir(__language__(30001),'/diy-americas-most-desperate-landscape2/videos/index.html',1,'http://img.diynetwork.com/DIY/2011/02/16/spShow_AMDL_s994x200.jpg')
#America's Most Desperate Landscape
+
addDir(__language__(30002),'/diy-b-original-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/B-Original-sm-100.jpg')
#B. Original
+
addDir(__language__(30003),'/diy-backyard-blitz/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/02/23/spShow_Backyard-Blitz_s994x100.jpg')
#Backyard Blitz
+
addDir(__language__(30004),'/diy-backyard-stadiums/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/09/16/spShow_Backyard-Stadiums_s994x100.jpg')
#Backyard Stadiums
+
addDir(__language__(30005),'/diy-barkitecture/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/Barkitecture-sm-100.jpg')
#Barkitecture
+
addDir(__language__(30006),'/diy-cool-tools-inventors-challenge/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/10/23/spShow_cool-tools-inventors_s994x200.jpg')
#Cool Tools: Inventor's Special
+
addDir(__language__(30007),'/diy-diy-to-the-rescue-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/DIYToTheRescue-lg-100.jpg')
#DIY to the Rescue
+
addDir(__language__(30008),'/diy-desperate-landscapes-top-10/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/02/08/spShow_Desperate-Landscapes-Top-10_s994x200.jpg')
#Desperate Landscapes Top 10
+
addDir(__language__(30009),'/diy-dream-house-log-cabin/videos/index.html',1,'http://img.diynetwork.com/DIY/2011/01/05/spShow_dream-house-log-cabin_s994x100.jpg')
#Dream House Log Cabin
+
addDir(__language__(30010),'/diy-esquires-ultimate-bachelor-pad/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/12/08/spShow_Esquires-Bachelor-Pad_s994x100.jpg')
#Esquire's Ultimate Bachelor Pad
+
addDir(__language__(30011),'/diy-fresh-from-the-garden/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/05/05/FreshFromTheGarden-sm-110.jpg')
#Fresh from the Garden
+
addDir(__language__(30012),'/diy-hammered/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/12/11/spShow_Hammered_s994x100.jpg')
#Hammered With John & Jimmy DiResta
+
addDir(__language__(30013),'/diy-haulin-house/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/27/haulinHouse-sm-100.jpg')
#Haulin' House
+
addDir(__language__(30014),'/diy-make-a-move-episode/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/MakeAMove-sm-101.jpg')
#Make A Move
+
addDir(__language__(30015),'/diy-studfinder/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/10/20/sp100_studfinder_s994x100.jpg')
#Stud Finder
+
addDir(__language__(30016),'/diy14/videos/index.html',1,'http://img.diynetwork.com/DIY/2009/04/24/KingOfDirt-lg-110.jpg')
#The King of Dirt
+
addDir(__language__(30017),'/diy-worst-kitchen-in-america/videos/index.html',1,'http://img.diynetwork.com/DIY/2011/01/07/spShow_Worst-Kitchen-In-America-cross-promo-vsn_s994x100.jpg')
#Worst Kitchen in America
+
addDir(__language__(30018),'/diy-yard-crashers-top-10/videos/index.html',1,'http://img.diynetwork.com/DIY/2010/02/08/spShow_Yard-Crashers-Top-10_s994x200.jpg')
#Yard Crashers Top 10
+
+
+def index(url, iconimage):
+ url='http://www.diynetwork.com'+url
+ soup = BeautifulSoup(getRequest(url))
+ if soup.find('div', attrs={'id' : "more-videos-from-show"}):
+ shows = soup.find('div', attrs={'id' :
"more-videos-from-show"})('h4')
+ for show in shows:
+ name = show.string
+ url = show.next.next.next('a')[0]['href']
+ addDir(name,url,1,iconimage)
+ showID=re.compile("var snap = new
SNI.DIY.Player.FullSize\(\\'.+?\\',\\'(.+?)\\', \\'\\'\);").findall(str(soup))
+ if len(showID)<1:
+ showID=re.compile("var snap = new
SNI.DIY.Player.FullSize\(\'.+?','(.+?)', '.+?'\);").findall(str(soup))
+ url='http://www.hgtv.com/hgtv/channel/xml/0,,'+showID[0]+',00.xml'
+ soup = BeautifulSoup(getRequest(url))
+ for video in soup('video'):
+ name = video('clipname')[0].string
+ length = video('length')[0].string
+ thumb = video('thumbnailurl')[0].string
+ description = video('abstract')[0].string
+ link = video('videourl')[0].string
+ playpath =
link.replace('http://wms.scrippsnetworks.com','').replace('.wmv','')
+ url = 'rtmp://flash.scrippsnetworks.com:1935/ondemand?ovpfv=1.1
swfUrl="http://common.scrippsnetworks.com/common/snap/snap-3.0.3.swf"
playpath='+playpath
+ addLink(name,url,description,length,thumb)
+ xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
def get_params():
- param=[]
- paramstring=sys.argv[2]
- if len(paramstring)>=2:
- params=sys.argv[2]
- cleanedparams=params.replace('?','')
- if (params[len(params)-1]=='/'):
- params=params[0:len(params)-2]
- pairsofparams=cleanedparams.split('&')
- param={}
- for i in range(len(pairsofparams)):
- splitparams={}
-
splitparams=pairsofparams[i].split('=')
- if (len(splitparams))==2:
-
param[splitparams[0]]=splitparams[1]
-
- return param
+ param=[]
+ paramstring=sys.argv[2]
+ if len(paramstring)>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+
+ return param
def addLink(name,url,description,length,iconimage):
- ok=True
- liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png",
thumbnailImage=iconimage)
- liz.setInfo( type="Video", infoLabels={ "Title": name ,
"Plot":description, "Duration":length } )
-
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
- return ok
+ ok=True
+ liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png",
thumbnailImage=iconimage)
+ liz.setInfo( type="Video", infoLabels={ "Title": name ,
"Plot":description, "Duration":length } )
+
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
+ return ok
def addDir(name,url,mode,iconimage):
-
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- ok=True
- liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=iconimage)
- liz.setInfo( type="Video", infoLabels={ "Title": name } )
-
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
- return ok
-
-
+
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&iconimage="+urllib.quote_plus(iconimage)
+ ok=True
+ liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=iconimage)
+ liz.setInfo( type="Video", infoLabels={ "Title": name } )
+
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+ return ok
+
+
params=get_params()
url=None
name=None
mode=None
try:
- url=urllib.unquote_plus(params["url"])
+ url=urllib.unquote_plus(params["url"])
+except:
+ pass
+try:
+ name=urllib.unquote_plus(params["name"])
except:
- pass
+ pass
try:
- name=urllib.unquote_plus(params["name"])
+ iconimage=urllib.unquote_plus(params["iconimage"])
except:
- pass
+ pass
try:
- mode=int(params["mode"])
+ mode=int(params["mode"])
except:
- pass
+ pass
print "Mode: "+str(mode)
print "URL: "+str(url)
print "Name: "+str(name)
if mode==None:
- print ""
- getShows()
-
+ print ""
+ getShows()
+
elif mode==1:
- print ""+url
- index(url)
+ print ""
+ index(url, iconimage)
+
+elif mode==2:
+ print ""
+ getMoreShows()
-xbmcplugin.endOfDirectory(int(sys.argv[1]))
+xbmcplugin.endOfDirectory(int(sys.argv[1]))
\ No newline at end of file
diff --git a/plugin.video.diy/resources/language/English/strings.xml
b/plugin.video.diy/resources/language/English/strings.xml
index 606a754..9144ebb 100644
--- a/plugin.video.diy/resources/language/English/strings.xml
+++ b/plugin.video.diy/resources/language/English/strings.xml
@@ -1,61 +1,27 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
- <string id="30000">10 Grand In Your Hand</string>
- <string id="30001">10 Killer Kitchen Projects</string>
- <string id="30002">10 Killer Weekend Projects</string>
- <string id="30003">10 Things You Must Know</string>
- <string id="30004">America's Most Desperate Landscape</string>
- <string id="30005">B. Original</string>
- <string id="30006">BATHtastic!</string>
- <string id="30007">Backyard Blitz</string>
- <string id="30008">Backyard Stadiums</string>
- <string id="30009">Barkitecture</string>
- <string id="30010">Bath Crashers</string>
- <string id="30011">Bathroom Renovations</string>
- <string id="30012">Carol Duvall Show</string>
- <string id="30013">Carter Can</string>
- <string id="30014">Cool Tools</string>
- <string id="30015">Cool Tools: Inventor's Special</string>
- <string id="30016">Cool Tools: The Hardware Show</string>
- <string id='30017'>Creative Juice</string>
- <string id='30018'>DIY Dominator</string>
- <string id='30019'>DIY to the Rescue</string>
- <string id='30020'>Deconstruction</string>
- <string id='30021'>Desperate Landscapes</string>
- <string id='30022'>Desperate Landscapes Top 10</string>
- <string id='30023'>Disaster House</string>
- <string id='30024'>Dream House</string>
- <string id='30025'>Dream House Log Cabin</string>
- <string id='30026'>Family Renovation</string>
- <string id='30027'>Freeform Furniture</string>
- <string id='30028'>Fresh From the Orchard</string>
- <string id='30029'>Fresh from the Garden</string>
- <string id='30030'>Garage Mahal</string>
- <string id='30031'>Hammered With John & Jimmy DiResta</string>
- <string id='30032'>Haulin' House</string>
- <string id='30033'>House Crashers</string>
- <string id='30034'>I Hate My Kitchen</string>
- <string id='30035'>Indoors Out</string>
- <string id='30036'>Kitchen Impossible</string>
- <string id='30037'>Kitchen Renovations</string>
- <string id='30038'>Make A Move</string>
- <string id='30039'>Man Caves</string>
- <string id='30040'>Mega Dens</string>
- <string id='30041'>Money Hunters</string>
- <string id='30042'>Project Xtreme</string>
- <string id='30043'>Rehab Addict</string>
- <string id='30044'>Renovation Realities</string>
- <string id='30045'>Rescue Renovation</string>
- <string id='30046'>Rock Solid</string>
- <string id='30047'>Run My Renovation</string>
- <string id='30048'>Stud Finder</string>
- <string id='30049'>Sweat Equity</string>
- <string id='30050'>The King of Dirt</string>
- <string id='30051'>The Vanilla Ice Project</string>
- <string id='30052'>This New House</string>
- <string id='30053'>Turf War</string>
- <string id='30054'>Under Construction</string>
- <string id='30055'>Wasted Spaces</string>
- <string id='30056'>Yard Crashers</string>
- <string id='30057'>Yard Crashers Top 10</string>
+ <string id="30000">10 Killer Kitchen Projects</string>
+ <string id="30001">America's Most Desperate Landscape</string>
+ <string id="30002">B. Original</string>
+ <string id="30003">Backyard Blitz</string>
+ <string id="30004">Backyard Stadiums</string>
+ <string id="30005">Barkitecture</string>
+ <string id="30006">Cool Tools: Inventor's Special</string>
+ <string id="30007">DIY to the Rescue</string>
+ <string id="30008">Desperate Landscapes Top 10</string>
+ <string id="30009">Dream House Log Cabin</string>
+ <string id="30010">Esquire's Ultimate Bachelor Pad</string>
+ <string id="30011">Fresh from the Garden</string>
+ <string id="30012">Hammered With John & Jimmy DiResta</string>
+ <string id="30013">Haulin' House</string>
+ <string id="30014">Make A Move</string>
+ <string id="30015">Stud Finder</string>
+ <string id="30016">The King of Dirt</string>
+ <string id='30017'>Worst Kitchen in America</string>
+ <string id='30018'>Yard Crashers Top 10</string>
+ <string id='30019'>More...</string>
+ <string id='30020'></string>
+ <string id='30021'></string>
+ <string id='30022'></string>
+ <string id='30023'></string>
</strings>
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=ec9d50e182b9d9f6853e9c9ec62bc3ba18aeedff
commit ec9d50e182b9d9f6853e9c9ec62bc3ba18aeedff
Author: spiff <[email protected]>
Date: Thu Feb 9 17:01:32 2012 +0100
[plugin.video.hgtv] updated to version 0.0.8
diff --git a/plugin.video.hgtv/addon.xml b/plugin.video.hgtv/addon.xml
index b1c46a9..c565ff4 100644
--- a/plugin.video.hgtv/addon.xml
+++ b/plugin.video.hgtv/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.hgtv"
name="HGTV"
- version="0.0.7"
+ version="0.0.8"
provider-name="divingmule">
<requires>
<import addon="xbmc.python" version="1.0"/>
diff --git a/plugin.video.hgtv/changelog.txt b/plugin.video.hgtv/changelog.txt
index 687cba8..6d1ec53 100644
--- a/plugin.video.hgtv/changelog.txt
+++ b/plugin.video.hgtv/changelog.txt
@@ -1,3 +1,6 @@
+Version 0.0.8
+minor fixes, code improvements
+
Version 0.0.7
we now scrape http://www.hgtv.com/full-episodes/package/index.html for the
show list and hard-code other shows in the 'More' directory
diff --git a/plugin.video.hgtv/default.py b/plugin.video.hgtv/default.py
index 404b43d..6c3c06f 100644
--- a/plugin.video.hgtv/default.py
+++ b/plugin.video.hgtv/default.py
@@ -10,6 +10,7 @@ from BeautifulSoup import BeautifulSoup
__settings__ = xbmcaddon.Addon(id='plugin.video.hgtv')
__language__ = __settings__.getLocalizedString
home = __settings__.getAddonInfo('path')
+icon = xbmc.translatePath( os.path.join( home, 'icon.png' ) )
def getRequest(url):
@@ -20,7 +21,7 @@ def getRequest(url):
link=response.read()
response.close()
return link
-
+
def getShows():
url = 'http://www.hgtv.com/full-episodes/package/index.html'
@@ -71,7 +72,7 @@ def getMoreShows():
addDir(__language__(30026),'/hgtv-white-house-christmas/videos/index.html',1,'http://hgtv.sndimg.com/HGTV/2011/11/23/spShow_white-house-xmas-2011_s994x100.jpg')
# White House Christmas 2011
-def INDEX(url, iconimage):
+def index(url, iconimage):
if url.startswith('/'):
url='http://www.hgtv.com'+url
soup = BeautifulSoup(getRequest(url),
convertEntities=BeautifulSoup.HTML_ENTITIES)
@@ -96,11 +97,11 @@ def INDEX(url, iconimage):
if len(showID)<1:
try:
url = soup.find('ul', attrs={'class' :
"button-nav"})('a')[1]['href']
- INDEX(url, iconimage)
+ index(url, iconimage)
except:
try:
url = soup.find('li', attrs={'class' :
"tab-past-season"}).a['href']
- INDEX(url, iconimage)
+ index(url, iconimage)
except: print 'Houston we have a problem!'
else:
url='http://www.hgtv.com/hgtv/channel/xml/0,,'+showID[0]+',00.xml'
@@ -186,10 +187,10 @@ if mode==None or url==None or len(url)<1:
elif mode==1:
print ""
- INDEX(url, iconimage)
+ index(url, iconimage)
elif mode==2:
print ""
getMoreShows()
-
-xbmcplugin.endOfDirectory(int(sys.argv[1]))
+
+xbmcplugin.endOfDirectory(int(sys.argv[1]))
\ No newline at end of file
diff --git a/plugin.video.hgtv/resources/language/English/strings.xml
b/plugin.video.hgtv/resources/language/English/strings.xml
index c6161f6..e1dc28a 100644
--- a/plugin.video.hgtv/resources/language/English/strings.xml
+++ b/plugin.video.hgtv/resources/language/English/strings.xml
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<strings>
- <string id="30000">15 Fresh Handmade Gift Ideas</string>
- <string id="30001">Bang for Your Buck</string>
- <string id="30002">Battle On the Block</string>
- <string id="30003">Behind the Magic: Disney Holidays</string>
- <string id="30004">Candice Tells All</string>
- <string id="30005">Change the World: American Heroes</string>
- <string id="30006">Dina's Party</string>
- <string id="30007">First Time Design</string>
- <string id="30008">HGTV Summer Showdown</string>
- <string id="30009">HGTV's $250,000 Challenge</string>
- <string id="30010">HGTV's Great Rooms</string>
- <string id="30011">HGTV's Home for the Holidays</string>
- <string id="30012">HGTV: The Making of Our Magazine</string>
- <string id="30013">Holmes Inspection</string>
- <string id="30014">House of Bryan</string>
- <string id="30015">Keys to the Castle, France</string>
- <string id='30016'>My House Is Worth What?</string>
- <string id='30017'>Property Brothers</string>
- <string id='30018'>RV</string>
- <string id='30019'>Red Hot & Green</string>
- <string id='30020'>Room Crashers</string>
- <string id='30021'>Sandra Lee Celebrates: Holiday Homecoming</string>
- <string id='30022'>Sarah 101</string>
- <string id='30023'>Sarah's Holiday Party</string>
- <string id='30024'>The Duchess</string>
- <string id='30025'>The Outdoor Room With Jamie Durie</string>
- <string id='30026'>White House Christmas 2011</string>
- <string id='30027'>More...</string>
-</strings>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<strings>
+ <string id="30000">15 Fresh Handmade Gift Ideas</string>
+ <string id="30001">Bang for Your Buck</string>
+ <string id="30002">Battle On the Block</string>
+ <string id="30003">Behind the Magic: Disney Holidays</string>
+ <string id="30004">Candice Tells All</string>
+ <string id="30005">Change the World: American Heroes</string>
+ <string id="30006">Dina's Party</string>
+ <string id="30007">First Time Design</string>
+ <string id="30008">HGTV Summer Showdown</string>
+ <string id="30009">HGTV's $250,000 Challenge</string>
+ <string id="30010">HGTV's Great Rooms</string>
+ <string id="30011">HGTV's Home for the Holidays</string>
+ <string id="30012">HGTV: The Making of Our Magazine</string>
+ <string id="30013">Holmes Inspection</string>
+ <string id="30014">House of Bryan</string>
+ <string id="30015">Keys to the Castle, France</string>
+ <string id='30016'>My House Is Worth What?</string>
+ <string id='30017'>Property Brothers</string>
+ <string id='30018'>RV</string>
+ <string id='30019'>Red Hot & Green</string>
+ <string id='30020'>Room Crashers</string>
+ <string id='30021'>Sandra Lee Celebrates: Holiday Homecoming</string>
+ <string id='30022'>Sarah 101</string>
+ <string id='30023'>Sarah's Holiday Party</string>
+ <string id='30024'>The Duchess</string>
+ <string id='30025'>The Outdoor Room With Jamie Durie</string>
+ <string id='30026'>White House Christmas 2011</string>
+ <string id='30027'>More...</string>
+</strings>
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
plugin.video.diy/addon.xml | 4 +-
plugin.video.diy/changelog.txt | 3 +
plugin.video.diy/default.py | 268 ++++++++++----------
.../resources/language/English/strings.xml | 82 ++-----
plugin.video.hgtv/addon.xml | 2 +-
plugin.video.hgtv/changelog.txt | 3 +
plugin.video.hgtv/default.py | 15 +-
.../resources/language/English/strings.xml | 62 +++---
8 files changed, 200 insertions(+), 239 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons