[contrib] fix pyflakes in xbmc plugin

This commit is contained in:
Bezleputh 2014-09-02 17:05:43 +02:00
commit 579db854e8
11 changed files with 452 additions and 452 deletions

View file

@ -1,31 +1,31 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
import resources.lib.base.common_xbmc as common_xbmc import resources.lib.base.common_xbmc as common_xbmc
import resources.lib.constants as constants import resources.lib.constants as constants
from resources.lib.actions import actions from resources.lib.actions import actions
# Plugin constants # Plugin constants
version = "0.1.0" version = "0.1.0"
plugin = "videoobmc" + version plugin = "videoobmc" + version
addon_id = "plugin.video.videoobmc" addon_id = "plugin.video.videoobmc"
author = "Bezleputh" author = "Bezleputh"
mail = "carton_ben@yahoo.fr" mail = "carton_ben@yahoo.fr"
#import lxml.html import Element #import lxml.html import Element
#print Element.__file__ #print Element.__file__
#TODO gestion du logger, gestion des modules via XBMC (activation/desactivation) #TODO gestion du logger, gestion des modules via XBMC (activation/desactivation)
#Bug encodge des categories #Bug encodge des categories
#corriger version 1 pour que v2 et v1 donctionnent #corriger version 1 pour que v2 et v1 donctionnent
if (__name__ == "__main__"): if (__name__ == "__main__"):
if not (sys.argv[2]): if not (sys.argv[2]):
actions[constants.DISPLAY_MENU]()._do() actions[constants.DISPLAY_MENU]()._do()
else: else:
params = common_xbmc.parse_params(sys.argv[2]) params = common_xbmc.parse_params(sys.argv[2])
action = params.get("action") action = params.get("action")
if (action): if (action):
actions[action]()._do(params) actions[action]()._do(params)
else: else:
common_xbmc.display_error(" ARGV Nothing done.. verify params " + repr(params)) common_xbmc.display_error(" ARGV Nothing done.. verify params " + repr(params))

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <?xml vesion="1.0" encoding="utf-8" standalone="yes"?>
<strings> <stings>
<!-- Les strings de 30000 à 30999 sont réservées aux paramètres plug-in --> <!-- Les stings de 30000 à 30999 sont ésevées aux paamètes plug-in -->
<string id="30000">Search</string> <sting id="30000">Seach</sting>
<string id="30001">Search: </string> <sting id="30001">Seach: </sting>
<string id="30100">Download</string> <sting id="30100">Download</sting>
<string id="30110">Information</string> <sting id="30110">Infomation</sting>
<string id="30200">Error!</string> <sting id="30200">Eo!</sting>
<string id="30300">Information</string> <sting id="30300">Infomation</sting>
<string id="30301">Download started</string> <sting id="30301">Download stated</sting>
<string id="30302">Download succeed</string> <sting id="30302">Download succeed</sting>
<string id="30510">Download folder: </string> <sting id="30510">Download folde: </sting>
<string id="30520">Number of videos per backends: </string> <sting id="30520">Numbe of videos pe backends: </sting>
<string id="30530">Display Non Safe For Work videos: </string> <sting id="30530">Display Non Safe Fo Wok videos: </sting>
<string id="30540">Enable debug mode: </string> <sting id="30540">Enable debug mode: </sting>
<string id="30550">Update weboob backends</string> <sting id="30550">Update weboob backends</sting>
<string id="30551">Start updating weboob backends</string> <sting id="30551">Stat updating weboob backends</sting>
<string id="30552">Weboob backends successfully updated</string> <sting id="30552">Weboob backends successfully updated</sting>
</strings> </stings>

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <?xml vesion="1.0" encoding="utf-8" standalone="yes"?>
<strings> <stings>
<!-- Les strings de 30000 à 30999 sont réservées aux paramètres plug-in --> <!-- Les stings de 30000 à 30999 sont ésevées aux paamètes plug-in -->
<string id="30000">Recherche</string> <sting id="30000">Recheche</sting>
<string id="30001">Recherche: </string> <sting id="30001">Recheche: </sting>
<string id="30100">Télécharger</string> <sting id="30100">Téléchage</sting>
<string id="30110">Information</string> <sting id="30110">Infomation</sting>
<string id="30200">Erreur!</string> <sting id="30200">Eeu!</sting>
<string id="30300">Information</string> <sting id="30300">Infomation</sting>
<string id="30301">Lancement du téléchargement</string> <sting id="30301">Lancement du téléchagement</sting>
<string id="30302">Fichier téléchargé avec succès</string> <sting id="30302">Fichie téléchagé avec succès</sting>
<string id="30510">Répertoire de Téléchargement:</string> <sting id="30510">Répetoie de Téléchagement:</sting>
<string id="30520">Nombre de vidéos par backends:</string> <sting id="30520">Nombe de vidéos pa backends:</sting>
<string id="30530">Afficher les vidéos interdites aux moins de 18 ans :</string> <sting id="30530">Affiche les vidéos intedites aux moins de 18 ans :</sting>
<string id="30540">Enable debug mode :</string> <sting id="30540">Enable debug mode :</sting>
<string id="30550">Mise à jour des modules weboob</string> <sting id="30550">Mise à jou des modules weboob</sting>
<string id="30551">Debut de la mise à jour</string> <sting id="30551">Debut de la mise à jou</sting>
<string id="30552">Weboob est maintenant à jour</string> <sting id="30552">Weboob est maintenant à jou</sting>
</strings> </stings>

View file

@ -1 +1 @@
# Dummy file to make this directory a package. # Dummy file to make this directory a package.

View file

@ -1 +1 @@
# Dummy file to make this directory a package. # Dummy file to make this directory a package.

View file

@ -1,157 +1,157 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import xbmc import xbmc
import xbmcgui import xbmcgui
import xbmcplugin import xbmcplugin
import xbmcaddon import xbmcaddon
import urllib import urllib
import sys import sys
from traceback import print_exc from traceback import print_exc
def get_addon(): def get_addon():
if hasattr(sys.modules["__main__"], "addon_id"): if hasattr(sys.modules["__main__"], "addon_id"):
_id = sys.modules["__main__"].addon_id _id = sys.modules["__main__"].addon_id
return xbmcaddon.Addon(id=_id) return xbmcaddon.Addon(id=_id)
def get_translation(key): def get_translation(key):
addon = get_addon() addon = get_addon()
if addon: if addon:
return addon.getLocalizedString(int(key)) return addon.getLocalizedString(int(key))
def get_settings(key): def get_settings(key):
addon = get_addon() addon = get_addon()
if addon: if addon:
return addon.getSetting(key) return addon.getSetting(key)
def get_addon_dir(): def get_addon_dir():
addon = get_addon() addon = get_addon()
if addon: if addon:
addonDir = addon.getAddonInfo("path") addonDir = addon.getAddonInfo("path")
else: else:
addonDir = xbmc.translatePath("special://profile/addon_data/") addonDir = xbmc.translatePath("special://profile/addon_data/")
return addonDir return addonDir
def display_error(msg): def display_error(msg):
xbmc.executebuiltin("XBMC.Notification(%s, %s)" % (get_translation('30200').decode('utf-8'), msg)) xbmc.executebuiltin("XBMC.Notification(%s, %s)" % (get_translation('30200').decode('utf-8'), msg))
print msg print msg
print_exc(msg) print_exc(msg)
def display_info(msg): def display_info(msg):
xbmc.executebuiltin("XBMC.Notification(%s, %s, 3000, DefaultFolder.png)" % (get_translation('30300').encode('utf-8'), xbmc.executebuiltin("XBMC.Notification(%s, %s, 3000, DefaultFolder.png)" % (get_translation('30300').encode('utf-8'),
msg.encode('utf-8'))) msg.encode('utf-8')))
#print msg #print msg
print_exc() print_exc()
def parse_params(param_str): def parse_params(param_str):
param_dic = {} param_dic = {}
# Parameters are on the 3rd arg passed to the script # Parameters are on the 3rd arg passed to the script
param_str = sys.argv[2] param_str = sys.argv[2]
if len(param_str) > 1: if len(param_str) > 1:
param_str = param_str.replace('?', '') param_str = param_str.replace('?', '')
# Ignore last char if it is a '/' # Ignore last char if it is a '/'
if param_str[len(param_str) - 1] == '/': if param_str[len(param_str) - 1] == '/':
param_str = param_str[0:len(param_str) - 2] param_str = param_str[0:len(param_str) - 2]
# Processing each parameter splited on '&' # Processing each parameter splited on '&'
for param in param_str.split('&'): for param in param_str.split('&'):
try: try:
# Spliting couple key/value # Spliting couple key/value
key, value = param.split('=') key, value = param.split('=')
except: except:
key = param key = param
value = '' value = ''
key = urllib.unquote_plus(key) key = urllib.unquote_plus(key)
value = urllib.unquote_plus(value) value = urllib.unquote_plus(value)
# Filling dictionnary # Filling dictionnary
param_dic[key] = value param_dic[key] = value
return param_dic return param_dic
def ask_user(content, title): def ask_user(content, title):
keyboard = xbmc.Keyboard(content, title) keyboard = xbmc.Keyboard(content, title)
keyboard.doModal() keyboard.doModal()
if keyboard.isConfirmed() and keyboard.getText(): if keyboard.isConfirmed() and keyboard.getText():
return keyboard.getText() return keyboard.getText()
return "" return ""
def create_param_url(param_dic, quote_plus=False): def create_param_url(param_dic, quote_plus=False):
""" """
Create an plugin URL based on the key/value passed in a dictionary Create an plugin URL based on the key/value passed in a dictionary
""" """
url = sys.argv[0] url = sys.argv[0]
sep = '?' sep = '?'
try: try:
for param in param_dic: for param in param_dic:
if quote_plus: if quote_plus:
url = url + sep + urllib.quote_plus(param) + '=' + urllib.quote_plus(param_dic[param]) url = url + sep + urllib.quote_plus(param) + '=' + urllib.quote_plus(param_dic[param])
else: else:
url = "%s%s%s=%s" % (url, sep, param, param_dic[param]) url = "%s%s%s=%s" % (url, sep, param, param_dic[param])
sep = '&' sep = '&'
except Exception, msg: except Exception as msg:
display_error("create_param_url %s" % msg) display_error("create_param_url %s" % msg)
url = None url = None
return url return url
def create_list_item(name, itemInfoType="Video", itemInfoLabels=None, iconimage="DefaultFolder.png", def create_list_item(name, itemInfoType="Video", itemInfoLabels=None, iconimage="DefaultFolder.png",
c_items=None, isPlayable=False): c_items=None, isPlayable=False):
lstItem = xbmcgui.ListItem(label=name, iconImage=iconimage, thumbnailImage=iconimage) lstItem = xbmcgui.ListItem(label=name, iconImage=iconimage, thumbnailImage=iconimage)
if c_items: if c_items:
lstItem.addContextMenuItems(c_items, replaceItems=True) lstItem.addContextMenuItems(c_items, replaceItems=True)
if itemInfoLabels: if itemInfoLabels:
iLabels = itemInfoLabels iLabels = itemInfoLabels
else: else:
iLabels = {"Title": name, } iLabels = {"Title": name, }
lstItem.setInfo(type=itemInfoType, infoLabels=iLabels) lstItem.setInfo(type=itemInfoType, infoLabels=iLabels)
if isPlayable: if isPlayable:
lstItem.setProperty('IsPlayable', "true") lstItem.setProperty('IsPlayable', "true")
return lstItem return lstItem
def add_menu_item(params={}): def add_menu_item(params={}):
url = create_param_url(params) url = create_param_url(params)
if params.get('name'): if params.get('name'):
if params.get('iconimage'): if params.get('iconimage'):
lstItem = create_list_item(params.get('name'), iconimage=params.get('iconimage')) lstItem = create_list_item(params.get('name'), iconimage=params.get('iconimage'))
else: else:
lstItem = create_list_item(params.get('name')) lstItem = create_list_item(params.get('name'))
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=lstItem, isFolder=True) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=lstItem, isFolder=True)
else: else:
display_error('add_menu_item : Fail to add item to menu') display_error('add_menu_item : Fail to add item to menu')
def add_menu_link(params={}): def add_menu_link(params={}):
if params.get('name') and params.get('iconimage') and params.get('url') and \ if params.get('name') and params.get('iconimage') and params.get('url') and \
params.get('itemInfoLabels') and params.get('c_items'): params.get('itemInfoLabels') and params.get('c_items'):
url = params.get('url') url = params.get('url')
lstItem = create_list_item(params.get('name'), iconimage=params.get('iconimage'), lstItem = create_list_item(params.get('name'), iconimage=params.get('iconimage'),
itemInfoLabels=params.get('itemInfoLabels'), c_items=params.get('c_items'), itemInfoLabels=params.get('itemInfoLabels'), c_items=params.get('c_items'),
isPlayable=True) isPlayable=True)
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=lstItem) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=lstItem)
else: else:
display_error('add_menu_link : Fail to add item to menu') display_error('add_menu_link : Fail to add item to menu')
def end_of_directory(update=False): def end_of_directory(update=False):
xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True, updateListing=update) # , cacheToDisc=True) xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True, updateListing=update) # , cacheToDisc=True)

View file

@ -1,40 +1,40 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
if hasattr(sys.modules["__main__"], "common_xbmc"): if hasattr(sys.modules["__main__"], "common_xbmc"):
common_xbmc = sys.modules["__main__"].common_xbmc common_xbmc = sys.modules["__main__"].common_xbmc
else: else:
import common_xbmc import common_xbmc
class BaseMenuItem(): class BaseMenuItem():
def __init__(self, name, action, iconimage="DefaultFolder.png"): def __init__(self, name, action, iconimage="DefaultFolder.png"):
self.params = {} self.params = {}
self.params['name'] = name self.params['name'] = name
self.params['action'] = action self.params['action'] = action
self.params['iconimage'] = iconimage self.params['iconimage'] = iconimage
def get(self, element): def get(self, element):
return self.params[element] return self.params[element]
def add_to_menu(self): def add_to_menu(self):
common_xbmc.add_menu_item(self.params) common_xbmc.add_menu_item(self.params)
class BaseMenuLink(BaseMenuItem): class BaseMenuLink(BaseMenuItem):
def __init__(self, name, url, action, iconimage="DefaultFolder.png"): def __init__(self, name, url, action, iconimage="DefaultFolder.png"):
BaseMenuItem.__init__(self, name, action, iconimage) BaseMenuItem.__init__(self, name, action, iconimage)
self.params["url"] = url self.params["url"] = url
def createVideoContextMenu(self): def createVideoContextMenu(self):
return "" return ""
def create_info_labels(self): def create_info_labels(self):
return "" return ""
def add_to_menu(self): def add_to_menu(self):
self.params["itemInfoLabels"] = self.create_info_labels() self.params["itemInfoLabels"] = self.create_info_labels()
self.params["c_items"] = self.createVideoContextMenu() self.params["c_items"] = self.createVideoContextMenu()
common_xbmc.add_menu_link(self.params) common_xbmc.add_menu_link(self.params)

