Exemplo n.º 1
0
def art(filename):
    adn = Addon("plugin.video.1channel", sys.argv)
    THEME_LIST = ["mikey1234", "Glossy_Black"]
    THEME = THEME_LIST[int(adn.get_setting("theme"))]
    THEME_PATH = os.path.join(adn.get_path(), "art", "themes", THEME)
    img = os.path.join(THEME_PATH, filename)
    return img
Exemplo n.º 2
0
def art(filename):
    adn = Addon('plugin.video.1channel', sys.argv)
    THEME_LIST = ['mikey1234', 'Glossy_Black']
    THEME = THEME_LIST[int(adn.get_setting('theme'))]
    THEME_PATH = os.path.join(adn.get_path(), 'art', 'themes', THEME)
    img = os.path.join(THEME_PATH, filename)
    return img
def art(file):
    adn = Addon('plugin.video.1channel', sys.argv)
    THEME_LIST = ['mikey1234','Glossy_Black']
    THEME = THEME_LIST[int(adn.get_setting('theme'))]
    THEME_PATH = os.path.join(adn.get_path(), 'art', 'themes', THEME)
    img = os.path.join(THEME_PATH, file)
    return img
Exemplo n.º 4
0
import os
import re
import sys
import xbmc
import xbmcgui
import xbmcplugin

# from functools import wraps

from t0mm0.common.addon import Addon

_1CH = Addon('plugin.video.1channel', sys.argv)

try:
    DB_NAME = _1CH.get_setting('db_name')
    DB_USER = _1CH.get_setting('db_user')
    DB_PASS = _1CH.get_setting('db_pass')
    DB_ADDR = _1CH.get_setting('db_address')

    if _1CH.get_setting('use_remote_db') == 'true' and \
                    DB_ADDR is not None and \
                    DB_USER is not None and \
                    DB_PASS is not None and \
                    DB_NAME is not None:
        import mysql.connector as orm

        _1CH.log('Loading MySQL as DB engine')
        DB = 'mysql'
    else:
        _1CH.log('MySQL not enabled or not setup correctly')
        raise ValueError('MySQL not enabled or not setup correctly')
Exemplo n.º 5
0
import os
import re
import sys
import urllib
import urllib2
import HTMLParser
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon

addon = Addon('plugin.video.1channel', sys.argv)
BASE_URL = addon.get_setting('domain')
if ((addon.get_setting("enableDomain"))
        == 'true') and (len(addon.get_setting("customDomain")) > 10):
    BASE_URL = addon.get_setting("customDomain")
display_name = 'PrimeWire'
required_addons = []
tag = 'PWr'


def get_settings_xml():
    return False


def get_results(vid_type, title, year, imdb, tvdb, season, episode):
    if vid_type == 'movie':
        return Search('movies', title, imdb)
    elif vid_type == 'tvshow':
        return _get_tvshows(title, year, imdb, tvdb)
    elif vid_type == 'season':
        return _get_season(title, year, imdb, tvdb, season)
    elif vid_type == 'episode':
Exemplo n.º 6
0
import xbmcvfs
import xbmcgui
import config

plugin_id = config.plugin_id
skin_id = config.skin_id


addon = Addon(plugin_id)
addon_path = addon.get_path()

default_path = 'special://profile/addon_data/'+plugin_id+'/'
db_path = os.path.join(xbmc.translatePath("special://database"), 'myvideolibrary')


use_remote_db = addon.get_setting('use_remote_db')
db_address = addon.get_setting('db_address')
db_port = addon.get_setting('db_port')
if db_port: db_address = '%s:%s' %(db_address,db_port)
db_user = addon.get_setting('db_user')
db_pass = addon.get_setting('db_pass')
db_name = addon.get_setting('db_name')


def make_dir(mypath, dirname):
    ''' Creates sub-directories if they are not found. '''
    subpath = os.path.join(mypath, dirname)
    if not xbmcvfs.exists(subpath): 
        try:
            xbmcvfs.mkdirs(subpath)
        except:
Exemplo n.º 7
0
import xbmc
import xbmcvfs
import re

from t0mm0.common.addon import Addon

addon_identifier = 'script.module.watchhistory'
addon = None
if len(sys.argv) < 2:
    addon = Addon(addon_identifier)
else:
    addon = Addon(addon_identifier, sys.argv)
addon_path = addon.get_path()

try:
    if  addon.get_setting('use_remote_db')=='true' and   \
        addon.get_setting('db_address') is not None and  \
        addon.get_setting('db_user') is not None and     \
        addon.get_setting('db_pass') is not None and     \
        addon.get_setting('db_name') is not None:
        import mysql.connector as database
        addon.log('Loading MySQLdb as DB engine', 2)
        DB = 'mysql'
    else:
        raise ValueError('MySQL not enabled or not setup correctly')
except:
    try: 
        import sqlite3
        from sqlite3 import dbapi2 as database
        addon.log('Loading sqlite3 as DB engine version: %s' % database.sqlite_version, 2)
    except Exception, e:
Exemplo n.º 8
0
import os
import Queue
import sys
import threading
import time
import xbmc
import xbmcgui
from t0mm0.common.addon import Addon
from metahandler import metahandlers

addon = Addon('plugin.video.1channel', sys.argv)
try:
    DB_NAME = addon.get_setting('db_name')
    DB_USER = addon.get_setting('db_user')
    DB_PASS = addon.get_setting('db_pass')
    DB_ADDRESS = addon.get_setting('db_address')

    if  addon.get_setting('use_remote_db')=='true' and \
     DB_ADDRESS is not None and \
     DB_USER    is not None and \
     DB_PASS    is not None and \
     DB_NAME    is not None:
        import mysql.connector as database
        addon.log('Loading MySQL as DB engine')
        DB = 'mysql'
    else:
        addon.log('MySQL not enabled or not setup correctly')
        raise ValueError('MySQL not enabled or not setup correctly')
except:
    try:
        from sqlite3 import dbapi2 as database
Exemplo n.º 9
0
import os
import Queue
import sys
import threading
import time
import xbmc
import xbmcgui
from t0mm0.common.addon import Addon
from metahandler import metahandlers

addon = Addon("plugin.video.1channel", sys.argv)
try:
    DB_NAME = addon.get_setting("db_name")
    DB_USER = addon.get_setting("db_user")
    DB_PASS = addon.get_setting("db_pass")
    DB_ADDRESS = addon.get_setting("db_address")

    if (
        addon.get_setting("use_remote_db") == "true"
        and DB_ADDRESS is not None
        and DB_USER is not None
        and DB_PASS is not None
        and DB_NAME is not None
    ):
        import mysql.connector as database

        addon.log("Loading MySQL as DB engine")
        DB = "mysql"
    else:
        addon.log("MySQL not enabled or not setup correctly")
        raise ValueError("MySQL not enabled or not setup correctly")
Exemplo n.º 10
0
import sys
import json
import gzip
import urllib2
import xbmcplugin
from StringIO import StringIO

from t0mm0.common.addon import Addon
addon = Addon('plugin.video.waldo', sys.argv)
api_key = addon.get_setting('Rtn_api_key')

display_name = 'Rotten Tomatoes'
#Label that will be displayed to the user representing this index

tag = 'Rtn'
#MUST be implemented. Unique 3 or 4 character string that will be used to
#identify this index

required_addons = []
#MUST be implemented. A list of strings indicating which addons are required to
#be installed for this index to be used.
#For example: required_addons = ['script.module.beautifulsoup', 'plugin.video.youtube']
#Currently, xbmc does not provide a way to require a specific version of an addon

