The branch, eden has been updated
via 821e5b2304371b877c625c191ef49f4a3ade0b59 (commit)
via be3e0a17af2c9d77e2466fb18ab40e3ab09f6043 (commit)
from 0cd655bd53a50ee7fd0bf58cac861c162d149d2f (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=821e5b2304371b877c625c191ef49f4a3ade0b59
commit 821e5b2304371b877c625c191ef49f4a3ade0b59
Author: beenje <[email protected]>
Date: Sun Feb 3 22:10:00 2013 +0100
[plugin.video.m6groupe] updated to version 1.0.4
diff --git a/plugin.video.m6groupe/addon.xml b/plugin.video.m6groupe/addon.xml
index 59e0adf..4e8f0f6 100644
--- a/plugin.video.m6groupe/addon.xml
+++ b/plugin.video.m6groupe/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.m6groupe" name="M6 groupe" version="1.0.3"
provider-name="beenje">
+<addon id="plugin.video.m6groupe" name="M6 groupe" version="1.0.4"
provider-name="beenje">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.xbmcswift2" version="1.3"/>
diff --git a/plugin.video.m6groupe/changelog.txt
b/plugin.video.m6groupe/changelog.txt
index 919b31d..b06e884 100644
--- a/plugin.video.m6groupe/changelog.txt
+++ b/plugin.video.m6groupe/changelog.txt
@@ -1,3 +1,9 @@
+[B]Version 1.0.4[/B]
+
+- Fix 6ter catalog (unknown genre id)
+- Add debug traces
+- Add parameter to enable/disbale SWF verification
+
[B]Version 1.0.3[/B]
- Added genre thumbnail thanks to JUL1EN094
diff --git a/plugin.video.m6groupe/resources/language/English/strings.xml
b/plugin.video.m6groupe/resources/language/English/strings.xml
index 2b54480..c81ebe2 100644
--- a/plugin.video.m6groupe/resources/language/English/strings.xml
+++ b/plugin.video.m6groupe/resources/language/English/strings.xml
@@ -14,4 +14,5 @@
<string id="30022">clips</string>
<string id="30101">Advanced</string>
<string id="30102">Catalog refresh delay (minutes)</string>
+ <string id="30103">Enable SWF verification</string>
</strings>
diff --git a/plugin.video.m6groupe/resources/language/French/strings.xml
b/plugin.video.m6groupe/resources/language/French/strings.xml
index 1184402..670cf01 100644
--- a/plugin.video.m6groupe/resources/language/French/strings.xml
+++ b/plugin.video.m6groupe/resources/language/French/strings.xml
@@ -14,4 +14,5 @@
<string id="30022">clips</string>
<string id="30101">Avancé</string>
<string id="30102">Délai de rafraichissement du catalogue (minutes)</string>
+ <string id="30103">Activer la vérification SWF</string>
</strings>
diff --git a/plugin.video.m6groupe/resources/lib/catalog.py
b/plugin.video.m6groupe/resources/lib/catalog.py
index b05fbb7..dfa90d8 100644
--- a/plugin.video.m6groupe/resources/lib/catalog.py
+++ b/plugin.video.m6groupe/resources/lib/catalog.py
@@ -30,6 +30,10 @@ CATALOGUE_URL =
'http://static.m6replay.fr/catalog/m6group_web/%s/catalogue.json
CLIP_URL =
'http://static.m6replay.fr/catalog/m6group_web/%s/clip/%s/clip_infos-%s.json'
IMAGES_URL = 'http://static.m6replay.fr/images/'
TTL = int(plugin.get_setting('cached_ttl'))
+if plugin.get_setting('swf_verify') == 'true':
+ SWF_VERIFY = '
swfUrl=http://www.m6replay.fr/rel-3/M6ReplayV3Application-3.swf swfVfy=1'
+else:
+ SWF_VERIFY = ''
# Bump the CATALOG_API to force a refresh of the catalog
CATALOG_API = '1.0'
@@ -60,7 +64,11 @@ def url_thumb(item):
def get_id_parent(full_catalog, id_gnr):
"""Return the parent id of gnr"""
- id_parent = full_catalog[u'gnrList'][id_gnr][u'idParent']
+ try:
+ id_parent = full_catalog[u'gnrList'][id_gnr][u'idParent']
+ except KeyError:
+ # Unknown genre, just return the given id
+ return id_gnr
if id_parent is None:
# Genre has no parent
return id_gnr
@@ -96,6 +104,8 @@ def get_catalog(channel, api):
'label': gnr[u'name'],
'thumb': url_thumb(gnr),
} for id_gnr, gnr in full_catalog[u'gnrList'].items() if
gnr[u'idParent'] is None]
+ plugin.log.debug('genres:')
+ plugin.log.debug(genres)
# Get programs with visible clips
programs = [{'id': id_pgm,
'label': pgm[u'name'],
@@ -104,6 +114,8 @@ def get_catalog(channel, api):
'clips': pgm[u'clpList'][u'vi'],
'id_gnr': get_id_parent(full_catalog, str(pgm[u'idGnr'])),
} for id_pgm, pgm in full_catalog[u'pgmList'].items() if
pgm[u'clpList'][u'vi']]
+ plugin.log.debug('programs:')
+ plugin.log.debug(programs)
# Get visible clips
clips = [{'id': id_clp,
'label': ' - '.join([clp[u'programName'], clp[u'clpName']]),
@@ -113,6 +125,8 @@ def get_catalog(channel, api):
'thumb': url_thumb(clp),
'id_pgm': str(clp[u'idPgm'])
} for id_clp, clp in full_catalog[u'clpList'].items() if
clp[u'type'] == u'vi']
+ plugin.log.debug('clips:')
+ plugin.log.debug(clips)
return {'genres': genres,
'programs': programs,
'clips': clips}
@@ -154,13 +168,16 @@ def get_clip_url(channel, clip):
# Look for a mp4 url
for url in urls:
if url.startswith('mp4:'):
+ plugin.log.debug('mp4 url found')
return get_rtmp_url(url)
# No mp4 url found, try to convert it from the f4m url
for url in urls:
if url.endswith('.f4m'):
+ plugin.log.debug('using .f4m url')
link = 'mp4:production/regienum/' +
url.split('/')[-1].replace('.f4m', '.mp4')
return get_rtmp_url(link)
# No url found
+ plugin.log.debug('no url found')
return None
@@ -181,4 +198,4 @@ def get_rtmp_url(playpath):
#filename = os.path.basename(playpath)
token_url = encode_playpath(app, playpath, int(time.time()))
rtmp_url = '/'.join([rtmp, app, token_url])
- return rtmp_url + '
swfUrl=http://www.m6replay.fr/rel-3/M6ReplayV3Application-3.swf swfVfy=1
timeout=10'
+ return rtmp_url + SWF_VERIFY + ' timeout=10'
diff --git a/plugin.video.m6groupe/resources/settings.xml
b/plugin.video.m6groupe/resources/settings.xml
index b0519b9..c40a995 100644
--- a/plugin.video.m6groupe/resources/settings.xml
+++ b/plugin.video.m6groupe/resources/settings.xml
@@ -6,5 +6,6 @@
</category>
<category label="30101">
<setting label="30102" id="cached_ttl" type="text" default="180" />
+ <setting label="30103" id="swf_verify" type="bool" default="false" />
</category>
</settings>
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=be3e0a17af2c9d77e2466fb18ab40e3ab09f6043
commit be3e0a17af2c9d77e2466fb18ab40e3ab09f6043
Author: beenje <[email protected]>
Date: Sun Feb 3 21:58:31 2013 +0100
[plugin.video.nolife] updated to version 1.16.1
diff --git a/plugin.video.nolife/addon.xml b/plugin.video.nolife/addon.xml
index 03d0213..e0dd759 100644
--- a/plugin.video.nolife/addon.xml
+++ b/plugin.video.nolife/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.nolife"
name="Nolife Online"
- version="1.15.1"
+ version="1.16.1"
provider-name="gormux">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.video.nolife/default.py b/plugin.video.nolife/default.py
index b85d548..49b3a85 100644
--- a/plugin.video.nolife/default.py
+++ b/plugin.video.nolife/default.py
@@ -17,9 +17,10 @@ Nolife Online addon for XBMC
Authors: gormux, DeusP
"""
-import os, re, xbmcplugin, xbmcgui, xbmcaddon, urllib, urllib2, sys,
cookielib, pickle
+import os, re, xbmcplugin, xbmcgui, xbmcaddon, urllib, urllib2, sys,
cookielib, pickle, datetime
from BeautifulSoup import BeautifulSoup
+
"""
Class used as a C-struct to store video informations
"""
@@ -52,6 +53,12 @@ language = settings.getLocalizedString
subscription = FREE
fanartimage = os.path.join(settings.getAddonInfo("path"), "fanart.jpg")
+"""
+Data directory for cookie saving
+"""
+data_dir = xbmc.translatePath(settings.getAddonInfo('profile'))
+cookie_file = os.path.join(settings.getAddonInfo('path'), 'cookies')
+
def remove_html_tags(data):
"""Permits to remove all HTML tags
@@ -122,6 +129,7 @@ def login():
This method log the user into the website, checks credentials and return
the current
"""
+ xbmc.log(msg=pluginLogHeader + "Logging in",level=xbmc.LOGDEBUG)
settings = xbmcaddon.Addon(id='plugin.video.nolife')
user = settings.getSetting( "username" )
pwd = settings.getSetting( "password" )
@@ -133,7 +141,6 @@ def login():
'vb_login_md5password': '',
'vb_login_md5password_utf': ''})
-
requestHandler.addheaders = [("User-agent", useragent)]
page = requestHandler.open("http://forum.nolife-tv.com/login.php",
loginrequest)
res = BeautifulSoup(page.read())
@@ -141,14 +148,17 @@ def login():
xbmc.log(msg=pluginLogHeader + "Invalid username,
aborting",level=xbmc.LOGFATAL)
err = xbmcgui.Dialog()
err.ok(unicode(language(35002)), unicode(language(34001)),
unicode(language(34002)))
+ settings.setSetting('loginok', "")
raise loginExpcetion()
elif re.compile('votre quota').findall(str(res)):
xbmc.log(msg=pluginLogHeader + "User account
locked",level=xbmc.LOGSEVERE)
err = xbmcgui.Dialog()
err.ok(unicode(language(35001)), unicode(language(34003)),
unicode(language(34004)), unicode(language(34005)))
+ settings.setSetting('loginok', "")
raise loginExpcetion()
else:
xbmc.log(msg=pluginLogHeader + "Valid User",level=xbmc.LOGDEBUG)
+ settings.setSetting('loginok', "ok")
def initialIndex():
"""Creates initial index
@@ -523,6 +533,35 @@ def extractVideoSearchInfo(element):
return info
+def createCookie():
+ """
+ Create a cookie.
+ If an older cookie exists its removed before the creation of the new cookie
+ """
+ xbmc.log(msg=pluginLogHeader + "Creation of new
cookie",level=xbmc.LOGDEBUG)
+ settings.setSetting('loginok', "")
+ if os.path.isfile(cookie_file):
+ os.remove(cookie_file)
+ cj = cookielib.LWPCookieJar()
+ return cj
+
+
+def loadCookie():
+ """
+ Load a cookie file
+ """
+ xbmc.log(msg=pluginLogHeader + "Loading cookie",level=xbmc.LOGDEBUG)
+ cj = cookielib.LWPCookieJar()
+ cj.load(filename=cookie_file, ignore_discard=True)
+ return cj
+
+def saveCookie():
+ """
+ Save cookieJar to cookie file
+ """
+ xbmc.log(msg=pluginLogHeader + "Saving cookie",level=xbmc.LOGDEBUG)
+ cj.save(filename=cookie_file, ignore_discard=True)
+
## Start of the add-on
xbmc.log(msg=pluginLogHeader + "-----------------------",level=xbmc.LOGDEBUG)
xbmc.log(msg=pluginLogHeader + "Nolife plugin main loop",level=xbmc.LOGDEBUG)
@@ -532,7 +571,6 @@ pluginHandle = int(sys.argv[1])
params = get_params()
xbmc.log(msg=pluginLogHeader + "Parameters read",level=xbmc.LOGDEBUG)
-
try:
url = urllib.unquote_plus(params["url"])
except:
@@ -551,18 +589,31 @@ xbmc.log(msg=pluginLogHeader + "requested url : " +
url,level=xbmc.LOGDEBUG)
xbmc.log(msg=pluginLogHeader + "requested id : " +
str(_id),level=xbmc.LOGDEBUG)
# Starting request handler
-# FIXME : Find a way to keep the cookies in the add-on session to avoid
relogin all the time
-xbmc.log(msg=pluginLogHeader + "No cookies, adding a jar",level=xbmc.LOGDEBUG)
-cj = cookielib.CookieJar()
-requestHandler = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
+if not os.path.isfile(cookie_file) or (datetime.datetime.now() -
datetime.datetime.fromtimestamp(os.stat(cookie_file).st_mtime)).seconds > 900:
+ xbmc.log(msg=pluginLogHeader + "Cookie is too old or does not
exists",level=xbmc.LOGDEBUG)
+ cj = createCookie()
+ saveCookie()
-# The login is only done for authenticated mode
-if settings.getSetting( "authenticate" ) == "true":
- xbmc.log(msg=pluginLogHeader + "authentication
requested",level=xbmc.LOGDEBUG)
- login()
+cj = loadCookie()
+requestHandler = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
+xbmc.log(msg=pluginLogHeader + "Login state : " +
settings.getSetting('loginok'),level=xbmc.LOGDEBUG)
+if settings.getSetting('authenticate') == "true":
+ if not settings.getSetting('loginok') == "ok":
+ xbmc.log(msg=pluginLogHeader + "User not logged",level=xbmc.LOGDEBUG)
+ xbmc.log(msg=pluginLogHeader + "Process to login",level=xbmc.LOGDEBUG)
+ login()
+ xbmc.log(msg=pluginLogHeader + "Reading subscription
mode",level=xbmc.LOGDEBUG)
+ settings.setSetting('subscriptionMode',str(get_subscription_mode()))
+ saveCookie()
+else:
+ xbmc.log(msg=pluginLogHeader + "Authenticated mode not
requested",level=xbmc.LOGDEBUG)
+ xbmc.log(msg=pluginLogHeader + "Reading subscription
mode",level=xbmc.LOGDEBUG)
+ settings.setSetting('subscriptionMode','0')
+
# Find the access mode of the user
-subscription = get_subscription_mode()
+subscription = settings.getSetting('subscriptionMode')
+xbmc.log(msg=pluginLogHeader + "User mode value : " +
subscription,level=xbmc.LOGDEBUG)
# Determining and executing action
if( mode == None or url == None or len(url) < 1 ) and _id == 0:
-----------------------------------------------------------------------
Summary of changes:
plugin.video.m6groupe/addon.xml | 2 +-
plugin.video.m6groupe/changelog.txt | 6 +
.../resources/language/English/strings.xml | 1 +
.../resources/language/French/strings.xml | 1 +
plugin.video.m6groupe/resources/lib/catalog.py | 21 +-
plugin.video.m6groupe/resources/settings.xml | 1 +
.../LICENSE.txt | 0
plugin.video.nolife/addon.xml | 2 +-
plugin.video.nolife/default.py | 75 ++-
plugin.video.nolife/gpl.txt | 674 --------------------
10 files changed, 93 insertions(+), 690 deletions(-)
copy {plugin.audio.dradio => plugin.video.nolife}/LICENSE.txt (100%)
delete mode 100644 plugin.video.nolife/gpl.txt
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons