Kodi Community Forum

Full Version: Security CAM Overlay add-on
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
(2014-05-02, 21:35)el_cabong Wrote: [ -> ]very nice addon so far.

is it possible to add functionality so we can specify multiple cameras, and use something like the following to call each one:

{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.securitycam","camid":"1"},"id":"1"}}
{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.securitycam","camid":"2"},"id":"1"}}

See here on my blog I just wrote an updated how-to guide. Wink
I've made some edits to th[align=center]e original code if anyone is interested. I wanted to use this for a baby monitor that shows onscreen if the baby is moving. My setup is follows:

- DLink DCS-932L IP Cam which has motion detection.
- When motion is detected, it FTP overwrites a file to my HTPC (two choices with this cam, FTP or Email)
- Using Eventghost with the FTP directory watcher plugin it calls the JSON RPC command for the Security Cam add-on.

This worked well after making some timing choices for the Duration (20s) of the add-on and the Seconds per frame (18s) IP Cam setting for the motion detection FTP process. However, there were still some issues for me.
- Multiple instances of the script would start.
- Script errors would eventually occur if there was a lot of motion
- FTP events caused it to be called twice because directory watcher detects the FTP start and FTP complete as both changes to the directory.
- Hard to manually back out with a million instances running so that I could move about xbmc again.

So I decided to modify the code to detect if there was already an instance running. Also I wanted it to stay on screen if there was continuous motion detected. This is so we can decide if its really necessary to go and be parents or if the baby is just settling.

By no means am I an expert coder... this is my first interaction with Python. Feedback is appreciated!

Code:
[/align]
# Import the modules
import os, time, urllib2, xbmc, xbmcaddon, xbmcgui, xbmcvfs

# Constants
ACTION_PREVIOUS_MENU = 10
ACTION_BACKSPACE = 110
ACTION_NAV_BACK = 92
ADD_ON_ID = 'script.securitycam'

# Set plugin variables
__addon__    = xbmcaddon.Addon()
__cwd__      = __addon__.getAddonInfo('path').decode("utf-8")
__icon__     = xbmc.translatePath(os.path.join(__cwd__, 'icon.png').encode("utf-8")).decode("utf-8")
__resource__ = xbmc.translatePath(os.path.join(__cwd__, 'resources').encode("utf-8")).decode("utf-8")
__snapshot_dir__ = xbmc.translatePath(os.path.join(__resource__, 'media', 'snapshots').encode("utf-8")).decode("utf-8")
__time_file__ = xbmc.translatePath(os.path.join(__resource__, 'media').encode("utf-8")).decode("utf-8")   '''New Variable'''

# Get settings
url       = __addon__.getSetting('url')
username  = __addon__.getSetting('username')
password  = __addon__.getSetting('password')
width     = int(float(__addon__.getSetting('width')))
height    = int(float(__addon__.getSetting('height')))
interval  = int(float(__addon__.getSetting('interval')))
autoClose = (__addon__.getSetting('autoClose') == 'true')
duration  = int(float(__addon__.getSetting('duration')) * 1000)

# Utils

def log(message,loglevel=xbmc.LOGNOTICE):
    xbmc.log((ADD_ON_ID + ": " + message).encode('UTF-8','replace'),level=loglevel)

# Classes
class CamPreviewDialog(xbmcgui.WindowDialog):
    def __init__(self):
        log('CamPreviewDialog Initialized \n', xbmc.LOGDEBUG)
        COORD_GRID_WIDTH = 1280
        COORD_GRID_HEIGHT = 720
        scaledWidth = int(float(COORD_GRID_WIDTH) / self.getWidth() * width)
        scaledHeight = int(float(COORD_GRID_HEIGHT) / self.getHeight() * height)
        self.image = xbmcgui.ControlImage(COORD_GRID_WIDTH - scaledWidth, COORD_GRID_HEIGHT - scaledHeight, scaledWidth, scaledHeight, __icon__)
        self.addControl(self.image)
        self.image.setAnimations([('WindowOpen', 'effect=slide start=%d time=1000 tween=cubic easing=in'%(scaledWidth),), ('WindowClose', 'effect=slide end=%d time=1000 tween=cubic easing=in'%(scaledWidth),)])

    def start(self, autoClose, duration, interval, url, destination):
        log('CamPreviewDialog Started \n', xbmc.LOGDEBUG)
        self.isRunning = bool(1)
        snapshot = ''
        startTime = time.time()
        while(not autoClose or (time.time() - startTime) * 1000 <= duration):
            if xbmcvfs.exists(snapshot):
                os.remove(snapshot)

            snapshot = self.downloadSnapshot(url, destination)

            if snapshot != '':
                self.update(snapshot)

            xbmc.sleep(interval)

            '''Added following code to check or update the start time'''
            try:
                log('Opening Time File to check time', xbmc.LOGDEBUG)
                file = open(os.path.join(__time_file__, 'timefile.txt'), 'r')
                startTime = float(file.read())
                log('Start Time is: ' + str(startTime) + ' | Time Left is: ' + str(duration - ((time.time() - startTime) * 1000)), xbmc.LOGDEBUG)
                file.close()
            except IOError, message:
                log('Time File Error:' + str(message), xbmc.LOGDEBUG)
            finally:    
                if not self.isRunning:
                    break

        '''Added following code to successfully delete the file when the camera is done in case it was currently in use'''
        log('Removing Time File', xbmc.LOGDEBUG)
        while (os.path.exists(os.path.join( __time_file__, 'timefile.txt') )):
            try:
                os.remove(os.path.join( __time_file__, 'timefile.txt') )
            except IOError, message:
                log('Time File Delete Error:' + str(message), xbmc.LOGDEBUG)
            xbmc.sleep(interval)
            
        self.close()

    def downloadSnapshot(self, url, destination):
        log('Retreiving Image \n', xbmc.LOGDEBUG)
        try:
            imgData = urllib2.urlopen(url).read()
            filename = snapshot = xbmc.translatePath( os.path.join( destination, 'snapshot' + str(time.time()) + '.jpg' ).encode("utf-8") ).decode("utf-8")
            output = open(filename,'wb')
            output.write(imgData)
            output.close()
            return filename
        except:
            return ''

    def onAction(self, action):
        log('Received Action: ' + str(action.getId()) + '\n', xbmc.LOGDEBUG)
        if action in (ACTION_PREVIOUS_MENU, ACTION_BACKSPACE, ACTION_NAV_BACK):
            self.isRunning = bool(0)
            self.close()

    def update(self, image):
        log('Updating Image \n', xbmc.LOGDEBUG)
        self.image.setImage(image, bool(0))
    

'''New Function to write the start time to a file'''
def WriteStartTime():
    try:
        file = open(os.path.join( __time_file__, 'timefile.txt'), 'w')
        log('Writing new start time:' + str(time.time()), xbmc.LOGDEBUG)
        file.write (str(time.time()))
        file.close()
    except IOError, message:
        log('Time File Error:' + message, xbmc.LOGDEBUG)
    
    
# Main execution
'''New Execution code to check if there is an instance running already or not'''
if os.path.exists(os.path.join( __time_file__, 'timefile.txt')):
    log('Time File Exists', xbmc.LOGDEBUG)
    WriteStartTime()
    exit()

else:
    log('Camera Initial Start', xbmc.LOGDEBUG)
    WriteStartTime()

log('AutoClose: [' + str(autoClose) + ']\n', xbmc.LOGDEBUG)
log('Duration: [' + str(duration) + ']\n', xbmc.LOGDEBUG)
log('Interval: [' + str(interval) + ']\n', xbmc.LOGDEBUG)
log('Width: [' + str(width) + ']\n', xbmc.LOGDEBUG)
log('Height: [' + str(height) + ']\n', xbmc.LOGDEBUG)
log('Original URL: [' + url + ']\n', xbmc.LOGDEBUG)

# Add Basic Authentication Headers
if (username is not None and username != ''):
    passwordManager = urllib2.HTTPPasswordMgrWithDefaultRealm()
    passwordManager.add_password(None, url, username, password)
    authhandler = urllib2.HTTPBasicAuthHandler(passwordManager)
    opener = urllib2.build_opener(authhandler)
    urllib2.install_opener(opener)

# Replace URL agruments
argCount = len(sys.argv)
for i in xrange(1, argCount):
    search = '{%d}'%(i - 1)
    replace = sys.argv[i]
    url.replace(search, replace)

log('Final URL: [' + url + ']\n', xbmc.LOGDEBUG)

xbmcvfs.mkdir(__snapshot_dir__)

camPreview = CamPreviewDialog()
camPreview.show()
camPreview.start(autoClose, duration, interval, url, __snapshot_dir__)
del camPreview

dirs, files = xbmcvfs.listdir(__snapshot_dir__)
for file in files:
    log('Delete remaining snapshot: [' + file + ']\n', xbmc.LOGDEBUG)
    xbmcvfs.delete(os.path.join(__snapshot_dir__, file))
(2014-04-27, 15:31)SomeAssembly Wrote: [ -> ]Wow! great add-on.

I have it working perfectly. I was already using Ispy on windows to monitor my security cameras, I turned on face on my front door camera and have Ispy send the string to XBMC on my main tv over the local network. Everything is working as expected, but the security server computer opens a browser window each time it sends the string to XBMC. I don't know how many windows/tabs it can open before it crashes out.

Does anyone have any suggestions as how to send the string without the browser opening? Or, how to close the browser/tab after each call? From Ispy I can execute a program or shortcut.

Did you find the right syntax? (iSpy)

Can you share the old syntax with the browser/tab issue too?
(2014-06-18, 10:45)pacooka Wrote: [ -> ]
(2014-04-27, 15:31)SomeAssembly Wrote: [ -> ]Wow! great add-on.

I have it working perfectly. I was already using Ispy on windows to monitor my security cameras, I turned on face on my front door camera and have Ispy send the string to XBMC on my main tv over the local network. Everything is working as expected, but the security server computer opens a browser window each time it sends the string to XBMC. I don't know how many windows/tabs it can open before it crashes out.

Does anyone have any suggestions as how to send the string without the browser opening? Or, how to close the browser/tab after each call? From Ispy I can execute a program or shortcut.

Did you find the right syntax? (iSpy)

Can you share the old syntax with the browser/tab issue too?

I have not as yet discovered how to use curl or any other tool to send this correctly but the old syntax I found in this thread that works is:

http://192.168.5.9:80/jsonrpc?request={"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.securitycam"},"id":"1"}}

You will need to adjust the IP address to match your systems. I don't have any problems running it but still can't get to send this without popping up a browser window.
I just created a shortcut with the address and call the shortcut from ISPY.

Hope this helps, let us know if you can make it work with curl.

SomeAssembly
Personally, I loved the addon, however I am having trouble finding a bell to send json command .... Someone tells me something? Call the camera when the bell rings
Awesome addon. You should post the code on github. I have done it now, but ille delete it once you do Smile
Hi Guys,

Frist of all Ausome addon.

Can this work with anything other than a IP cam. Say a live stream. What I want to do is to have a workaound for a PIP (Picture in Picture).

I tried to point the url at a live stream but i got an error.

thanks in advance

Code:
20:08:50 T:140304829114112  NOTICE: Thread XBPyThread start, auto delete: false
20:08:50 T:140304829114112   DEBUG: Python thread: start processing
20:08:50 T:140304829114112  NOTICE: -->Python Interpreter Initialized<--
20:08:50 T:140304829114112   DEBUG: Process - The source file to load is /storage/.xbmc/addons/script.securitycam/default.py
20:08:50 T:140304829114112   DEBUG: Process - Setting the Python path to /storage/.xbmc/addons/script.securitycam:/storage/.xbmc/addons/script.module.xbmcswift/lib:/storage/.xbmc/addons/script.module.pyamf/lib:/storage/.xbmc/addons/script.module.t0mm0.common/lib:/storage/.xbmc/addons/script.module.demjson/lib:/storage/.xbmc/addons/script.module.socksipy/lib:/storage/.xbmc/addons/script.module.chardet/lib:/storage/.xbmc/addons/script.module.simplejson/lib:/storage/.xbmc/addons/script.module.xmltodict/lib:/storage/.xbmc/addons/script.module.beautifulsoup4/lib:/storage/.xbmc/addons/script.module.addon.common/lib:/storage/.xbmc/addons/script.module.myconnpy/lib:/storage/.xbmc/addons/script.module.beautifulsoup/lib:/usr/share/xbmc/addons/script.module.pil/lib:/storage/.xbmc/addons/script.common.plugin.cache/lib:/storage/.xbmc/addons/script.module.simple.downloader/lib:/storage/.xbmc/addons/script.module.requests/lib:/storage/.xbmc/addons/script.module.axel.downloader/lib:/storage/.xbmc/addons/script.module.urlresolver/lib:/storage/.xbmc/addons/script.module.buggalo/lib:/storage/.xbmc/addons/script.module.letterscroll/lib/setup.py:/storage/.xbmc/addons/script.module.mechanize/lib:/storage/.xbmc/addons/script.module.parsedom/lib:/storage/.xbmc/addons/script.module.xbmcutil/lib:/storage/.xbmc/addons/script.module.xbmcswift2/lib:/storage/.xbmc/addons/script.module.elementtree/lib:/storage/.xbmc/addons/script.module.requests2/lib:/storage/.xbmc/addons/script.module.metahandler/lib:/usr/lib/python27.zip:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7/site-packages:/usr/lib/python2.7/site-packages/PIL:/usr/lib/python2.7/site-packages/gtk-2.0:
20:08:50 T:140304829114112   DEBUG: Process - Entering source directory /storage/.xbmc/addons/script.securitycam
20:08:50 T:140304829114112   DEBUG: Instantiating addon using automatically obtained id of "script.securitycam" dependent on version 2.1.0 of the xbmc.python api
20:08:50 T:140304829114112   DEBUG: script.securitycam: AutoClose: [True]
20:08:50 T:140304829114112   DEBUG: script.securitycam: Duration: [10000]
20:08:50 T:140304829114112   DEBUG: script.securitycam: Interval: [1000]
20:08:50 T:140304829114112   DEBUG: script.securitycam: Width: [240]
20:08:50 T:140304829114112   DEBUG: script.securitycam: Height: [240]
20:08:50 T:140304829114112   DEBUG: script.securitycam: Original URL: [http://livestre.am/3D8J]
20:08:50 T:140304829114112   DEBUG: script.securitycam: Final URL: [http://livestre.am/3D8J]
20:08:50 T:140304829114112   DEBUG: script.securitycam: CamPreviewDialog Initialized
20:08:50 T:140305562523456   DEBUG: ------ Window Init () ------
20:08:50 T:140304829114112   DEBUG: script.securitycam: CamPreviewDialog Started
20:08:50 T:140304829114112   DEBUG: script.securitycam: Retreiving Image
20:08:54 T:140304829114112   DEBUG: script.securitycam: Updating Image
20:08:54 T:140305562523456 WARNING: JpegIO: Error 55: Not a JPEG file: starts with 0x%02x 0x%02x
20:08:54 T:140305562523456   DEBUG: LoadFromFileInternal - Load of /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146934.28.jpg failed. Falling back to ImageLib
20:08:54 T:140305562523456    INFO:   msg: PICTURE::LoadImage: Unable to open image: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146934.28.jpg Error: (2)
20:08:54 T:140305562523456   ERROR: Texture manager unable to load file: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146934.28.jpg
20:08:55 T:140304829114112   DEBUG: script.securitycam: Retreiving Image
20:08:56 T:140304829114112   DEBUG: script.securitycam: Updating Image
20:08:56 T:140305562523456 WARNING: JpegIO: Error 55: Not a JPEG file: starts with 0x%02x 0x%02x
20:08:56 T:140305562523456   DEBUG: LoadFromFileInternal - Load of /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146936.39.jpg failed. Falling back to ImageLib
20:08:56 T:140305562523456    INFO:   msg: PICTURE::LoadImage: Unable to open image: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146936.39.jpg Error: (2)
20:08:56 T:140305562523456   ERROR: Texture manager unable to load file: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146936.39.jpg
20:08:57 T:140304829114112   DEBUG: script.securitycam: Retreiving Image
20:08:58 T:140304829114112   DEBUG: script.securitycam: Updating Image
20:08:58 T:140305562523456 WARNING: JpegIO: Error 55: Not a JPEG file: starts with 0x%02x 0x%02x
20:08:58 T:140305562523456   DEBUG: LoadFromFileInternal - Load of /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146938.65.jpg failed. Falling back to ImageLib
20:08:58 T:140305562523456    INFO:   msg: PICTURE::LoadImage: Unable to open image: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146938.65.jpg Error: (2)
20:08:58 T:140305562523456   ERROR: Texture manager unable to load file: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146938.65.jpg
20:08:59 T:140304829114112   DEBUG: script.securitycam: Retreiving Image
20:09:00 T:140305560106752   DEBUG: Suspended the Sink
20:09:00 T:140304829114112   DEBUG: script.securitycam: Updating Image
20:09:00 T:140305562523456 WARNING: JpegIO: Error 55: Not a JPEG file: starts with 0x%02x 0x%02x
20:09:00 T:140305562523456   DEBUG: LoadFromFileInternal - Load of /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146940.8.jpg failed. Falling back to ImageLib
20:09:00 T:140305562523456    INFO:   msg: PICTURE::LoadImage: Unable to open image: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146940.8.jpg Error: (2)
20:09:00 T:140305562523456   ERROR: Texture manager unable to load file: /storage/.xbmc/addons/script.securitycam/resources/media/snapshots/snapshot1407146940.8.jpg
20:09:01 T:140304829114112   DEBUG: script.securitycam: Delete remaining snapshot: [snapshot1407146940.8.jpg]
20:09:01 T:140304829114112    INFO: Scriptresult: Success
20:09:01 T:140304829114112    INFO: Python script stopped
20:09:01 T:140304829114112   DEBUG: Thread XBPyThread 140304829114112 terminating
20:09:01 T:140305562523456   DEBUG: waiting for python thread 22 (/storage/.xbmc/addons/script.securitycam/default.py) to stop
20:09:01 T:140305562523456   DEBUG: python thread 22 (/storage/.xbmc/addons/script.securitycam/default.py) destructed
20:09:02 T:140305562523456   DEBUG: ------ Window Deinit () ------
20:09:02 T:140305282090752   DEBUG: Thread Jobworker 140305282090752 terminating (autodelete)
20:09:31 T:140305562523456   DEBUG: SECTION:UnloadDelayed(DLL: special://xbmcbin/system/ImageLib-x86_64-linux.so)
20:09:31 T:140305562523456   DEBUG: Unloading: ImageLib-x86_64-linux.so
First thanks for your addon, it works like a charm except that you save snapshot in folder of the addon and it doesn't work in Win7/Win 8 because you need administrator privileges.
You need to use this line of code
Code:
xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile')).decode('utf-8') + 'img.jpg'

So it will save into the profile folder of the OS with good privilege. It is recommandation of addon development: see 4 Requirements for scripts and plugins here
(2014-08-13, 12:07)coolweb Wrote: [ -> ]First thanks for your addon, it works like a charm except that you save snapshot in folder of the addon and it doesn't work in Win7/Win 8 because you need administrator privileges.
You need to use this line of code
Code:
xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile')).decode('utf-8') + 'img.jpg'

So it will save into the profile folder of the OS with good privilege. It is recommandation of addon development: see 4 Requirements for scripts and plugins here

Thanks for the info coolweb. I've created a GitHub page for the script and included the updated snapshot storage location changes. Unfortunately, I haven't had a chance to test the code yet so if anyone can verify that it works I'd appreciate it.
I'm get this error using the git version

Code:
01:25:38 T:3928   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            SyntaxError: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            -->End of Python script error report<--
01:26:31 T:4168  NOTICE: Thread LanguageInvoker start, auto delete: false
01:26:31 T:4168  NOTICE: -->Python Interpreter Initialized<--
01:26:31 T:4168   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            SyntaxError: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            -->End of Python script error report<--
(2014-09-05, 08:30)warlion Wrote: [ -> ]I'm get this error using the git version

Code:
01:25:38 T:3928   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            SyntaxError: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            -->End of Python script error report<--
01:26:31 T:4168  NOTICE: Thread LanguageInvoker start, auto delete: false
01:26:31 T:4168  NOTICE: -->Python Interpreter Initialized<--
01:26:31 T:4168   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            SyntaxError: ('invalid syntax', ('C:\\Users\\Fernando\\AppData\\Roaming\\XBMC\\addons\\script.securitycam\\default.py', 14, 85, '__profile__  = xbmc.translatePath(__addon__.getAddonInfo(\'profile\')).encode("utf-8")).decode("utf-8")\n'))
                                            -->End of Python script error report<--

Thanks for the quick test warlion, I think it was just a dumb error on my part. I've updated the code in GitHub so please give it a shot again when you have the chance.
Thanks for the quick look ,
But still error, the app open but don't show anything it seems to have problem creating a folder

Code:
09:17:56 T:5724   ERROR: XFILE::CDirectory::GetDirectory - Error getting C:\Users\Fernando\AppData\Roaming\XBMC\userdata\addon_data\script.securitycam\script.securitycam\snapshot


Manually adding the folders (two) fix the problem, but why don't just add the jpg to the root of the data folder

I test again. It actually can't make the folder name script.securitycam I guess is the dot "." The one causing the problem
Or remove the second script.sec*** folder
(2014-09-05, 16:24)warlion Wrote: [ -> ]Thanks for the quick look ,
But still error, the app open but don't show anything it seems to have problem creating a folder

Code:
09:17:56 T:5724   ERROR: XFILE::CDirectory::GetDirectory - Error getting C:\Users\Fernando\AppData\Roaming\XBMC\userdata\addon_data\script.securitycam\script.securitycam\snapshot


Manually adding the folders (two) fix the problem, but why don't just add the jpg to the root of the data folder

I test again. It actually can't make the folder name script.securitycam I guess is the dot "." The one causing the problem
Or remove the second script.sec*** folder
I did remove the nested script.securitycam folder (didn't intend to include it in the first place). The reason for the snapshots subdirectory is for convenience of deleting old snapshots in the script.

The updated version is up on GitHub now along with a Frodo compatible branch.
Thanks iolaus works great thanks a lot
For me the Gotham version says improper structure and won't install.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20