I am trying to get this plugin also running on my PMS on an OMV (Debian) server.
I have managed to get the channel showing up on my PMS, however after pressing LOCK nothing happens.
Attached is the log file.
Further, this is my config.
import os
import thread
import time
PREFIX = "/video/l0ck"
PASSWORD = "030813"
BASEPATHL0CK = '/media/645f4371-4869-43f4-b76d-b29ceb355057/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/L0ck.bundle/Contents/Resources/l0ck_support/l0ck.sh'
BASEPATHUNL0CK ='/media/645f4371-4869-43f4-b76d-b29ceb355057/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/L0ck.bundle/Contents/Resources/l0ck_support/unl0ck.sh'
GENERATE_DATE = "24th MAR 2015"
TIMER = 0
DEV_MODE = False
NAME = 'L0ck'
ART = 'art-default.jpg'
ICON = 'icon-default.png'
L0CK_ICON = 'L0ck.png'
UNL0CK_ICON = 'unL0ck.png'
SUCCESS_ICON = 'success.png'
ERROR_ICON = 'error.png'
UPDATES_ICON = 'updates.png'
def Start():
HTTP.CacheTime = 0
ObjectContainer.art = R(ART)
DirectoryObject.thumb = R(ICON)
Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
Plugin.AddViewGroup("List", viewMode="List", mediaType="items")
ObjectContainer.view_group = 'Details'
Logger('Platform: ' + Platform.OS +' Version: '+Platform.OSVersion, force=True)
Logger('PMS Server: ' + Platform.ServerVersion, force=True)
Logger('Plex Media Server at ' + Core.app_support_path, force=True)
Logger('Plug-in bundles are located in ' + Core.storage.join_path(Core.app_support_path, Core.config.bundles_dir_name), force=True)
Logger('Plug-in support files are located in ' + Core.storage.join_path(Core.app_support_path, Core.config.plugin_support_dir_name), force=True)
Logger('L0ck Bundle path is ' + Core.storage.join_path(Core.storage.join_path(Core.app_support_path, Core.config.bundles_dir_name), 'L0ck.bundle'), force=True)
Logger('BASEPATHL0CK: ' + BASEPATHL0CK, force=True)
Logger('BASEPATHUNL0CK: ' + BASEPATHUNL0CK, force=True)
Logger('L0ck plugin generated on: ' + GENERATE_DATE, force=True)
@handler(PREFIX, NAME, ICON, ART)
@route(PREFIX + '/mainmenu')
def MainMenu():
oc = ObjectContainer(no_cache=True)
oc.add(DirectoryObject(key=Callback(L0ck), title="L0ck", thumb=R(L0CK_ICON)))
oc.add(InputDirectoryObject(key=Callback(UnL0ck), title="UnL0ck", thumb=R(UNL0CK_ICON), prompt="Enter your password"))
oc.add(DirectoryObject(key=Callback(Updates), title="Update Feed", thumb=R(UPDATES_ICON)))
return oc
@route(PREFIX + '/Updates')
def Updates():
oc = ObjectContainer(title2='You generated the L0ck plugin on ['+ GENERATE_DATE +']', view_group='List', no_cache=True)
updatedata = ''
updatedate = ''
for item in xml.entries:
updatedata = item.description
updatedate = item.title
Logger(updatedate, force=True)
Logger(updatedata, force=True)
oc.add(DirectoryObject(key=Callback(MainMenu),title='[' + updatedate +'] - ' + updatedata))
if len(oc) < 1:
Logger('Something went wrong while pulling xml', force=True)
return oc.add(DirectoryObject(key=Callback(MainMenu),title='Pl. ensure your connected to the internet and try again!'))
else:
return oc
@route(PREFIX + '/L0ck')
def L0ck():
oc = ObjectContainer(title2="L0ck", no_cache=True)
Logger('L0cking', force=True)
filepath = '"' + BASEPATHL0CK + '"'
os.system('sh ' + filepath)
Logger('L0cked', force=True)
oc.add(PopupDirectoryObject(key=Callback(MainMenu), title="L0cked", duration=3, summary="Section(s) successfuly L0cked!", thumb=R(SUCCESS_ICON)))
return oc
@route(PREFIX + '/UnL0ck')
def UnL0ck(query):
oc = ObjectContainer(title2="UnL0ck", no_cache=True)
if query == PASSWORD:
Logger('Password correct about to launch UnL0ck', force=True)
filepath = '"' + BASEPATHUNL0CK + '"'
os.system('sh ' + filepath)
Logger('Launched unL0ck', force=True)
oc.add(PopupDirectoryObject(key=Callback(MainMenu), title="UnL0cked", duration=3, summary="Section(s) successfully UnL0cked!", thumb=R(SUCCESS_ICON)))
if TIMER != 0:
Logger('Triggering Unl0ck in ' + str(TIMER) + ' seconds', force=True)
Thread.CreateTimer(TIMER, L0ck)
Logger('Successfully UnL0cked and thread/timer set', force=True)
else:
Logger('Timer feature is not being used!', force=True)
return oc
else:
Logger('Password Incorrect, someone is trying to get in!', force=True)
oc.add(PopupDirectoryObject(key=Callback(MainMenu), title="Incorrect Password", duration=3, summary="Try Again!", thumb=R(ERROR_ICON)))
return oc
@route(PREFIX + '/logger')
def Logger(message, force=False):
if DEV_MODE:
force = True
if force:
Log.Debug('======L0CK======'+message)
else:
pass
Here are the l0ck. and unl0ck:
Can someone tell me and help me, why it is not working and not locking the two sections ?
This plugin would be sooo usefull for me, to get my daughter access to the plex server.