コード例 #1
0
 def get_profile(self):
     profile_path = Addon.get_profile(self)
     if not os.path.exists(profile_path):
         import xbmcvfs
         try:
             xbmcvfs.mkdirs(profile_path)
         except:
             os.mkdir(profile_path)
     return profile_path
コード例 #2
0
import xbmc,xbmcgui
import os
import urllib, urllib2
import cookielib
import re
import jsunpack

''' Use addon.common library for http calls '''
from addon.common.net import Net
from addon.common.addon import Addon
net = Net()

addon = Addon('plugin.video.icefilms')
datapath = addon.get_profile()

cookie_path = os.path.join(datapath, 'cookies')

USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36'
ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'

def handle_captchas(url, html, data, dialog):

    headers = {'Referer': url}

    puzzle_img = os.path.join(datapath, "solve_puzzle.png")
    
    #Check for type of captcha used
    solvemedia = re.search('<iframe src="(http://api.solvemedia.com.+?)"', html)
    recaptcha = re.search('<script type="text/javascript" src="(http://www.google.com.+?)">', html)
    numeric_captcha = re.compile("left:(\d+)px;padding-top:\d+px;'>&#(.+?);<").findall(html)    
コード例 #3
0
ファイル: resolvers.py プロジェクト: tommy1976/icefilms-addon
import xbmc,xbmcgui
import os
import urllib, urllib2
import cookielib
import re
import jsunpack

''' Use addon.common library for http calls '''
from addon.common.net import Net
from addon.common.addon import Addon
net = Net()

addon = Addon('plugin.video.icefilms')
datapath = addon.get_profile()

cookie_path = os.path.join(datapath, 'cookies')

USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36'
ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'

def handle_captchas(url, html, data, dialog):

    headers = {'Referer': url}

    puzzle_img = os.path.join(datapath, "solve_puzzle.png")
    
    #Check for type of captcha used
    solvemedia = re.search('<iframe src="(http://api.solvemedia.com.+?)"', html)
    recaptcha = re.search('<script type="text/javascript" src="(http://www.google.com.+?)">', html)
    numeric_captcha = re.compile("left:(\d+)px;padding-top:\d+px;'>&#(.+?);<").findall(html)    
コード例 #4
0
ファイル: default.py プロジェクト: jas0npc/kodi
from addon.common.addon import Addon
from metahandler import metahandlers


addon_id = 'plugin.video.mutttsnutz'
addon = Addon(addon_id, sys.argv)
Addon = xbmcaddon.Addon(addon_id)

try:
    import StorageServer
except:
    import storageserverdummy as StorageServer
cache = StorageServer.StorageServer(addon_id)

cookie_path = os.path.join( xbmc.translatePath( addon.get_profile()), 'cookies' )
cookie_jar = os.path.join( cookie_path , 'cookiejar.lwp')

try:
    os.makedirs(os.path.dirname(cookie_jar))
except OSError:
    pass

baseUrl = 'http://m.afdah.org'
url = addon.queries.get('url', '')
name = addon.queries.get('name', '')
year = addon.queries.get('year', '')
mode = addon.queries.get('mode', '')
img = addon.queries.get('img', '')
fanart = addon.queries.get('fanart', '')
imdb = addon.queries.get('imdb', '')
コード例 #5
0
try: 			from addon.common.addon 				import Addon
except:
	try: 		from t0mm0.common.addon 				import Addon
	except: 
		try: from c_t0mm0_common_addon 				import Addon
		except: pass
addon_id="service.lan.ftp"
addon_name="FTP [B]HUB[/B][I] - FTP Server[/I]"
try: 		addon=Addon(addon_id,sys.argv); 
except: 
	try: addon=Addon(addon_id,addon.handle); 
	except: addon=Addon(addon_id,0); 
plugin=xbmcaddon.Addon(id=addon_id); 
print "%s @ %s" % (addon_name,addon_id)
addonPath=xbmc.translatePath(plugin.getAddonInfo('path'))
try:		datapath 		=xbmc.translatePath(addon.get_profile()); 
except: datapath 		=""
try: 		_artIcon		=addon.get_icon(); 
except: _artIcon		=""
try: 		_artFanart	=addon.get_fanart()
except: _artFanart	=""
#_artMessage=xbmc.translatePath(os.path.join(addonPath,"msg.png"))
_artPath		=xbmc.translatePath(os.path.join(addonPath,"art"))
# ===================================================================
# --- Common Functions
# ===================================================================
def addstv(id,value=''): addon.addon.setSetting(id=id,value=value) ## Save Settings
def addst(r,s=''): return addon.get_setting(r)   ## Get Settings
def addpr(r,s=''): return addon.queries.get(r,s) ## Get Params
def tfalse(r,d=False): ## Get True / False
	if   (r.lower()=='true' ) or (r.lower()=='t') or (r.lower()=='y') or (r.lower()=='1') or (r.lower()=='yes'): return True
