Example #1
0
    def addDirectoryItem(self, name, query, thumb, icon, queue=False, isAction=True, isFolder=True, imgPath = None):

        self.logger = logging.getLogger('funimationnow');

        try: 

            name = control.lang(name).encode('utf-8') if isinstance(name, (int, long)) else name;

        except: 
            pass;

        url = '%s?action=%s' % (sysaddon, query) if isAction == True else query;

        artPath = control.artPath(imgPath);
        thumb = os.path.join(artPath, thumb) if not artPath == None else icon;

        cm = [];

        if queue == True: 
            cm.append((queueMenu, 'RunPlugin(%s?action=queueItem)' % sysaddon));

        item = control.item(label=name);

        item.addContextMenuItems(cm);
        item.setArt({'icon': thumb, 'thumb': thumb});

        if not addonFanart == None: 
            item.setProperty('Fanart_Image', addonFanart);

        control.addItem(handle=syshandle, url=url, listitem=item, isFolder=isFolder);
Example #2
0
 def addDirectory(self, items, queue=False, isFolder=True):
     if items is None or len(items) is 0:
         control.idle()
         sys.exit()
     sysaddon = sys.argv[0]
     syshandle = int(sys.argv[1])
     addonFanart, addonThumb, artPath = control.addonFanart(
     ), control.addonThumb(), control.artPath()
     for i in items:
         try:
             name = i['name']
             if i['image'].startswith('http'):
                 thumb = i['image']
             elif artPath is not None:
                 thumb = os.path.join(artPath, i['image'])
             else:
                 thumb = addonThumb
             item = control.item(label=name)
             if isFolder:
                 url = '%s?action=%s' % (sysaddon, i['action'])
                 try:
                     url += '&url=%s' % urllib.quote_plus(i['url'])
                 except Exception:
                     pass
                 item.setProperty('IsPlayable', 'false')
             else:
                 url = '%s?action=%s' % (sysaddon, i['action'])
                 try:
                     url += '&url=%s' % i['url']
                 except Exception:
                     pass
                 item.setProperty('IsPlayable', 'true')
                 item.setInfo("mediatype", "video")
                 item.setInfo("audio", '')
             item.setArt({'icon': thumb, 'thumb': thumb})
             if addonFanart is not None:
                 item.setProperty('Fanart_Image', addonFanart)
             control.addItem(handle=syshandle,
                             url=url,
                             listitem=item,
                             isFolder=isFolder)
         except Exception:
             pass
     control.content(syshandle, 'addons')
     control.directory(syshandle, cacheToDisc=True)
Example #3
0
    def addDirectory(self, items):
        if items == None or len(items) == 0: return

        sysaddon = sys.argv[0]
        addonFanart, addonThumb, artPath = control.addonFanart(
        ), control.addonThumb(), control.artPath()

        for i in items:
            try:
                try:
                    name = control.lang(i['name']).encode('utf-8')
                except:
                    name = i['name']

                if i['image'].startswith('http://'): thumb = i['image']
                elif not artPath == None:
                    thumb = os.path.join(artPath, i['image'])
                else:
                    thumb = addonThumb

                url = '%s?action=%s' % (sysaddon, i['action'])
                try:
                    url += '&url=%s' % urllib.quote_plus(i['url'])
                except:
                    pass

                cm = []

                item = control.item(label=name,
                                    iconImage=thumb,
                                    thumbnailImage=thumb)
                item.addContextMenuItems(cm, replaceItems=False)
                if not addonFanart == None:
                    item.setProperty('Fanart_Image', addonFanart)
                control.addItem(handle=int(sys.argv[1]),
                                url=url,
                                listitem=item,
                                isFolder=True)
            except:
                pass

        #control.do_block_check(False)
        control.directory(int(sys.argv[1]), cacheToDisc=True)
Example #4
0
	def addDirectory(self, items, queue=False):
		control.playlist.clear()
		if not items: # with reuselanguageinvoker on an empty directory must be loaded, do not use sys.exit()
			control.hide() ; control.notification(title=32002, message=33049)
		sysaddon, syshandle = argv[0], int(argv[1])
		addonThumb = control.addonThumb()
		artPath = control.artPath()
		queueMenu, playRandom, addToLibrary = control.lang(32065), control.lang(32535), control.lang(32551)
		for i in items:
			try:
				name = i['name']
				if i['image'].startswith('http'): thumb = i['image']
				elif artPath: thumb = control.joinPath(artPath, i['image'])
				else: thumb = addonThumb
				icon = i.get('icon', 0)
				if not icon: icon = 'DefaultFolder.png'
				url = '%s?action=%s' % (sysaddon, i['action'])
				try: url += '&url=%s' % quote_plus(i['url'])
				except: pass
				cm = []
				cm.append((playRandom, 'RunPlugin(%s?action=play_Random&rtype=show&url=%s)' % (sysaddon, quote_plus(i['url']))))
				if queue: cm.append((queueMenu, 'RunPlugin(%s?action=playlist_QueueItem)' % sysaddon))
				try:
					if control.setting('library.service.update') == 'true':
						cm.append((addToLibrary, 'RunPlugin(%s?action=library_tvshowsToLibrary&url=%s&name=%s)' % (sysaddon, quote_plus(i['context']), name)))
				except: pass
				cm.append(('[COLOR red]Venom Settings[/COLOR]', 'RunPlugin(%s?action=tools_openSettings)' % sysaddon))
				item = control.item(label=name, offscreen=True)
				item.setProperty('IsPlayable', 'false')
				item.setArt({'icon': icon, 'poster': thumb, 'thumb': thumb, 'fanart': control.addonFanart(), 'banner': thumb})
				item.addContextMenuItems(cm)
				control.addItem(handle=syshandle, url=url, listitem=item, isFolder=True)
			except:
				from resources.lib.modules import log_utils
				log_utils.error()
		control.content(syshandle, 'addons')
		control.directory(syshandle, cacheToDisc=True)
Example #5
0
    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,sys,urlparse

from resources.lib.modules import control
from resources.lib.modules import trakt


artPath = control.artPath()

addonFanart = control.addonFanart()

try: action = dict(urlparse.parse_qsl(sys.argv[2].replace('?','')))['action']
except: action = None

isPlayable = False if control.setting('autoplay') == 'false' and control.setting('hosts.mode') == '1' else True

classicMenu = True if control.setting('menu.classic') == 'true' else False

imdbCredentials = False if control.setting('imdb.user') == '' else True

traktCredentials = trakt.getTraktCredentialsInfo()

traktIndicators = trakt.getTraktIndicatorsInfo()
Example #6
0
import sys, urllib, os, json
from resources.lib.modules import control
from resources.lib.modules import cache

artPath = control.artPath()
NEXT_ICON = os.path.join(control.artPath(), 'next.png')


class indexer:
    def __init__(self):
        pass

    def get_live_channels(self):

        import scraper_live as scraper

        live = scraper.get_live_channels()

        return live

    def get_vod(self):
        import scraper_vod as scraper
        vod = scraper.getChannels()

        for item in vod:
            item["brplayprovider"] = "sexyhot"

        return vod

    def get_categories(self):
Example #7
0
    def addDirectory(self, items, queue=False):
        if items == None or len(items) == 0: control.idle() ; sys.exit()

        sysaddon = sys.argv[0]

        syshandle = int(sys.argv[1])

        addonFanart, addonThumb, artPath = control.addonFanart(), control.addonThumb(), control.artPath()

        queueMenu = control.lang(32065).encode('utf-8')

        for i in items:
            try:
                name = i['name']

                if i['image'].startswith('http://'): thumb = i['image']
                elif not artPath == None: thumb = os.path.join(artPath, i['image'])
                else: thumb = addonThumb

                url = '%s?action=%s' % (sysaddon, i['action'])
                try: url += '&url=%s' % urllib.quote_plus(i['url'])
                except: pass

                cm = []

                if queue == True:
                    cm.append((queueMenu, 'RunPlugin(%s?action=queueItem)' % sysaddon))

                item = control.item(label=name)

                item.setArt({'icon': thumb, 'thumb': thumb})
                if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)

                item.addContextMenuItems(cm)

                control.addItem(handle=syshandle, url=url, listitem=item, isFolder=True)
            except:
                pass

        #control.do_block_check(False)
        control.directory(syshandle, cacheToDisc=True)
Example #8
0
    def addDirectory(self, items, content):
        if items == None or len(items) == 0:
            return  #control.idle() ; sys.exit()

        sysaddon = sys.argv[0]

        syshandle = int(sys.argv[1])

        addonFanart, addonThumb, artPath = control.addonFanart(
        ), control.addonThumb(), control.artPath()

        playRandom = control.lang(32535)

        nextMenu = control.lang(32053)

        for i in items:
            try:
                name = i['name']

                plot = i['plot'] or '[CR]'

                if i['image'].startswith('http'): thumb = i['image']
                elif not artPath == None:
                    thumb = os.path.join(artPath, i['image'])
                else:
                    thumb = addonThumb

                try:
                    item = control.item(label=name, offscreen=True)
                except:
                    item = control.item(label=name)

                item.setArt({
                    'icon': thumb,
                    'thumb': thumb,
                    'poster': thumb,
                    'fanart': addonFanart
                })
                item.setInfo(type='video', infoLabels={'plot': plot})

                cm = []

                if content == 'movies':
                    link = urllib_parse.quote_plus(self.person_movie_link %
                                                   i['id'])
                    cm.append(
                        (playRandom,
                         'RunPlugin(%s?action=random&rtype=movie&url=%s)' %
                         (sysaddon, link)))
                    url = '%s?action=movies&url=%s' % (sysaddon, link)
                elif content == 'tvshows':
                    link = urllib_parse.quote_plus(self.person_tv_link %
                                                   i['id'])
                    cm.append(
                        (playRandom,
                         'RunPlugin(%s?action=random&rtype=show&url=%s)' %
                         (sysaddon, link)))
                    url = '%s?action=tvshows&url=%s' % (sysaddon, link)
                else:
                    url = '%s?action=personsSelect&name=%s&url=%s' % (
                        sysaddon, urllib_parse.quote_plus(name),
                        urllib_parse.quote_plus(i['id']))

                if cm:
                    item.addContextMenuItems(cm)

                control.addItem(handle=syshandle,
                                url=url,
                                listitem=item,
                                isFolder=True)
            except:
                log_utils.log('people_dir', 1)
                pass

        try:
            next = items[0]['next']
            if next == '': raise Exception()

            icon = control.addonNext()
            url = '%s?action=persons&url=%s&content=%s' % (
                sysaddon, urllib_parse.quote_plus(next), content)

            try:
                item = control.item(label=nextMenu, offscreen=True)
            except:
                item = control.item(label=nextMenu)

            item.setArt({
                'icon': icon,
                'thumb': icon,
                'poster': icon,
                'banner': icon,
                'fanart': addonFanart
            })
            item.setProperty('SpecialSort', 'bottom')

            control.addItem(handle=syshandle,
                            url=url,
                            listitem=item,
                            isFolder=True)
        except:
            pass

        control.content(syshandle, '')
        control.directory(syshandle, cacheToDisc=True)