View file

@ -55,7 +55,7 @@ class Weboobmc():
os.path.join(os.path.expanduser('~'), '.local', 'share') os.path.join(os.path.expanduser('~'), '.local', 'share')
), 'weboob') ), 'weboob')
icons_dir = os.path.join(datadir, 'icons') icons_dir = os.path.join(datadir, 'icons')
return os.path.join(icons_dir, '%s.png' % module) return os.path.join(icons_dir, '%s.png' % module)
def is_category(self, obj): def is_category(self, obj):

View file

@ -1,72 +1,72 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
import constants import constants
from datetime import datetime, timedelta from datetime import datetime, timedelta
from base.menu import BaseMenuItem, BaseMenuLink from base.menu import BaseMenuItem, BaseMenuLink
if hasattr(sys.modules["__main__"], "common_xbmc"): if hasattr(sys.modules["__main__"], "common_xbmc"):
common_xbmc = sys.modules["__main__"].common_xbmc common_xbmc = sys.modules["__main__"].common_xbmc
else: else:
import common_xbmc import common_xbmc
class MenuItem(BaseMenuItem): class MenuItem(BaseMenuItem):
params = {} params = {}
def __init__(self, name, action, iconimage="DefaultFolder.png", backend=''): def __init__(self, name, action, iconimage="DefaultFolder.png", backend=''):
BaseMenuItem.__init__(self, name, action, iconimage) BaseMenuItem.__init__(self, name, action, iconimage)
self.params['backend'] = backend self.params['backend'] = backend
class MenuItemPath(MenuItem): class MenuItemPath(MenuItem):
def __init__(self, collection, action=constants.DISPLAY_COLLECTION_MENU, iconimage="DefaultFolder.png"): def __init__(self, collection, action=constants.DISPLAY_COLLECTION_MENU, iconimage="DefaultFolder.png"):
MenuItem.__init__(self, collection.title, action, iconimage, collection.fullid.split('@')[-1]) MenuItem.__init__(self, collection.title, action, iconimage, collection.fullid.split('@')[-1])
self.params["path"] = '/'.join(collection.split_path) self.params["path"] = '/'.join(collection.split_path)
class MenuItemVideo(BaseMenuLink): class MenuItemVideo(BaseMenuLink):
def __init__(self, video, iconimage="DefaultFolder.png"): def __init__(self, video, iconimage="DefaultFolder.png"):
name = '[%s] %s' % (video.backend, video.title) name = '[%s] %s' % (video.backend, video.title)
BaseMenuLink.__init__(self, name, video.url, constants.VIDEO, BaseMenuLink.__init__(self, name, video.url, constants.VIDEO,
video.thumbnail.url if video.thumbnail.url else iconimage) video.thumbnail.url if video.thumbnail.url else iconimage)
self.video = video self.video = video
self.params["id"] = self.video.id self.params["id"] = self.video.id
def createVideoContextMenu(self): def createVideoContextMenu(self):
cm = [] cm = []
#Information #Information
cm.append((common_xbmc.get_translation('30110'), "XBMC.Action(Info)")) cm.append((common_xbmc.get_translation('30110'), "XBMC.Action(Info)"))
#Téléchargement #Téléchargement
url = "%s?action=%s&id=%s&backend=%s" % (sys.argv[0], constants.DOWNLOAD, self.video.id, self.video.backend) url = "%s?action=%s&id=%s&backend=%s" % (sys.argv[0], constants.DOWNLOAD, self.video.id, self.video.backend)
cm.append((common_xbmc.get_translation('30100'), "XBMC.PlayMedia(%s)" % (url))) cm.append((common_xbmc.get_translation('30100'), "XBMC.PlayMedia(%s)" % (url)))
return cm return cm
def create_info_labels(self): def create_info_labels(self):
date, year = self.format_date(self.video.date) date, year = self.format_date(self.video.date)
duration = 0 duration = 0
if self.video.duration: if self.video.duration:
duration = u'%s' % str(self.video.duration.total_seconds()/60) if isinstance(self.video.duration, timedelta) else self.video.duration duration = u'%s' % str(self.video.duration.total_seconds()/60) if isinstance(self.video.duration, timedelta) else self.video.duration
description = u'%s' % self.video.description description = u'%s' % self.video.description
return {"Title": self.video.title, return {"Title": self.video.title,
"Year": year, "Year": year,
"Plot": description, "Plot": description,
"PlotOutline": description[0:30] if len(description) > 30 else description, "PlotOutline": description[0:30] if len(description) > 30 else description,
"Director": self.video.author if self.video.author else 'Unknown', "Director": self.video.author if self.video.author else 'Unknown',
"Duration": duration, "Duration": duration,
"Date": date} "Date": date}
def format_date(self, video_date): def format_date(self, video_date):
date = datetime.now().strftime("%d/%m/%Y") date = datetime.now().strftime("%d/%m/%Y")
if video_date: if video_date:
date = video_date.strftime("%d/%m/%Y") date = video_date.strftime("%d/%m/%Y")
year = date.split('/')[-1] year = date.split('/')[-1]
return date, year return date, year

