This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
import xbmc, xbmcaddon | |
import json | |
def log(msg): | |
xbmc.log('GETADDONS TEST: ' + str(msg), level=xbmc.LOGDEBUG) | |
if ( __name__ == "__main__" ): | |
installedAddons = [] | |
installedJson = xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "id": 1, "method": "Addons.GetAddons", "params": { "type": "xbmc.gameclient", "enabled": "all" } }') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib2 | |
import base64 | |
def jsonrcp(): | |
username = 'u' | |
password = 'p' | |
ip = '192.168.1.122' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
from requests.auth import HTTPBasicAuth | |
import json | |
import webbrowser | |
from math import ceil | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function humanFileSize(bytes, pre, si) { | |
// Set default args | |
si = typeof si === 'undefined' ? true:false; | |
pre = typeof pre === 'undefined' ? 0:pre; | |
var thresh = si ? 1000 : 1024; | |
if(Math.abs(bytes) < thresh) { | |
return bytes.toFixed(pre) + ' B'; | |
} | |
var units = si |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import os | |
import subprocess | |
import sys | |
import time | |
from functools import wraps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
import plexpy | |
from plexpy import version | |
%> | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
from collections import Counter | |
from functools import wraps | |
import arrow | |
def timeme(func): | |
@wraps(func) | |
def inner(*args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import time | |
import platform | |
import subprocess | |
import urllib2 | |
import logging | |
""" Are we windoze or linux """ | |
is_windows = any(platform.win32_ver()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import json | |
def get_media_info(path, format='dict'): | |
""" Note this is media info cli """ | |
cmd = 'mediainfo "%s"' % (path) | |
process = subprocess.Popen(cmd, | |
shell=False, | |
stdin=subprocess.PIPE, | |
stdout=subprocess.PIPE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def convert_size(size, ): | |
if (size == 0): | |
return '0B' | |
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") | |
i = int(math.floor(math.log(size,1024))) | |
p = math.pow(1024,i) | |
s = round(size/p,2) | |
return '%s %s' % (s,size_name[i]) |
OlderNewer