Example #9
0
BaseUrl = 'https://www.premiumize.me/api'
folder_list_url = '%s/folder/list' % BaseUrl
folder_rename_url = '%s/folder/rename' % BaseUrl
folder_delete_url = '%s/folder/delete' % BaseUrl
item_details_url = '%s/item/details' % BaseUrl
item_delete_url = '%s/item/delete' % BaseUrl
item_rename_url = '%s/item/rename' % BaseUrl
transfer_create_url = '%s/transfer/create' % BaseUrl
transfer_directdl_url = '%s/transfer/directdl' % BaseUrl
transfer_list_url = '%s/transfer/list' % BaseUrl
transfer_clearfinished_url = '%s/transfer/clearfinished' % BaseUrl
transfer_delete_url = '%s/transfer/delete' % BaseUrl
account_info_url = '%s/account/info' % BaseUrl
cache_check_url = '%s/cache/check' % BaseUrl
list_services_path_url = '%s/services/list' % BaseUrl
pm_icon = control.joinPath(control.artPath(), 'premiumize.png')
addonFanart = control.addonFanart()
store_to_cloud = control.setting('premiumize.saveToCloud') == 'true'


class Premiumize:
    name = "Premiumize.me"

    def __init__(self):
        self.hosts = []
        self.patterns = []
        self.token = control.setting('premiumize.token')
        self.headers = {
            'User-Agent': 'Venom for Kodi',
            'Authorization': 'Bearer %s' % self.token
        }
# -*- coding: utf-8 -*-

from resources.lib.modules import control
from resources.lib.modules.telecine import get_cached
import player
import urllib
import os

HANDLER = __name__
PLAYER_HANDLER = player.__name__

BASE_URL = 'https://bff.telecinecloud.com/api/v1'

FANART = 'https://t2.tudocdn.net/235304?w=1200'
LOGO = os.path.join(control.artPath(), 'logo_telecine.png')


def get_channels():

    return [{
        'handler': HANDLER,
        'method': 'get_channel_categories',
        'label': 'Telecine',
        'id': 1966,
        'art': {
            'thumb': LOGO,
            'fanart': FANART,
        }
    }]

Example #11
0
    def addDirectory(self, items, queue=False):
        if items == None or len(items) == 0: return

        sysaddon = sys.argv[0]
        isPlayable = False if control.setting('autoplay') == 'false' and control.setting('hosts.mode') == '1' else True
        addonFanart, addonThumb, artPath = control.addonFanart(), control.addonThumb(), control.artPath()

        for i in items:
            try:
                try: name = control.lang(i['name']).encode('utf-8')
                except: name = i['name']

                if i['image'].startswith('http://'): thumb = i['image']
                elif not artPath == None: thumb = os.path.join(artPath, i['image'])
                else: thumb = addonThumb

                url = '%s?action=%s' % (sysaddon, i['action'])
                try: url += '&url=%s' % urllib.quote_plus(i['url'])
                except: pass

                cm = []

                if queue == True and isPlayable == True:
                    cm.append((control.lang(30202).encode('utf-8'), 'RunPlugin(%s?action=queueItem)' % sysaddon))

                item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb)
                item.addContextMenuItems(cm, replaceItems=False)
                if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
                control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
            except:
                pass

        control.directory(int(sys.argv[1]), cacheToDisc=True)
Example #12
0
import json
import os
import sys
import urllib

from resources.lib.modules.globoplay import scraper_vod
from resources.lib.modules.globosat import indexer as globosat
from resources.lib.modules import control
from resources.lib.modules.globoplay import indexer as globoplay
from resources.lib.modules.globosat import scraper_combate
from resources.lib.modules import cache
from resources.lib.modules import workers

GLOBO_FANART = scraper_vod.GLOBO_FANART