コード例 #6
0
import sys

from addon.common.addon import Addon
from metahandler import metahandlers

addon_id = 'plugin.video.mutttsnutz'
addon = Addon(addon_id, sys.argv)
Addon = xbmcaddon.Addon(addon_id)

try:
    import StorageServer
except:
    import storageserverdummy as StorageServer
cache = StorageServer.StorageServer(addon_id)

cookie_path = os.path.join(xbmc.translatePath(addon.get_profile()), 'cookies')
cookie_jar = os.path.join(cookie_path, 'cookiejar.lwp')

try:
    os.makedirs(os.path.dirname(cookie_jar))
except OSError:
    pass

baseUrl = 'http://m.afdah.org'
url = addon.queries.get('url', '')
name = addon.queries.get('name', '')
year = addon.queries.get('year', '')
mode = addon.queries.get('mode', '')
img = addon.queries.get('img', '')
fanart = addon.queries.get('fanart', '')
imdb = addon.queries.get('imdb', '')
コード例 #7
0
ファイル: axelcommon.py プロジェクト: bialagary/mw
def we_are_frozen():
    # All of the modules are built-in to the interpreter, e.g., by py2exe
    return hasattr(sys, "frozen")

def module_path():
    encoding = sys.getfilesystemencoding()
    if we_are_frozen():
        return os.path.dirname(unicode(sys.executable, encoding))
    return os.path.dirname(unicode(__file__, encoding))

try:
    addon_id = 'script.module.axel.downloader'
    from addon.common.addon import Addon
    addon = Addon('script.module.axel.downloader')
    addon_path = addon.get_path()
    profile_path = addon.get_profile()
    addon_version = addon.get_version()
except:
    profile_path=module_path()

def log(msg,n=0):
    if addon:
        addon.log(msg,n)
        #xbmc.log('%s: %s' % (addon_id, msg), n)
    else:
        print msg
    

#Create queue objects
class _Singleton(type):
    _instances = {}
コード例 #8
0
    from addon.common.net import Net
except:
    print 'Failed to import script.module.addon.common'
    xbmcgui.Dialog().ok("PFTV Import Failure", "Failed to import addon.common", "A component needed by PFTV is missing on your system", "Please visit www.xbmchub.com for support")

net = Net()
addon = Addon('plugin.video.solarmovie', sys.argv)

try:
    from metahandler import metahandlers
except:
    print 'Failed to import script.module.metahandler'
    xbmcgui.Dialog().ok("PFTV Import Failure", "Failed to import Metahandlers", "A component needed by PFTV is missing on your system", "Please visit www.xbmchub.com for support")


DB = os.path.join(addon.get_profile(), 'solarmovie.db')
BASE_URL = 'http://www.solarmovie.so'


enableMeta = True
if addon.get_setting('enableMeta') == 'false':
        enableMeta = False

GENRES = ['Action', 'Adventure', 'Animation', 'Biography', 'Comedy', 
          'Crime', 'Documentary', 'Drama', 'Family', 'Fantasy', 'Film-Noir', 'Game-Show'
          'History', 'Horror', 'Music', 'Musical', 
          'Mystery', 'News', 'Reality-TV', 'Romance', 'Sci-Fi', 'Short', 'Sport', 'Talk-Show'
          'Thriller', 'War', 'Western']

##### Queries ##########
mode = addon.queries['mode']
コード例 #9
0
ファイル: resolve.py プロジェクト: AiWABR/xxtrucoxx-repo
import os,re,sys,urllib,cookielib,urllib2,xbmcgui,xbmcplugin
from addon.common.net import Net
from addon.common.addon import Addon

addon = Addon('plugin.video.xxtrucoxx', sys.argv)

cookie_file = os.path.join(addon.get_profile(), 'bu.cookies')

net = Net()