View file

@ -1 +1 @@
# Dummy file to make this directory a package. # Dummy file to make this directory a package.

View file

@ -1,110 +1,110 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import urllib import urllib
def get_addon(): def get_addon():
pass pass
def get_translation(key): def get_translation(key):
translation = {'30000': 'Recherche', translation = {'30000': 'Recherche',
'30001': 'Recherche :', '30001': 'Recherche :',
'30100': 'Télécharger', '30100': 'Télécharger',
'30110': 'Information', '30110': 'Information',
'30200': 'Erreur!', '30200': 'Erreur!',
'30300': 'Information', '30300': 'Information',
'30301': 'Lancement du téléchargement', '30301': 'Lancement du téléchargement',
'30302': 'Fichier téléchargé avec succès', '30302': 'Fichier téléchargé avec succès',
'30551': 'Debut de la mise à jour', '30551': 'Debut de la mise à jour',
'30552': 'Weboob est maintenant à jour'} '30552': 'Weboob est maintenant à jour'}
return translation.get(key) return translation.get(key)
def get_addon_dir(): def get_addon_dir():
return '/home/benjamin' return '/home/benjamin'
def get_settings(key): def get_settings(key):
settings = {'downloadPath': get_addon_dir(), settings = {'downloadPath': get_addon_dir(),
'nbVideoPerBackend': '0', 'nbVideoPerBackend': '0',
'nsfw': 'False'} 'nsfw': 'False'}
return settings.get(key) return settings.get(key)
def display_error(error): def display_error(error):
print "%s: %s" % ("ERROR", error) print "%s: %s" % ("ERROR", error)
def display_info(msg): def display_info(msg):
print "%s: %s" % ("INFO", msg) print "%s: %s" % ("INFO", msg)
def parse_params(paramStr): def parse_params(paramStr):
paramDic = {} paramDic = {}
# Parameters are on the 3rd arg passed to the script # Parameters are on the 3rd arg passed to the script
if len(paramStr) > 1: if len(paramStr) > 1:
paramStr = paramStr.replace('?', '') paramStr = paramStr.replace('?', '')
# Ignore last char if it is a '/' # Ignore last char if it is a '/'
if paramStr[len(paramStr) - 1] == '/': if paramStr[len(paramStr) - 1] == '/':
paramStr = paramStr[0:len(paramStr) - 2] paramStr = paramStr[0:len(paramStr) - 2]
# Processing each parameter splited on '&' # Processing each parameter splited on '&'
for param in paramStr.split('&'): for param in paramStr.split('&'):
try: try:
# Spliting couple key/value # Spliting couple key/value
key, value = param.split('=') key, value = param.split('=')
except: except:
key = param key = param
value = '' value = ''
key = urllib.unquote_plus(key) key = urllib.unquote_plus(key)
value = urllib.unquote_plus(value) value = urllib.unquote_plus(value)
# Filling dictionnary # Filling dictionnary
paramDic[key] = value paramDic[key] = value
return paramDic return paramDic
def ask_user(content, title): def ask_user(content, title):
return raw_input(title) return raw_input(title)
def create_param_url(paramsDic, quote_plus=False): def create_param_url(paramsDic, quote_plus=False):
#url = sys.argv[0] #url = sys.argv[0]
url = '' url = ''
sep = '?' sep = '?'
try: try:
for param in paramsDic: for param in paramsDic:
if quote_plus: if quote_plus:
url = url + sep + urllib.quote_plus(param) + '=' + urllib.quote_plus(paramsDic[param]) url = url + sep + urllib.quote_plus(param) + '=' + urllib.quote_plus(paramsDic[param])
else: else:
url = "%s%s%s=%s" % (url, sep, param, paramsDic[param]) url = "%s%s%s=%s" % (url, sep, param, paramsDic[param])
sep = '&' sep = '&'
except Exception, msg: except Exception as msg:
display_error("create_param_url %s" % msg) display_error("create_param_url %s" % msg)
url = None url = None
return url return url
def add_menu_item(params={}): def add_menu_item(params={}):
print '%s => "%s"' % (params.get('name'), create_param_url(params)) print '%s => "%s"' % (params.get('name'), create_param_url(params))
def add_menu_link(params={}): def add_menu_link(params={}):
print '[%s] %s (%s)' % (params.get('id'), params.get('name'), params.get('url')) print '[%s] %s (%s)' % (params.get('id'), params.get('name'), params.get('url'))
#print params.get('itemInfoLabels') #print params.get('itemInfoLabels')
#print params.get('c_items') #print params.get('c_items')
def end_of_directory(update=False): def end_of_directory(update=False):
print '******************************************************' print '******************************************************'
def download_video(url, name, dir='./'): def download_video(url, name, dir='./'):
print 'Downlaod a video %s from %s' % (name, url) print 'Downlaod a video %s from %s' % (name, url)