CALENDAR_ICON = os.path.join(control.artPath(), 'calendar.png')
NEXT_ICON = os.path.join(control.artPath(), 'next.png')


class Vod:
    def __init__(self):
        self.systime = (datetime.datetime.utcnow()).strftime('%Y%m%d%H%M%S%f')

    def get_vod_channels(self):

        channels = cache.get(self.__get_vod_channels, 360, table="channels")

        self.channel_directory(channels)
        return channels

    def __get_vod_channels(self):
# -*- coding: utf-8 -*-

from resources.lib.modules import control
from resources.lib.modules.globosat import player, get_authorized_services
import os
import time
import requests
import datetime

SEXYHOT_LOGO = os.path.join(control.artPath(), 'logo_sexyhot.png')
SEXYHOT_FANART = os.path.join(control.artPath(), 'fanart_sexyhot.png')

FANART_URL = 'http://s01.video.glbimg.com/x1080/{media_id}.jpg'
THUMB_URL_MEDIA = 'https://s04.video.glbimg.com/x720/{media_id}.jpg'
THUMB_URL = 'https://live-thumbs.video.globo.com/sexy24ha/snapshot/'


PLAYER_HANDLER = player.__name__


def get_broadcast():

    url = 'https://products-jarvis.globo.com/graphql?query=query%20getBroadcast%28%24mediaId%3A%20ID%21%2C%20%24coordinates%3A%20CoordinatesData%2C%20%24logoScale%3A%20BroadcastChannelTrimmedLogoScales%20%3D%20X56%29%20%7B%0A%20%20broadcast%28mediaId%3A%20%24mediaId%2C%20coordinates%3A%20%24coordinates%29%20%7B%0A%20%20%20%20mediaId%0A%20%20%20%20mutedMediaId%0A%20%20%20%20promotionalMediaId%0A%20%20%20%20promotionalText%0A%20%20%20%20geofencing%0A%20%20%20%20geoblocked%0A%20%20%20%20channel%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20color%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20text%3A%20name%0A%20%20%20%20%20%20logo%28format%3A%20PNG%29%0A%20%20%20%20%20%20trimmedLogo%28scale%3A%20%24logoScale%29%0A%20%20%20%20%20%20slug%0A%20%20%20%20%20%20requireUserTeam%0A%20%20%20%20%7D%0A%20%20%20%20imageOnAir%3A%20imageOnAir%28scale%3A%20X720%29%0A%20%20%20%20epgCurrentSlots%28limit%3A%202%29%20%7B%0A%20%20%20%20%20%20composite%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20titleId%0A%20%20%20%20%20%20metadata%0A%20%20%20%20%20%20description%0A%20%20%20%20%20%20tags%0A%20%20%20%20%20%20startTime%0A%20%20%20%20%20%20endTime%0A%20%20%20%20%20%20liveBroadcast%0A%20%20%20%20%20%20durationInMinutes%0A%20%20%20%20%20%20contentRating%0A%20%20%20%20%20%20contentRatingCriteria%0A%20%20%20%20%20%20title%20%7B%0A%20%20%20%20%20%20%20%20titleId%0A%20%20%20%20%20%20%20%20originProgramId%0A%20%20%20%20%20%20%20%20releaseYear%0A%20%20%20%20%20%20%20%20cover%20%7B%0A%20%20%20%20%20%20%20%20%20%20landscape%28scale%3A%20X1080%29%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20countries%0A%20%20%20%20%20%20%20%20directorsNames%0A%20%20%20%20%20%20%20%20castNames%0A%20%20%20%20%20%20%20%20genresNames%0A%20%20%20%20%20%20%20%20authorsNames%0A%20%20%20%20%20%20%20%20screenwritersNames%0A%20%20%20%20%20%20%20%20artDirectorsNames%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20media%20%7B%0A%20%20%20%20%20%20serviceId%0A%20%20%20%20%20%20availableFor%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D&operationName=getBroadcast&variables=%7B%22logoScale%22%3A%22X42%22%2C%22mediaId%22%3A%226988462%22%7D'
    headers = {
        'x-tenant-id': 'sexy-hot',
        'x-platform-id': 'web',
        'x-device-id': 'desktop',
        'x-client-version': '0.4.3',
        'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36'
    }
    response = requests.get(url, headers=headers).json()
Example #14
0
    CATEGORIES.ESPECIAIS: 'home-especiais-e-promocoes',
    CATEGORIES.TV: 'home-programas-de-tv',
    CATEGORIES.FILMES: 'home-cinema',
    CATEGORIES.SERIES: 'home-series',
    CATEGORIES.KIDS: 'home-kids',
    CATEGORIES.CLARO: 'home-clarovideo',
    CATEGORIES.CLUBE: 'home-now-clube'
}

CATEGORIES_HIDE = [
    'live',
    'categories',  # TODO
    'tv_channels'  # TODO
]

LOGO = os.path.join(control.artPath(), 'logo_now.png')
FANART = 'https://t2.tudocdn.net/391136'
THUMB = 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcScaBeflBdP6AdV246I7YtH6j9r997X39OeHg&usqp=CAU'