def get_settings_xml():
    '''
    Must be defined. This method should return XML which describes any Waldo
    specific settings you would like for your plugin. You should make sure that
    the ``id`` starts with your tag followed by an underscore.
    
    For example:
Exemplo n.º 11
0
from t0mm0.common.addon import Addon
import xbmc
import xbmcvfs
import xbmcgui

plugin_id = 'plugin.video.mvl.play'
skin_id = 'skin.mvl.play'

addon = Addon(plugin_id)
addon_path = addon.get_path()

default_path = 'special://profile/addon_data/' + plugin_id + '/'
db_path = os.path.join(xbmc.translatePath("special://database"),
                       'myvideolibrary')

use_remote_db = addon.get_setting('use_remote_db')
db_address = addon.get_setting('db_address')
db_port = addon.get_setting('db_port')
if db_port: db_address = '%s:%s' % (db_address, db_port)
db_user = addon.get_setting('db_user')
db_pass = addon.get_setting('db_pass')
db_name = addon.get_setting('db_name')


def make_dir(mypath, dirname):
    ''' Creates sub-directories if they are not found. '''
    subpath = os.path.join(mypath, dirname)
    if not xbmcvfs.exists(subpath):
        try:
            xbmcvfs.mkdirs(subpath)
        except:
Exemplo n.º 12
0
import urllib2
import xbmc, xbmcaddon, xbmcplugin, xbmcgui

from t0mm0.common.addon import Addon
from t0mm0.common.net import Net
from bs4 import BeautifulSoup

addon_id = 'plugin.video.watchwrestling'

net = Net(user_agent='Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36')
headers = {
    'Accept'    :   'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
    }
addon = Addon(addon_id, sys.argv)

BASEURL = addon.get_setting("srcweb")

#PATHS
AddonPath = addon.get_path()
IconPath = os.path.join(AddonPath, 'icons')

from universal import _common as univ_common
from universal import watchhistory, playbackengine

mode = addon.queries['mode']
url = addon.queries.get('url', '')
title = addon.queries.get('title', 'Watch Wrestling ( watchwrestling.ch )')
img = addon.queries.get('img', os.path.join(IconPath, 'icon.jpg'))
section = addon.queries.get('section', '')
page = addon.queries.get('page', '')
mediaid = addon.queries.get('mediaid', '')
Exemplo n.º 13
0

addon = Addon('plugin.video.solarmovie', sys.argv)
cm = ContextMenu(addon)
net = Net()
net.set_user_agent('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; yie9)')

base_url = 'http://www.solarmovie.eu'
mode = addon.queries['mode']
play = addon.queries.get('play', None)

solarpath = addon.get_path()
smallimage = os.path.join(xbmc.translatePath(solarpath), \
                          'art','logo_in_gold_black.jpg')

numpages = numpagesindex[addon.get_setting('numpages')]
maxlinks = int(addon.get_setting('maxlinks'))
hideadult = addon.get_setting('hideadult')
enableproxy = addon.get_setting('proxy_enable')
proxyserver = addon.get_setting('proxy_server')
proxyport = addon.get_setting('proxy_port')
proxyuser = addon.get_setting('proxy_user')
proxypass = addon.get_setting('proxy_pass')


if enableproxy == 'true':
    proxy = 'http://'
    if proxyuser:
        proxy = '%s%s:%s@%s:%s' %(proxy, proxyuser, proxypass,
                                  proxyserver, proxyport)
    else:
Exemplo n.º 14
0
from metahandler import metahandlers
from metahandler import metacontainers
import metapacks
import playback

try:
	from sqlite3 import dbapi2 as sqlite
	print "Loading sqlite3 as DB engine"
except:
	from pysqlite2 import dbapi2 as sqlite
	print "Loading pysqlite2 as DB engine"

addon = Addon('plugin.video.1channel', sys.argv)
DB = os.path.join(xbmc.translatePath("special://database"), 'onechannelcache.db')

META_ON = addon.get_setting('use-meta') == 'true'
FANART_ON = addon.get_setting('enable-fanart') == 'true'
USE_POSTERS = addon.get_setting('use-posters') == 'true'
POSTERS_FALLBACK = addon.get_setting('posters-fallback') == 'true'
THEME_LIST = ['mikey1234','Glossy_Black']
THEME = THEME_LIST[int(addon.get_setting('theme'))]
THEME_PATH = os.path.join(addon.get_path(), 'art', 'themes', THEME)
AUTO_WATCH = addon.get_setting('auto-watch') == 'true'

AZ_DIRECTORIES = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z']
BASE_URL = 'http://www.1channel.ch'
USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
GENRES = ['Action', 'Adventure', 'Animation', 'Biography', 'Comedy', 
          'Crime', 'Documentary', 'Drama', 'Family', 'Fantasy', 'Game-Show', 
          'History', 'Horror', 'Japanese', 'Korean', 'Music', 'Musical', 
          'Mystery', 'Reality-TV', 'Romance', 'Sci-Fi', 'Short', 'Sport', 
Exemplo n.º 15
0
import urlresolver
import time

from t0mm0.common.addon import Addon
from BeautifulSoup import BeautifulSoup

#TODO :
#1. images needs to created
#2. migrate_to_mysql needs to tested.

addon_name = "bharat"

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

try:
    DB_NAME = addon.get_setting('db_name')
    DB_USER = addon.get_setting('db_user')
    DB_PASS = addon.get_setting('db_pass')
    DB_ADDRESS = addon.get_setting('db_address')

    if  addon.get_setting('use_remote_db')=='true' and \
        DB_ADDRESS is not None and \
        DB_USER    is not None and \
        DB_PASS    is not None and \
        DB_NAME    is not None:
        import mysql.connector as database
        addon.log('Loading MySQL as DB engine')
        DB = 'mysql'
    else:
        addon.log('MySQL not enabled or not setup correctly')
        raise ValueError('MySQL not enabled or not setup correctly')
class CraftsyPlugin():
    addon = None
    net = None
    logo = None
    profile_path = None
    cookie_file = None
    base_url = None
    free_url = 'http://www.craftsy.com.edgesuite.net/'
    pay_url = 'http://cd1.craftsy.com/'

    def __init__(self):
        self.addon = Addon('plugin.video.craftsy', sys.argv)
        self.net = Net()

        self.logo = os.path.join(self.addon.get_path(), 'art','logo.jpg')

        self.profile_path = self.addon.get_profile()
        self.cookie_file = os.path.join(self.profile_path, 'craftsy.cookies')

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

        self.net.set_cookies(self.cookie_file)
        self.base_url = 'http://www.craftsy.com'

    def __get_image(self, url):
        fname = os.path.join(self.profile_path, md5.new(url).digest())
        print fname
        if os.path.isfile(fname):
            return fname
        return url

    def __check_link(self, url):
        if (re.match('^/', url)):
            return 'http:' + url
        return url

    def __fetch_regexp_idx(self, r, idx, default = None):
        if (r == None):
            return default
        if (len(r.groups()) < idx + 1):
            return default

        return r.groups()[idx]

    def check_login(self):
        source = self.net.http_GET(self.base_url + '/my/home?NAVIGATION_PAGE_CONTEXT_ATTR=NONE').content
        r = re.search('<title>([^<]+)</title>', source)
        title = r.groups()[0]
        
        if title == 'Welcome Back to Craftsy!':
            return False
        return True

    def __get_url(self, url):
        return self.net.http_GET(url).content.encode('utf8').replace("\n", "").replace("\r", "")

    def add_classes(self):
        source = self.__get_url(self.base_url + '/my/home?NAVIGATION_PAGE_CONTEXT_ATTR=NONE')
        source = re.sub('<div class="classCard mostRecent".*?</div>.*?</div>.*?</div>.*?</div>', '', source)
        source = re.sub('<div class="continueArea".*?</div>.*?</div>', '', source)
        # parts = re.split('<div class="classBot myClassBot">', source)
        r = re.findall('<a href="(/lecture[^\"]+)"(.*?)</a>[ \s\t]*<div class="classBot myClassBot">.*?<a href="([^"]+)"', source)
        for i in r:
            url = i[2]
            if (re.match('^/', url)):
                url = self.base_url + url
            t = re.search('<h4>([^<]+)</h4>', i[1])
            title = 'N/A'
            title = self.__fetch_regexp_idx(t, 0, 'N/A')
            img = self.base_url + '/images/craftsy/noImageTitleCard.png'
            t = re.search('<img src="([^"]+)" alt="[^"]+" onerror', i[1])
            _u = self.__fetch_regexp_idx(t, 0)
            if (_u != None):
                img = self.__check_link(_u)

            # print self.__get_image(img)
            self.addon.add_directory({'mode': 'classes', 'url': url}, {'title': title}, fanart=img, img=img)

    def __try_resolve(self, pattern, video):
        r = re.search(pattern, video)
        return self.__fetch_regexp_idx(r, 0)

    def resolve_url(self, lesson_url):
        pattern = '&([0-9]+)&(pay|free)$'
        l = re.search(pattern, lesson_url)
        lesson_id = self.__fetch_regexp_idx(l, 0)
        lesson_type = self.__fetch_regexp_idx(l, 1, 'pay')
        lesson_url = re.sub(pattern, '', lesson_url)

        q = self.addon.get_setting('quality')
        t = self.addon.get_setting('type')

        source = self.__get_url(lesson_url)

        uid = re.search('/([0-9]+)\\.html(\\?t=[0-9]*){0,1}$', lesson_url)
        url_id = self.__fetch_regexp_idx(uid, 0)
        if (url_id == None):
            return None

        r = re.search('arbitraryId = ([0-9]+),', source)
        arbitraryId = self.__fetch_regexp_idx(r, 0)
        if (arbitraryId != None):
            url_id = arbitraryId

        suffix = lesson_id + '/' + url_id + '/' + url_id + '-' + q + '.' + t
        if lesson_type == 'free':
            print "THE URL TO PLAY IS " + self.free_url + suffix
            return self.free_url + suffix
        else:
            return self.pay_url + suffix

        # r = re.search('(<video.*?</video>)', source)

        # if (len(r.groups()) == 0):
        #     return None
        # else:
        #     video = r.groups()[0]
        #     video_url = self.__try_resolve('<source src="([^"]+-' + q + '\\.' + t + ')"', video)
        #     if (video_url == None):
        #         video_url = self.__try_resolve('<source src="([^"]+-' + q + '\\.[^\\.]+)"', video)
        #         if (video_url == None):
        #             video_url = self.__try_resolve('<source src="([^"]+)"', video)

        #     return video_url


    def add_lessons(self, class_url):
        source = self.__get_url(class_url) # self.net.http_GET(class_url).content
        l = re.search('\,([0-9]+)$', class_url)
        lesson_id = self.__fetch_regexp_idx(l, 0)
        if (lesson_id == None):
            self.addon.show_error_dialog(['Could not fetch the lesson ID']);
            return None
        r = re.findall('(<tr class="classLesson.*?</tr>)', source)
        first = True
        lesson_type = 'pay'
        for i in r:
            text = i 
            el = re.search('<td class="lessonName">.*?<a href="([^"]+)">(.*?)</a>', text)
            href = self.__fetch_regexp_idx(el, 0)
            if href != None:
                href = self.__check_link(href)
                title = self.__fetch_regexp_idx(el, 1, 'N/A')
                if (first):
                    if (title.lower() == 'welcome to your free mini-class!'):
                        lesson_type = 'free'
                im = re.search('<td class="lessonImage">.*?<img src="([^"]+)"', text)
                img = self.__check_link(self.__fetch_regexp_idx(im, 0, os.path.join(self.addon.get_path(), 'art','no-img.jpg')))

                self.addon.add_video_item({'url': href + '&' + lesson_id + '&' + lesson_type}, {'title': title}, img = img, fanart = img)
            first = False

    def do_login(self):
        try:
            if self.check_login():
                return True
            data=(('email', self.addon.get_setting('username')), ('password', self.addon.get_setting('password')), ('forwardUrl', '/'))
            source = self.net.http_POST(self.base_url + '/doLogin.json?isCraftsyAjax=true', data).content
            response = JSONDecoder().decode(source)
            self.net.save_cookies(self.cookie_file)
            self.net.set_cookies(self.cookie_file)
            return response.get("success")
        except Exception as e:
            print e
            return False
Exemplo n.º 17
0
import os
import re
import sys
import urllib
import urllib2
import HTMLParser
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon

addon = Addon('plugin.video.1channel', sys.argv)
BASE_URL = addon.get_setting('domain')
if ((addon.get_setting("enableDomain"))=='true') and (len(addon.get_setting("customDomain")) > 10):
	BASE_URL=addon.get_setting("customDomain")
display_name = 'PrimeWire'
required_addons = []
tag = 'PWr'


def get_settings_xml():
    return False


def get_results(vid_type, title, year, imdb, tvdb, season, episode):
    if vid_type == 'movie':
        return Search('movies', title, imdb)
    elif vid_type == 'tvshow':
        return _get_tvshows(title, year, imdb, tvdb)
    elif vid_type == 'season':
        return _get_season(title, year, imdb, tvdb, season)
    elif vid_type == 'episode':
        return _get_episodes(title, year, imdb, tvdb, season, episode)
Exemplo n.º 18
0
    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 t0mm0.common.addon import Addon
import xbmc
import xbmcvfs
import xbmcgui

addon = Addon('plugin.video.movie25-mod')
addon_path = addon.get_path()

default_path = 'special://profile/addon_data/plugin.video.movie25/Universal'

db_path = addon.get_setting('local_save_location')
use_remote_db = addon.get_setting('use_remote_db')
db_address = addon.get_setting('db_address')
db_port = addon.get_setting('db_port')
if db_port: db_address = '%s:%s' %(db_address,db_port)
db_user = addon.get_setting('db_user')
db_pass = addon.get_setting('db_pass')
db_name = addon.get_setting('db_name')

def make_dir(mypath, dirname):
    ''' Creates sub-directories if they are not found. '''
    subpath = os.path.join(mypath, dirname)
    if not xbmcvfs.exists(subpath): 
        try:
            xbmcvfs.mkdirs(subpath)
        except:
Exemplo n.º 19
0
    

elif mode == 'tvseasons':
    print 'tvseasons'
    
    sh = re.sub(' ', '%20', show)
    html = net.http_GET(url).content
    
    match = re.compile('<h2 class="lists"><a href="(.+?)">(.+?)  (.+?)</a> - ').findall(html)

    try:
        imdb_id = re.compile('<a href="http://www.imdb.com/title/(.+?)/" target="_blank">IMDB</a>', re.DOTALL).findall(html)[0]
    except:
        imdb_id = ''
        
    if addon.get_setting('usemetadata') == 'true':
        if imdb_id != '':
            arthtml = net.http_GET('http://www.thetvdb.com/api/GetSeriesByRemoteID.php?imdbid='+imdb_id).content
        else:
            arthtml = net.http_GET('http://www.thetvdb.com/api/GetSeries.php?seriesname='+sh).content

    try:
        seriesid = re.compile('<seriesid>(.+?)</seriesid>').findall(arthtml)[0]
    except:
        seriesid = ''

    seasons = re.compile('<h2 class="lists"><a href=".+?">Season ([0-9]+)  .+?</a> -').findall(html)
    num = 0
    for link, season, episodes in match:
        if not seriesid: crap = {'mode': 'tvepisodes', 'url': link, 'section': 'tvshows', 'imdb_id': imdb_id, 'season': num + 1}
        else: crap = {'mode': 'tvepisodes', 'url': link, 'section': 'tvshows', 'imdb_id': imdb_id, 'season': num + 1, 'fanart': get_FanArt(seriesid), 'seriesid': seriesid}
Exemplo n.º 20
0
import os
import re
import sys
import urllib
import urllib2
import HTMLParser
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon

addon = Addon('plugin.video.1channel', sys.argv)
BASE_URL = addon.get_setting('domain')
display_name = '1Channel'
required_addons = []
tag = '1Ch'


def get_settings_xml():
    return False


def get_results(vid_type, title, year, imdb, tvdb, season, episode):
    if vid_type == 'movie':
        return Search('movies', title, imdb)
    elif vid_type == 'tvshow':
        return _get_tvshows(title, year, imdb, tvdb)
    elif vid_type == 'season':
        return _get_season(title, year, imdb, tvdb, season)
    elif vid_type == 'episode':
        return _get_episodes(title, year, imdb, tvdb, season, episode)

Exemplo n.º 21
0
import os
import Queue
import sys
import threading
import time
import xbmc
import xbmcgui
from t0mm0.common.addon import Addon
from metahandler import metahandlers

addon = Addon('plugin.video.1channel', sys.argv)
try:
    DB_NAME = 	 addon.get_setting('db_name')
    DB_USER = 	 addon.get_setting('db_user')
    DB_PASS = 	 addon.get_setting('db_pass')
    DB_ADDRESS = addon.get_setting('db_address')

    if  addon.get_setting('use_remote_db')=='true' and \
        DB_ADDRESS is not None and \
        DB_USER	   is not None and \
        DB_PASS    is not None and \
        DB_NAME    is not None:
        import mysql.connector as database
        addon.log('Loading MySQL as DB engine')
        DB = 'mysql'
    else:
        addon.log('MySQL not enabled or not setup correctly')
        raise ValueError('MySQL not enabled or not setup correctly')
except:
    try: 
        from sqlite3 import dbapi2 as database
Exemplo n.º 22
0
historytitle = addon.queries.get('historytitle', '')
historylink = addon.queries.get('historylink', '')
iswatchhistory = addon.queries.get('watchhistory', '')
year = addon.queries.get('year', '')
show = addon.queries.get('show', '')
queued = addon.queries.get('queued', '')

items_per_page = 25

#################### Addon Settings ##################################

#Helper function to convert strings to boolean values
def str2bool(v):
  return v.lower() in ("yes", "true", "t", "1")
  
meta_setting = str2bool(addon.get_setting('use-meta'))

metaget=metahandlers.MetaData()

def WatchedCallback():    
    metaget.change_watched(video_type, show, imdb_id, season=season, episode=episode, year=year, watched=7)    
    xbmc.executebuiltin("Container.Refresh")

#################### Helper Functions ##################################

def unescape(text):
        try:            
            rep = {"&nbsp;": " ",
                   "\r": "",            
                   "\n": "",
                   "\t": "",   
Exemplo n.º 23
0
import urllib, urllib2, re, xbmcplugin, xbmcgui
from t0mm0.common.addon import Addon
from t0mm0.common.net import Net
import urlresolver
import socket
import tempfile, os

# print "socket: " + socket.getdefaulttimeout()
socket.setdefaulttimeout(60)
net = Net()


_addon = Addon("plugin.video.filmovizija", sys.argv)
VK_user = _addon.get_setting("VK_user")
VK_pass = _addon.get_setting("VK_pass")

# print VK_user, VK_pass


def HOME():
    addDir("Movies", "http://www.filmovizija.com/browse-movies-videos-1-artist.html", "1", "")
    addDir("EX-YU Movies", "http://www.filmovizija.com/browse-ex-yu_movies-videos-1-artist.html", "2", "")
    addDir("Series", "http://www.filmovizija.com/browse-Series-videos-1-artist.html", "1", "")
    addDir("EX-YU Series", "http://www.filmovizija.com/browse-ex-yu_series-videos-1-artist.html", "1", "")
    addDir("Cartoon", "http://www.filmovizija.com/browse-cartoon-videos-1-artist.html", "1", "")
    addDir("Animated", "http://www.filmovizija.com/browse-animated-videos-1-artist.html", "2", "")
    addDir("Documentary", "http://www.filmovizija.com/browse-Documetary-videos-1-date.html", "2", "")
    addDir("Search", "none", "0", "")
    ###Movies EX-YU Movies Series EX-YU Series Documetary Animated Cartoon

Exemplo n.º 24
0
import os
import re
import sys
import urllib
import urllib2
import HTMLParser
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon

addon = Addon('plugin.video.1channel', sys.argv)
BASE_URL = addon.get_setting('domain')
if (tfalse(addon.get_setting("enableDomain"))==True) and (len(addon.get_setting("customDomain")) > 10):
	BASE_URL=addon.get_setting("customDomain")
display_name = 'PrimeWire'#'1Channel'
required_addons = []
tag = '1Ch'


def get_settings_xml():
    return False


def get_results(vid_type, title, year, imdb, tvdb, season, episode):
    if vid_type == 'movie':
        return Search('movies', title, imdb)
    elif vid_type == 'tvshow':
        return _get_tvshows(title, year, imdb, tvdb)
    elif vid_type == 'season':
        return _get_season(title, year, imdb, tvdb, season)
    elif vid_type == 'episode':
        return _get_episodes(title, year, imdb, tvdb, season, episode)
Exemplo n.º 25
0
import os
import re
import sys
import urllib
import urllib2
import HTMLParser
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon

addon = Addon('plugin.video.1channel', sys.argv)
BASE_URL = addon.get_setting('domain')
display_name = '1Channel'
required_addons = []
tag = '1Ch'


def get_settings_xml():
    return False


def get_results(vid_type, title, year, imdb, tvdb, season, episode):
    if vid_type == 'movie':
        return Search('movies', title, imdb)
    elif vid_type == 'tvshow':
        return _get_tvshows(title, year, imdb, tvdb)
    elif vid_type == 'season':
        return _get_season(title, year, imdb, tvdb, season)
    elif vid_type == 'episode':
        return _get_episodes(title, year, imdb, tvdb, season, episode)

Exemplo n.º 26
0
from t0mm0.common.addon import Addon
from t0mm0.common.net import Net
from tempmeta import metahandlers
from tempmeta import metacontainers
from tempmeta import metapacks

try:
	from sqlite3 import dbapi2 as sqlite
	print "Loading sqlite3 as DB engine"
except:
	from pysqlite2 import dbapi2 as sqlite
	print "Loading pysqlite2 as DB engine"

ADDON = Addon('plugin.video.1channel', sys.argv)
DB = os.path.join(xbmc.translatePath("special://database"), 'onechannelcache.db')
META_ON = ADDON.get_setting('use-meta')
AZ_DIRECTORIES = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z']
BASE_URL = 'http://www.1channel.ch'
USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
GENRES = ['Action', 'Adventure', 'Animation', 'Biography', 'Comedy', 
          'Crime', 'Documentary', 'Drama', 'Family', 'Fantasy', 'Game-Show', 
          'History', 'Horror', 'Japanese', 'Korean', 'Music', 'Musical', 
          'Mystery', 'Reality-TV', 'Romance', 'Sci-Fi', 'Short', 'Sport', 
          'Talk-Show', 'Thriller', 'War', 'Western', 'Zombies']

prepare_zip = False
metaget=metahandlers.MetaData(preparezip=prepare_zip)

if not os.path.isdir(ADDON.get_profile()):
     os.makedirs(ADDON.get_profile())
Exemplo n.º 27
0
import re
import urlresolver
import xbmc, xbmcaddon, xbmcplugin, xbmcgui

from t0mm0.common.addon import Addon
from t0mm0.common.net import Net

addon_id = 'plugin.video.watchwrestling'

net = Net(user_agent='Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36')
headers = {
    'Accept'    :   'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
    }
addon = Addon(addon_id, sys.argv)

BASEURL = addon.get_setting("websrc")

#PATHS
AddonPath = addon.get_path()
IconPath = os.path.join(AddonPath, 'icons')

from universal import _common as univ_common
from universal import watchhistory, playbackengine

mode = addon.queries['mode']
url = addon.queries.get('url', '')
title = addon.queries.get('title', 'Watch Wrestling ( watchwrestling.to )')
img = addon.queries.get('img', os.path.join(IconPath, 'icon.jpg'))
section = addon.queries.get('section', '')
page = addon.queries.get('page', '')
mediaid = addon.queries.get('mediaid', '')