MAX_TRIES = 4

            
class billionuploads:
    def __init__(self, url, img):
        print 'Class billion url'

        cj = cookielib.LWPCookieJar()
        if os.path.exists(cookie_file):
            try:
                cj.load(cookie_file,True)
            except:
                cj.save(cookie_file,True)
        else:
            cj.save(cookie_file,True)

        normal = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
        headers = [
            ('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0'),
            ('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),
コード例 #10
0
ファイル: common.py プロジェクト: uguer30/Project
"""
    metahandler XBMC Addon
    Copyright (C) 2012 Eldorado

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

import os    
from addon.common.addon import Addon

addon = Addon('script.module.metahandler')
addon_path = addon.get_path()
profile_path = addon.get_profile()
settings_file = os.path.join(addon_path, 'resources', 'settings.xml')
addon_version = addon.get_version()
コード例 #11
0
### ############################################################################################################
### ############################################################################################################
### ############################################################################################################

### ############################################################################################################
### ############################################################################################################
### ############################################################################################################
### Plugin Settings ###

IW_addon = Addon('plugin.video.infowars', sys.argv)
addon = IW_addon
IW_domain_url = "infowars.com"
IW_addonPath = xbmc.translatePath('Infowars')
IW_addon_path_art = ""
IW_artPath = xbmc.translatePath(os.path.join(IW_addonPath, IW_addon_path_art))
IW_datapath = xbmc.translatePath(IW_addon.get_profile())
IW_artIcon = IW_addon.get_icon()
IW_artFanart = IW_addon.get_fanart()
IW_plugin = "Infowars"
IW_authors = "Prafit, Spinalcracker"
IW_credits = ""
IW_addon_id = "plugin.video.infowars"
IW_database_name = "infowars"
IW_plugin_id = "plugin.video.infowars"
IW_database_file = os.path.join(xbmc.translatePath("special://database"),
                                'infowars.db')
IW_debugging = False
AJSIcon = "https://imgur.com/YYl3GFe.png"
DKSIcon = "https://assets.infowarsmedia.com/images/15084c28-71d4-456f-b587-7b66f73c7ede-large.png"
DKSFanart = "https://assets.infowarsmedia.com/images/203cf9b2-f811-4802-bfb4-441b2e864a7c-large.png"
WarRoomIcon = "https://static.infowars.com/images/war-room-logo-white.png"
コード例 #12
0
ファイル: default.py プロジェクト: Spinalcracker/infowars
### ############################################################################################################



### ############################################################################################################
### ############################################################################################################
### ############################################################################################################
### Plugin Settings ###

IW_addon=Addon('plugin.video.infowars', sys.argv); addon=IW_addon; 
addon=IW_addon; 
IW_domain_url="infowars.com"
IW_addonPath	=xbmc.translatePath('Infowars')
IW_addon_path_art= ""
IW_artPath		=xbmc.translatePath(os.path.join(IW_addonPath,IW_addon_path_art))
IW_datapath 	=xbmc.translatePath(IW_addon.get_profile()); 
IW_artIcon		=IW_addon.get_icon(); 
IW_artFanart	=IW_addon.get_fanart()
IW_plugin = "Infowars"
IW_authors = "Prafit, Spinalcracker"
IW_credits= ""
IW_addon_id="plugin.video.infowars"
IW_database_name="infowars"
IW_plugin_id= "plugin.video.infowars"
IW_database_file=os.path.join(xbmc.translatePath("special://database"),'infowars.db'); 
IW_debugging= False
AJSIcon = "https://static.infowars.com/images/alex-jones-frontal.jpg"
RNWDKIcon = "https://static.infowars.com/images/real-news-logo.png"
RNWDKFanart = "https://static.infowars.com/images/real-news-with-david-knight.jpg"
WarRoomIcon = "https://static.infowars.com/images/war-room-logo.png"
WarRoomFanart = "https://static.infowars.com/images/war-room-studio.jpg"
コード例 #13
0
ファイル: resolve.py プロジェクト: kevintone/tdbaddon
import os, re, sys, urllib, cookielib, urllib2, xbmcgui, xbmcplugin
from addon.common.net import Net
from addon.common.addon import Addon

addon = Addon('plugin.video.xxtrucoxx', sys.argv)

cookie_file = os.path.join(addon.get_profile(), 'bu.cookies')

net = Net()

MAX_TRIES = 4


class billionuploads:
    def __init__(self, url, img):
        print 'Class billion url'

        cj = cookielib.LWPCookieJar()
        if os.path.exists(cookie_file):
            try:
                cj.load(cookie_file, True)
            except:
                cj.save(cookie_file, True)
        else:
            cj.save(cookie_file, True)

        normal = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
        headers = [
            ('User-Agent',
             'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0'
             ),
コード例 #14
0
        "A component needed by PFTV is missing on your system",
        "Please visit www.xbmchub.com for support")

net = Net()
addon = Addon('plugin.video.solarmovie', sys.argv)

try:
    from metahandler import metahandlers
except:
    print 'Failed to import script.module.metahandler'
    xbmcgui.Dialog().ok(
        "PFTV Import Failure", "Failed to import Metahandlers",
        "A component needed by PFTV is missing on your system",
        "Please visit www.xbmchub.com for support")

DB = os.path.join(addon.get_profile(), 'solarmovie.db')
BASE_URL = 'http://www.solarmovie.so'

enableMeta = True
if addon.get_setting('enableMeta') == 'false':
    enableMeta = False

GENRES = [
    'Action', 'Adventure', 'Animation', 'Biography', 'Comedy', 'Crime',
    'Documentary', 'Drama', 'Family', 'Fantasy', 'Film-Noir', 'Game-Show'
    'History', 'Horror', 'Music', 'Musical', 'Mystery', 'News', 'Reality-TV',
    'Romance', 'Sci-Fi', 'Short', 'Sport', 'Talk-Show'
    'Thriller', 'War', 'Western'
]

##### Queries ##########