def get_channels():
    return [{
        'handler': __name__,
        'method': 'get_channel_categories',
        "label": 'Now Online',
        "adult": False,
        'art': {
            'icon': LOGO,
            'clearlogo': LOGO,
            'thumb': LOGO,
            'fanart': FANART
Example #15
0
import sys
import urllib

from resources.lib.modules.globoplay import scraper_vod
from resources.lib.modules.globosat import indexer as globosat
from resources.lib.modules import control
from resources.lib.modules.globoplay import indexer as globoplay
from resources.lib.modules.futuraplay import scraper_vod as futuraplay
from resources.lib.modules.globosat import scraper_combate
from resources.lib.modules.futuraplay import scraper_vod as scraper_futura
from resources.lib.modules import cache
from resources.lib.modules import workers

GLOBO_FANART = scraper_vod.GLOBO_FANART

CALENDAR_ICON = os.path.join(control.artPath(), 'calendar.png')
NEXT_ICON = os.path.join(control.artPath(), 'next.png')
REPLAY_ICON = os.path.join(control.artPath(), 'returning-tvshows.png')
REPLAY_ICON_POSTER = os.path.join(control.artPath(),
                                  'returning-tvshows-poster.png')


class Vod:
    def __init__(self):
        self.systime = (datetime.datetime.utcnow()).strftime('%Y%m%d%H%M%S%f')

    def get_vod_channels_directory(self):

        channels = self.get_vod_channels()

        self.channel_directory(channels)
Example #16
0
# -*- coding: utf-8 -*-
"""
	Venom Add-on
"""

from base64 import b64encode
from json import dumps as jsdumps, loads as jsloads
import re
import requests
from urllib.parse import quote, quote_plus
from resources.lib.modules import control
from resources.lib.modules import string_tools

getLS = control.lang
getSetting = control.setting
en_icon = control.joinPath(control.artPath(), 'easynews.png')
addonFanart = control.addonFanart()

SORT = {
    's1': 'relevance',
    's1d': '-',
    's2': 'dsize',
    's2d': '-',
    's3': 'dtime',
    's3d': '-'
}
SEARCH_PARAMS = {
    'st': 'adv',
    'sb': 1,
    'fex': 'm4v,3gp,mov,divx,xvid,wmv,avi,mpg,mpeg,mp4,mkv,avc,flv,webm',
    'fty[]': 'VIDEO',
Example #17
0
# -*- coding: utf-8 -*-
"""
	Venom Add-on
"""

from sys import argv
import requests
from urllib.parse import quote_plus
from resources.lib.modules import control
from resources.lib.modules import string_tools
from resources.lib.modules.source_utils import supported_video_extensions

accepted_extensions = tuple(supported_video_extensions())
getLS = control.lang
# getSetting = control.setting
furk_icon = control.joinPath(control.artPath(), 'furk.png')
addonFanart = control.addonFanart()


class Furk:
	def __init__(self):
		self.base_link = "https://www.furk.net"
		self.account_info_link = "/api/account/info?api_key=%s"
		self.search_link = "/api/plugins/metasearch?api_key=%s&q=%s&cached=yes" \
								"&match=%s&moderated=%s%s&sort=relevance&type=video&offset=0&limit=200"
		self.tfile_link = "/api/file/get?api_key=%s&t_files=1&id=%s"
		self.get_user_files_link = "/api/file/get?api_key=%s&type=video"
		self.file_info_link = "/api/file/info?api_key%s"
		self.file_link_link = "/api/file/link?"
		self.protect_file_link = "/api/file/protect?"
		self.user_feeds_link = "/api/feed/get?"
import requests
from resources.lib.modules import control
from resources.lib.modules import cache
import os
from auth import gettoken, get_default_profile
from private_data import get_device_id
import urllib
from collections import OrderedDict
import player
import json
import traceback

FANART = os.path.join(control.artPath(), 'fanart_oi.jpg')
LOGO = os.path.join(control.artPath(), 'logo_oiplay.png')
FAVORITES = os.path.join(control.artPath(), 'favorites.png')

PLAYER_HANDLER = player.__name__


def get_channels():

    return [{
        'handler': __name__,
        'method': 'get_main_menu',
        'label': 'Oi Play',
        'art': {
            'thumb': LOGO,
            'fanart': FANART
        }
    }]
Example #19
0
    def addDirectory(self, items):
        if items == None or len(items) == 0: return

        sysaddon = sys.argv[0]
        addonFanart, addonThumb, artPath = control.addonFanart(), control.addonThumb(), control.artPath()

        for i in items:
            try:
                try: name = control.lang(i['name']).encode('utf-8')
                except: name = i['name']

                if i['image'].startswith('http://'): thumb = i['image']
                elif not artPath == None: thumb = os.path.join(artPath, i['image'])
                else: thumb = addonThumb

                url = '%s?action=%s' % (sysaddon, i['action'])
                try: url += '&url=%s' % urllib.quote_plus(i['url'])
                except: pass

                cm = []

                item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb)
                item.addContextMenuItems(cm, replaceItems=False)
                if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
                control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
            except:
                pass

        control.directory(int(sys.argv[1]), cacheToDisc=True)
Example #20
0
FormatDateTime = "%Y-%m-%dT%H:%M:%S.%fZ"
rest_base_url = 'https://api.real-debrid.com/rest/1.0/'
oauth_base_url = 'https://api.real-debrid.com/oauth/v2/'
unrestrict_link_url = 'unrestrict/link'
device_code_url = 'device/code?%s'
credentials_url = 'device/credentials?%s'
downloads_delete_url = 'downloads/delete'
add_magnet_url = 'torrents/addMagnet'
torrents_info_url = 'torrents/info'
select_files_url = 'torrents/selectFiles'
torrents_delete_url = 'torrents/delete'
check_cache_url = 'torrents/instantAvailability'
torrents_active_url = "torrents/activeCount"
hosts_regex_url = 'hosts/regex'
hosts_domains_url = 'hosts/domains'
rd_icon = control.joinPath(control.artPath(), 'realdebrid.png')
addonFanart = control.addonFanart()


class RealDebrid:
    def __init__(self):
        self.hosters = None
        self.hosts = None
        self.cache_check_results = {}
        self.token = control.addon('script.module.resolveurl').getSetting(
            'RealDebridResolver_token')
        self.headers = {'Authorization': 'Bearer %s' % self.token}
        self.client_ID = control.addon('script.module.resolveurl').getSetting(
            'RealDebridResolver_client_id')
        if self.client_ID == '':
            self.client_ID = 'X245A4XAIBGVM'
Example #21
0
    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,sys,urlparse

from resources.lib.modules import control
from resources.lib.modules import trakt


sysaddon = sys.argv[0] ; syshandle = int(sys.argv[1]) ; control.moderator()

artPath = control.artPath() ; addonFanart = control.addonFanart()

imdbCredentials = False if control.setting('imdb.user') == '' else True

traktCredentials = trakt.getTraktCredentialsInfo()

traktIndicators = trakt.getTraktIndicatorsInfo()

queueMenu = control.lang(32065).encode('utf-8')


class navigator:
    def root(self):
        self.addDirectoryItem(32001, 'movieNavigator', 'movies.png', 'DefaultMovies.png')
        self.addDirectoryItem(32002, 'tvNavigator', 'tvshows.png', 'DefaultTVShows.png')
Example #22
0
    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,sys,urlparse

from resources.lib.modules import control
from resources.lib.modules import trakt


sysaddon = sys.argv[0] ; syshandle = int(sys.argv[1]) ; control.moderator()

artPath = control.artPath() ; addonFanart = control.addonFanart()

imdbCredentials = False if control.setting('imdb.user') == '' else True

traktCredentials = trakt.getTraktCredentialsInfo()

traktIndicators = trakt.getTraktIndicatorsInfo()

queueMenu = control.lang(32065).encode('utf-8')


class navigator:
    def root(self):
        self.addDirectoryItem(32001, 'movieNavigator', 'movies.png', 'DefaultMovies.png')
        self.addDirectoryItem(32002, 'tvNavigator', 'tvshows.png', 'DefaultTVShows.png')
Example #23
0
    def addDirectory(self, items, queue=False, isFolder=True):
        if items is None or len(items) == 0:
            control.idle()
            control.notification(title=32002,
                                 message=33049,
                                 icon='INFO',
                                 sound=notificationSound)
            sys.exit()

        sysaddon = sys.argv[0]
        syshandle = int(sys.argv[1])

        addonThumb = control.addonThumb()
        artPath = control.artPath()

        queueMenu = control.lang(32065).encode('utf-8')
        playRandom = control.lang(32535).encode('utf-8')
        addToLibrary = control.lang(32551).encode('utf-8')

        for i in items:
            try:
                name = i['name']

                if i['image'].startswith('http'):
                    thumb = i['image']
                elif artPath is not None:
                    thumb = os.path.join(artPath, i['image'])
                else:
                    thumb = addonThumb

                item = control.item(label=name)

                if isFolder:
                    url = '%s?action=%s' % (sysaddon, i['action'])
                    try:
                        url += '&url=%s' % urllib.quote_plus(i['url'])
                    except:
                        pass
                    item.setProperty('IsPlayable', 'false')
                else:
                    url = '%s?action=%s' % (sysaddon, i['action'])
                    try:
                        url += '&url=%s' % i['url']
                    except:
                        pass
                    item.setProperty('IsPlayable', 'true')
                    item.setInfo("mediatype", "video")
                    item.setInfo("audio", '')

                item.setArt({
                    'icon': thumb,
                    'thumb': thumb,
                    'fanart': control.addonFanart()
                })

                control.addItem(handle=syshandle,
                                url=url,
                                listitem=item,
                                isFolder=isFolder)
            except:
                pass

        control.content(syshandle, 'addons')
        control.directory(syshandle, cacheToDisc=True)
Example #24
0
    def download_manager(self):
        sysaddon = sys.argv[0]
        syshandle = int(sys.argv[1])

        artPath = control.artPath()
        addonFanart = control.addonFanart()

        DBFile = control.logDownloads
        newData = []
        dupes = []
        cm = []
        thumb = 'cloud.png'
        thumb = control.getIcon(thumb)
        url = '%s?action=refresh' % (sysaddon)
        item = control.item(label='Refresh')
        item.addContextMenuItems(cm)
        item.setArt({'icon': thumb, 'thumb': thumb})
        if not addonFanart == None:
            item.setProperty('Fanart_Image', addonFanart)
        control.addItem(handle=syshandle,
                        url=url,
                        listitem=item,
                        isFolder=False)

        data = self.logDownload('title', '0', '0', mode='get')

        for x in data:
            try:
                thumb = 'cloud.png'
                thumb = control.getIcon(thumb)
                cm = []

                percent = str(x[1]) + '%'
                title = x[0]
                status = x[2]
                u = x[3]
                if status == 'running':
                    status = '[B][[COLOR orange]Running[/COLOR]][/B]'
                elif status == 'stopped':
                    status = '[B][[COLOR red]Stopped[/COLOR]][/B]'
                elif status == 'completed':
                    status = '[B][[COLOR lime]Completed[/COLOR]][/B]'
                label = '[B][%s][/B] %s %s' % (percent, status, title)
                cm.append(
                    ('Stop Download',
                     'RunPlugin(%s?action=download_manager_stop&title=%s)' %
                     (sysaddon, title)))
                cm.append(
                    ('Delete Download',
                     'RunPlugin(%s?action=download_manager_delete&title=%s)' %
                     (sysaddon, title)))
                url = ''
                item = control.item(label=label)
                item.addContextMenuItems(items=cm, replaceItems=True)
                item.setArt({'icon': thumb, 'thumb': thumb})
                if not addonFanart == None:
                    item.setProperty('Fanart_Image', addonFanart)
                control.addItem(handle=syshandle,
                                url=u,
                                listitem=item,
                                isFolder=False)
            except:
                pass

        control.content(syshandle, 'addons')
        control.directory(syshandle, cacheToDisc=False)
Example #25
0
# -*- coding: utf-8 -*-

from resources.lib.modules import control
from resources.lib.modules import client
from resources.lib.modules import util
from resources.lib.modules import workers
from resources.lib.modules import cache
import datetime
import re
from sqlite3 import dbapi2 as database
import time
import os
from scraper_vod import GLOBOPLAY_CONFIGURATION

GLOBO_LOGO = 'http://s3.glbimg.com/v1/AUTH_180b9dd048d9434295d27c4b6dadc248/media_kit/42/f3/a1511ca14eeeca2e054c45b56e07.png'
GLOBO_FANART = os.path.join(control.artPath(), 'globo.jpg')

GLOBOPLAY_APIKEY = '35978230038e762dd8e21281776ab3c9'

LOGO_BBB = 'https://s.glbimg.com/pc/gm/media/dc0a6987403a05813a7194cd0fdb05be/2014/12/1/7e69a2767aebc18453c523637722733d.png'
FANART_BBB = 'http://s01.video.glbimg.com/x720/244881.jpg'


def get_globo_live_id():
    return 4452349


def get_live_channels():

    affiliate_temp = control.setting('globo_affiliate')
Example #26
0
    def addDirectory(self, items, queue=False):
        if items == None or len(items) == 0: control.idle() ; sys.exit()

        sysaddon = sys.argv[0]

        syshandle = int(sys.argv[1])

        addonFanart, addonThumb, artPath = control.addonFanart(), control.addonThumb(), control.artPath()

        queueMenu = control.lang(32065).encode('utf-8')

        playRandom = control.lang(32535).encode('utf-8')

        addToLibrary = control.lang(32551).encode('utf-8')

        for i in items:
            try:
                name = i['name']

                if i['image'].startswith('http'): thumb = i['image']
                elif not artPath == None: thumb = os.path.join(artPath, i['image'])
                else: thumb = addonThumb

                url = '%s?action=%s' % (sysaddon, i['action'])
                try: url += '&url=%s' % urllib.quote_plus(i['url'])
                except: pass

                cm = []
                
                cm.append(('Settings', 'RunPlugin(%s?action=openSettings&query=0.0)' % sysaddon))
                
                cm.append((playRandom, 'RunPlugin(%s?action=random&rtype=movie&url=%s)' % (sysaddon, urllib.quote_plus(i['url']))))

                if queue == True:
                    cm.append((queueMenu, 'RunPlugin(%s?action=queueItem)' % sysaddon))

                try: cm.append((addToLibrary, 'RunPlugin(%s?action=moviesToLibrary&url=%s)' % (sysaddon, urllib.quote_plus(i['context']))))
                except: pass

                item = control.item(label=name)

                item.setArt({'icon': thumb, 'thumb': thumb})
                if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)

                item.addContextMenuItems(cm)

                control.addItem(handle=syshandle, url=url, listitem=item, isFolder=True)
            except:
                pass

        control.content(syshandle, 'addons')
        control.directory(syshandle, cacheToDisc=True)
    def addDirectory(self, items, queue=False):
        if items == None or len(items) == 0: control.idle() ; sys.exit()

        sysaddon = sys.argv[0]

        syshandle = int(sys.argv[1])

        addonFanart, addonThumb, artPath = control.addonFanart(), control.addonThumb(), control.artPath()

        queueMenu = control.lang(32065).encode('utf-8')

        playRandom = control.lang(32535).encode('utf-8')

        addToLibrary = control.lang(32551).encode('utf-8')

        for i in items:
            try:
                name = i['name']

                if i['image'].startswith('http'): thumb = i['image']
                elif not artPath == None: thumb = os.path.join(artPath, i['image'])
                else: thumb = addonThumb

                url = '%s?action=%s' % (sysaddon, i['action'])
                try: url += '&url=%s' % urllib.quote_plus(i['url'])
                except: pass

                cm = []

                cm.append((playRandom, 'RunPlugin(%s?action=random&rtype=show&url=%s)' % (sysaddon, urllib.quote_plus(i['url']))))

                if queue == True:
                    cm.append((queueMenu, 'RunPlugin(%s?action=queueItem)' % sysaddon))

                try: cm.append((addToLibrary, 'RunPlugin(%s?action=tvshowsToLibrary&url=%s)' % (sysaddon, urllib.quote_plus(i['context']))))
                except: pass

                item = control.item(label=name)

                item.setArt({'icon': thumb, 'thumb': thumb})
                if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)

                item.addContextMenuItems(cm)

                control.addItem(handle=syshandle, url=url, listitem=item, isFolder=True)
            except:
                pass

        control.content(syshandle, 'addons')
        control.directory(syshandle, cacheToDisc=True)
Example #28
0
	Venom Add-on
"""

from json import dumps as jsdumps, loads as jsloads
import re
import requests
from sys import argv, exit as sysexit
from urllib.parse import quote_plus
from resources.lib.database import cache
from resources.lib.modules import control
from resources.lib.modules import log_utils
from resources.lib.modules.source_utils import supported_video_extensions

base_url = 'https://api.alldebrid.com/v4/'
user_agent = 'Venom%20for%20Kodi'
ad_icon = control.joinPath(control.artPath(), 'alldebrid.png')
addonFanart = control.addonFanart()


class AllDebrid:
    name = "AllDebrid"

    def __init__(self):
        self.token = control.setting('alldebrid.token')
        self.timeout = 15
        self.server_notifications = control.setting(
            'alldebrid.server.notifications')
        self.store_to_cloud = control.setting(
            'alldebrid.saveToCloud') == 'true'

    def _get(self, url, url_append=''):
Example #29
0
    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, sys, urlparse

from resources.lib.modules import control
from resources.lib.modules import trakt

sysaddon = sys.argv[0]
syshandle = int(sys.argv[1])
()

artPath = control.artPath()
addonFanart = control.addonFanart()

imdbCredentials = False if control.setting('imdb.user') == '' else True

traktCredentials = trakt.getTraktCredentialsInfo()

traktIndicators = trakt.getTraktIndicatorsInfo()

queueMenu = control.lang(32065).encode('utf-8')


class navigator:
    def root(self):
        self.addDirectoryItem('Created by Genesis Reborn', 'ShowChangelog',
                              'icon.png', 'DefaultFolder.png')
Example #30
0
    def addDirectory(self, items, queue=False, isFolder=True):
        if items == None or len(items) == 0: control.idle() ; sys.exit()

        sysaddon = sys.argv[0]

        syshandle = int(sys.argv[1])

        addonFanart, addonThumb, artPath = control.addonFanart(), control.addonThumb(), control.artPath()

        queueMenu = control.lang(32065).encode('utf-8')

        playRandom = control.lang(32535).encode('utf-8')

        addToLibrary = control.lang(32551).encode('utf-8')

        for i in items:
            try:
                name = i['name']

                if i['image'].startswith('http'): thumb = i['image']
                elif not artPath == None: thumb = os.path.join(artPath, i['image'])
                else: thumb = addonThumb

                item = control.item(label=name)

                if isFolder:
                    url = '%s?action=%s' % (sysaddon, i['action'])
                    try: url += '&url=%s' % urllib.quote_plus(i['url'])
                    except: pass
                    item.setProperty('IsPlayable', 'false')
                else:
                    url = '%s?action=%s' % (sysaddon, i['action'])
                    try: url += '&url=%s' % i['url']
                    except: pass
                    item.setProperty('IsPlayable', 'true')
                    item.setInfo("mediatype", "video")
                    item.setInfo("audio", '')

                item.setArt({'icon': thumb, 'thumb': thumb})
                if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)

                control.addItem(handle=syshandle, url=url, listitem=item, isFolder=isFolder)
            except:
                pass

        control.content(syshandle, 'addons')
        control.directory(syshandle, cacheToDisc=True)