Пример #1
0
def Announce(date,announce):
    date = re.sub(r'/','-', date)

    if addon.get_setting('seen_anounce') == 'true':
        seen_date = addon.get_setting('seen_date')
        if date > seen_date:
            pass
        else:
            return

    from pyxbmct.addonwindow import *
    Addon.setSetting('seen_anounce', value='true')
    
    window = AddonDialogWindow('Whitecream [COLOR red]*ANNOUNCEMENT*[/COLOR] %s'%date)
    window.setGeometry(850, 600, 12, 8)
    textBox = TextBox(textColor='0xFFFFFFFF')
    window.placeControl(textBox, 0, 0, columnspan=7, rowspan=11)
    textBox.setText(announce)

    button = Button('Close')
    window.placeControl(button, 11, 3, columnspan=2)
    window.setFocus(button)
    window.connect(button, window.close)
    window.connect(ACTION_NAV_BACK, window.close)
    window.doModal()

    Addon.setSetting(id='seen_date', value=date)
Пример #2
0
def changes():
	installed = Addon.getSetting('version')
	if installed != addon_version:
		f = xbmcvfs.File(xbmcaddon.Addon().getAddonInfo('changelog'))
		text = f.read(); f.close()
		
		# xbmc.log(text)
		
		label = '%s - %s' % (xbmc.getLocalizedString(24054), xbmcaddon.Addon().getAddonInfo('name'))
		id = 10147
		xbmc.executebuiltin('ActivateWindow(%d)' % id)
		xbmc.sleep(500)
		
		win = xbmcgui.Window(id)
		retry = 50
		# win.getControl(5).setText(text)
		while (retry > 0):
			try:
				xbmc.sleep(10)
				win.getControl(1).setLabel(label)
				win.getControl(5).setText(text)
				retry = 0
			except:
				retry -= 1

		Addon.setSetting('version', addon_version)
Пример #3
0
def Transform():
    if addon.get_setting('transform') == 'true':
        return
    if xbmcvfs.exists(xbmc.translatePath('special://masterprofile/sources.xml')):
        with open(xbmc.translatePath(os.path.join( addon.get_path(), 'resources', 'sourcesapp.xml'))) as f:
            sourcesapp = f.read()
            f.close()
        with open(xbmc.translatePath('special://masterprofile/sources.xml'), 'r+') as f:
            my_file = f.read()
            if re.search(r'http://transform.mega-tron.tv/', my_file):
                addon.log('Transform Source Found in sources.xml, Not adding.')
                return
            addon.log('Adding Transform source in sources.xml')
            my_file = re.split(r'</files>\n</sources>\n', my_file)
            my_file = my_file[0]+sourcesapp
            f.seek(0)
            f.truncate()
            f.write(my_file)
            f.close()
            Addon.setSetting(id='transform', value='true')
            

    else:
        xbmcvfs.copy(xbmc.translatePath(os.path.join( addon.get_path(), 'resources', 'sources.xml')),
                       xbmc.translatePath('special://masterprofile/sources.xml'))
        Addon.setSetting(id='transform', value='true')
Пример #4
0
def convert_subtitles(closedcaption):
	# from pycaption import detect_format, SRTWriter
	# idea taken from LearningIt(t1m)
	str_output =''
	if closedcaption[0] is not None:
		try:
			cc_content = smart_unicode(make_request(closedcaption[0]))
			# reader = detect_format(cc_content)
			if cc_content != "":
				profile = Addon.getAddonInfo('profile').decode("utf-8")
				prodir  = xbmc.translatePath(os.path.join(profile))
				if not os.path.isdir(prodir):
					os.makedirs(prodir)
				subfile = xbmc.translatePath(os.path.join(profile, 'subtitles.srt'))	
				file = open(subfile, 'w+')
				str_output = re.sub('\d+(\b,\b)\d+','.',cc_content)
				str_output = str_output.replace('WEBVTT','')
				file.write(str_output)
				str_output=''
				file.close()
			else:
				print "unknown sub type"
		except:
			print "Exception with Subs: "
			subfile = ''
	return subfile
Пример #5
0
def get_free_movies():
	html2 = make_request(url)
	html = json.loads(html2)
	content_id=''
	for r in html['contents']:
		if '1' in r['content_type_id']:
			content_id = r['content_id']
			name = r['title']
	if content_id:
		userurl = 'https://erosnow.com/secured/dologin'
		req = make_request_post(userurl)
		movieurl2 = 'http://erosnow.com/profiles/'+str(content_id)+'?platform=2&q=auto'
		html3 = make_request(movieurl2)
		html4 = json.loads(html3)
		req2 = json.loads(req)
		item2 = xbmcgui.ListItem(name)
		if (str(req2['success']['plan']) == 'False'):
			movie_link = html4['profiles']['ADAPTIVE_SD'][0]
		else:
			movie_link = html4['profiles']['ADAPTIVE_ALL'][0]
			subYes = Addon.getSetting('subType')
			if (subYes=='true') and (html4.get('subtitles')):
				closedcaption=[]
				closedcaption.append(html4['subtitles']['eng']['url'])
				subpath = convert_subtitles(closedcaption)
				item2.setSubtitles([subpath])
		
		item2.setProperty('IsPlayable', 'true')
		item2.setPath(movie_link['url'])
		xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item2)
	else:
		dialog.notification('Error', 'Movie may not be released yet.', xbmcgui.NOTIFICATION_INFO, 6000)
Пример #6
0
def make_request_post(url):
	username = (Addon.getSetting('username'))
	password = (Addon.getSetting('password'))
	# ipaddressUK="31.7."
	# for x in xrange(1,2):
		# ipaddressUK += ".".join(map(str,(random.randint(0,255) for _ in range(2))))
	
	if (username != '' and password != ''):
		body = {'el':username, 'pw':password, 'mobile':'', 'callingcode':'', 'type':'json', 'fbid':''}
		body = urllib.urlencode(body)
		try:
			s.headers['Referer']='http://erosnow.com'
			# s.headers['X-Forwarded-For']=ipaddressUK
			s.headers['Content-Type']= 'application/x-www-form-urlencoded; charset=UTF-8'
			response = s.post(url, headers=headers, data=body, cookies=s.cookies, verify=False)
			data = response.text
			return data
		except urllib2.URLError, e:
			print
Пример #7
0
def make_request_post():
	url = 'https://account.hotstar.com/AVS/besc?action=Login&appVersion=5.0.30'
	username = Addon.getSetting('username')
	password = Addon.getSetting('password')
	headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36', 'Referer':'http://www.hotstar.com', 'Origin':'http://www.hotstar.com', 'Content-Type':'application/x-www-form-urlencoded'}
	body = {'username':username, 'password':password, 'channel':'TABLET'}
	body = urllib.urlencode(body)
	try:
		response = s.post(url, headers=headers, data=body, verify=False)
		# cookieString = ''
		# c = response.cookies
		# i = c.items()
		# for name2, value in i:
			# cookieString+= name2 + "=" + value + ";"
		# Addon.setSetting('cookieString', i)
		# time.sleep(1)
		return "done"
	except urllib2.URLError, e:
		print
Пример #8
0
def RealDebrid():
    rdv = addon.get_setting('realdebrid-video')
    addon.log('RealDebrid Video setting: %s'% rdv)
    
    if addon.get_setting('realdebrid-video') == 'true':
        return
    resolverSettings = xbmc.translatePath('special://masterprofile/addon_data/script.module.urlresolver/settings.xml')
    with open(resolverSettings, 'r') as f:
        my_file = f.read()
        f.close()
        r = re.search(r'RealDebridResolver_login\"\svalue\=\"false\"', my_file, re.I)
        
        if r:
            xbmcgui.Dialog().ok("TvRelease Realdebrid Info Video", "@veedubt25 Has made a video on HOW realdebrid works",
                                "You will ONLY see this ONCE")
            xbmc.executebuiltin("PlayMedia(plugin://plugin.video.youtube/?action=play_video&videoid=s-C4DdG4FF0&quality=720p)")
            Addon.setSetting(id='realdebrid-video', value='true')
        else:
            return
Пример #9
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 datetime
import xbmcgui
import xbmc
from utils import i18n
from pw_scraper import PW_Scraper
from addon.common.addon import Addon
import utils

_1CH = Addon('plugin.video.1channel')
pw_scraper = PW_Scraper(_1CH.get_setting("username"), _1CH.get_setting("passwd"))

def get_adv_search_query(section):
    if section == 'tv':
        header_text = i18n('adv_tv_search')
    else:
        header_text = i18n('adv_movie_search')
    SEARCH_BUTTON = 200
    CANCEL_BUTTON = 201
    HEADER_LABEL = 100
    ACTION_PREVIOUS_MENU = 10
    ACTION_BACK = 92
    CENTER_Y = 6
    CENTER_X = 2
    now = datetime.datetime.now()
Пример #10
0
import urllib, urllib2, re, cookielib, os, sys
import xbmc, xbmcgui, xbmcaddon, xbmcplugin, time
from resources.modules import main, vipplaylist, resolvers
import subprocess
import FuckNeulionClient

from addon.common.addon import Addon

addon_id = 'plugin.video.phstreams'
selfAddon = xbmcaddon.Addon(id=addon_id)
addon = Addon('plugin.video.phstreams', sys.argv)
art = main.art

addonp = xbmcaddon.Addon('plugin.video.phstreams')
addonPath = addonp.getAddonInfo('path')
jarPath = addonPath + '/jars/'

jarfile = jarPath + 'FuckNeulionV2.jar'
artPath = addonPath + '/art/'


def MAINNHL(murl):
    source_media = {}
    from datetime import datetime
    datex = datetime.now().strftime('%Y%m%d')
    xml = 'http://live.nhl.com/GameData/SeasonSchedule-20142015.json'
    link = main.OPEN_URL(xml)
    link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(
        '&nbsp;', '').replace('  ', '')
    main.addDir('[COLOR red]Archived Games Click Here[/COLOR]', 'Archived',
                'mainnhlarch', artPath + 'hockey.jpg', '', '', '', '')
Пример #11
0
import xbmcplugin
import xbmcaddon
import xbmcvfs
import log_utils
import sys
import hashlib
import urlparse
import shutil
import urllib
from constants import *
from scrapers import * # import all scrapers into this namespace
from addon.common.addon import Addon
from trakt_api import Trakt_API
from db_utils import DB_Connection

ADDON = Addon('plugin.video.salts')
ICON_PATH = os.path.join(ADDON.get_path(), 'icon.png')
SORT_FIELDS =  [(SORT_LIST[int(ADDON.get_setting('sort1_field'))], SORT_SIGNS[ADDON.get_setting('sort1_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort2_field'))], SORT_SIGNS[ADDON.get_setting('sort2_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort3_field'))], SORT_SIGNS[ADDON.get_setting('sort3_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort4_field'))], SORT_SIGNS[ADDON.get_setting('sort4_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort5_field'))], SORT_SIGNS[ADDON.get_setting('sort5_order')])]

username=ADDON.get_setting('username')
password=ADDON.get_setting('password')
use_https=ADDON.get_setting('use_https')=='true'
trakt_timeout=int(ADDON.get_setting('trakt_timeout'))

P_MODE = int(ADDON.get_setting('parallel_mode'))
if P_MODE == P_MODES.THREADS:
    import threading
Пример #12
0
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# http://www.youtube.com/user/thaakillah
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Based on code from youtube addon
#------------------------------------------------------------

import os
import sys
import plugintools
import xbmc, xbmcaddon
from addon.common.addon import Addon

addonID = 'plugin.video.thaakillah'
addon = Addon(addonID, sys.argv)
local = xbmcaddon.Addon(id=addonID)
icon = local.getAddonInfo('icon')

YOUTUBE_CHANNEL_ID = "thaakillah"


# Entry point
def run():
    plugintools.log("thaakillah.run")

    # Get params
    params = plugintools.get_params()

    if params.get("action") is None:
        main_list(params)
Пример #13
0
import xbmc, xbmcplugin, xbmcaddon, xbmcgui, xbmcvfs

import requests
import json
import os
import re
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'
Пример #14
0
import os
import re
import sys
import xbmc,xbmcaddon,xbmcgui,xbmcplugin,xbmcgui

############# A massive thankyou to Jas0n_pc for sending me the code for this twitter window its brilliant#################

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

net = Net()

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

sys.path.append(os.path.join(addon.get_path(), 'resources', 'lib'))
data_path = addon.get_profile()

newsurl = 'http://pastebin.com/raw.php?i=uX9XKZtj'

try:
  import StorageServer
except:
  import storageserverdummy as StorageServer
cache = StorageServer.StorageServer(addon_id)
               
def TWITTER(url):
    #test = net.http_GET(newsurl).content
    #r = re.search(r'<message>(.*?)</message>', test, re.I|re.DOTALL)
Пример #15
0
import xbmc,xbmcaddon,xbmcgui,xbmcplugin,xbmcvfs
import os,re,requests,shutil,urllib
from addon.common.addon import Addon
from metahandler import metahandlers

#MOVIEPOOL Add-on Created By Mucky Duck (9/2016)

User_Agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36'
addon_id='plugin.video.mdmoviepool'
selfAddon = xbmcaddon.Addon(id=addon_id)
addon_name = selfAddon.getAddonInfo('name')
addon = Addon(addon_id, sys.argv)
art = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + '/resources/art/'))
icon = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id, 'icon.png'))
fanart = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id , 'fanart.jpg'))
auto_play = addon.get_setting('autoplay')
def_quality = addon.get_setting('default_quality')
metaset = selfAddon.getSetting('enable_meta')
metaget = metahandlers.MetaData()
baseurl = 'http://moviepool.net'
s = requests.session()




def CAT():
        addDir('[B][COLOR white]Recommended Movies[/COLOR][/B]',baseurl+'/hd-streaming/category/featured?filtre=date',1,art+'recommended.png',fanart,'')
        addDir('[B][COLOR white]Recently Added[/COLOR][/B]',baseurl+'/?filtre=date&cat=0',1,art+'recent.png',fanart,'')
        addDir('[B][COLOR white]Most Viewed[/COLOR][/B]',baseurl+'/hd-streaming/category/featured?display=tube&filtre=views',1,art+'viewed.png',fanart,'')
        addDir('[B][COLOR white]Categories[/COLOR][/B]',baseurl+'/categories',3,art+'categories.png',fanart,'')
        addDir('[B][COLOR white]Actors[/COLOR][/B]',baseurl+'/tags',5,art+'actors.png',fanart,'')
Пример #16
0
#### Imports
import os, re, urllib, urllib2  # Import python function
import xbmc, xbmcaddon, xbmcgui, xbmcplugin  # Import XBMC plugins
import buggalo  # Import 3rd party addons
try:
    from addon.common.addon import Addon

except:
    from t0mm0.common.addon import Addon

#### Constants & initialization
buggalo.SUBMIT_URL = 'http://buggalo.xbmchub.com/submit.php'  # Official XBMC error report generator
ADDON_NAME = 'plugin.audio.XBMCmp3'  # Addon namespace
__addon__ = xbmcaddon.Addon(ADDON_NAME)  # Initializing addon properties
__t0mm0addon__ = Addon(ADDON_NAME, sys.argv)  # Initializing addon properties
__language__ = __addon__.getLocalizedString

__addonname__ = __addon__.getAddonInfo('name')  # Humanly readable addon name
PATH = xbmc.translatePath(__addon__.getAddonInfo('path')).decode(
    'utf-8')  # Path where the addon resides (needs absolute paths)

THEME = __t0mm0addon__.get_setting('theme')  # Theme settings
THEME_PATH = os.path.join(PATH, 'art', 'themes', THEME)  # Theme dir

playlist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)


class switch(object):
    def __init__(self, value):
        self.value = value
Пример #17
0
def get_video_url():
	videos = []
	params = []
	addon_log(url)
	quality = (Addon.getSetting('qualityType')).lower()
	html = make_request(url)
	data = html
	html = json.loads(data)
	manifest1 = html['resultObj']['src']
	addon_log('manifest1 is, '+manifest1)
	islive=False
	if '/videos/' not in manifest1:
		islive=True
		quality='let me choose'
	if 'manifest.f4m' in manifest1:
		manifest1 = manifest1.replace('http://','https://')
		manifest1 = manifest1.replace('/z/','/i/')
		manifest1 = manifest1.replace('manifest.f4m', 'master.m3u8')
	if (quality=='highest' and '1300,2000' in manifest1):
		manifest2 = manifest1.replace('1300,2000', '3000,4500')
		manifest_url = make_request(manifest2)
		# print manifest_url
		if 'EXTM3U' in manifest_url:
			matchlist2 = re.compile("x(\d+).+?(http.+?)\n", re.DOTALL).findall(str(manifest_url))
			manifest1 = None
			if matchlist2:
				for (size, video) in matchlist2:
					if size:
						size = int(size)
					else:
						size = 0
					videos.append( [size, video] )
		else:
			manifest1 = manifest2.replace('3000,4500', '1300,2000')

	if manifest1:
		manifest_url = make_request(manifest1)
		addon_log('quality is '+quality)
		addon_log(manifest_url)
		if (manifest_url):
			if (quality=='highest' or quality=='let me choose'):
				matchlist2 = re.compile("x(\d+).+?(http.+?)\n", re.DOTALL).findall(str(manifest_url))
			elif (quality == '720p'):
				matchlist2 = re.compile("x(720)[^\n]*\n([^\n]*)", re.DOTALL).findall(str(manifest_url))
			elif (quality == '404p'):
				matchlist2 = re.compile("x(404).+?(http.+?)\n", re.DOTALL).findall(str(manifest_url))
			else:
				matchlist2 = re.compile("x(360).+?(http.+?)\n", re.DOTALL).findall(str(manifest_url))
			if matchlist2:
				addon_log('inside matchlist2 to separate size,video')
				for (size, video) in matchlist2:
					addon_log(size+'======'+video)
					if size:
						size = int(size)
					else:
						size = 0
					videos.append( [size, video] )
		else:
			videos.append( [-2, match] )

	videos.sort(key=lambda L : L and L[0], reverse=True)
	
	cookieString = ""
	c = s.cookies
	i = c.items()
	for name2, value in i:
		cookieString+= name2 + "=" + value + ";"
	# print 'cookieString is', cookieString

	if (quality == 'let me choose'):
		for video in videos:
			addon_log(video[1])
			size = '(' + str(video[0]) + 'p) '
			if enableip=='true':
				if 'index_1364_av' in video[1]:
					old_size = size
					size = '(720p) '
					old_vid = video[1]
					new_vid = video[1].replace('index_1364_av', 'index_2064_av')
					addDir(0, size + name, new_vid+"|Cookie="+cookieString+"&X-Forwarded-For="+ipaddress, image, isplayable=True)
					addDir(0, old_size + name, old_vid+"|Cookie="+cookieString+"&X-Forwarded-For="+ipaddress, image, isplayable=True)
				else:
					addDir(0, size + name, video[1]+"|Cookie="+cookieString+"&X-Forwarded-For="+ipaddress, image, isplayable=True)
			else:
				if 'index_1364_av' in video[1]:
					old_size = size
					size = '[COLOR green][720p][/COLOR] '
					old_vid = video[1]
					new_vid = video[1].replace('index_1364_av', 'index_2064_av')
					addDir(0, size + name, new_vid+"|Cookie="+cookieString, image, isplayable=True)
					addDir(0, old_size + name, old_vid+"|Cookie="+cookieString, image, isplayable=True)
				else:
					addDir(0, size + name, video[1]+"|Cookie="+cookieString, image, isplayable=True)
	else:
		if videos:
			raw3_start = videos[0][1]
			if enableip=='true':
				high_video = raw3_start+"|Cookie="+cookieString+"&X-Forwarded-For="+ipaddress
			else:
				high_video = raw3_start+"|Cookie="+cookieString
			print 'high_video is: ',high_video
			listitem =xbmcgui.ListItem(name)
			listitem.setPath(high_video)
			xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
		else:
			movie_id = 'IP issue?'
			dialog.notification("No Video Links available", movie_id, xbmcgui.NOTIFICATION_INFO, 4000)

	setView('movies', 'movie-view')
	xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True)	
Пример #18
0

import threading

try:
     import StorageServer
except:
     import storageserverdummy as StorageServer
import time

# Cache  
cache = StorageServer.StorageServer("familyfunflix", 0)

settings = xbmcaddon.Addon(id='plugin.video.familyfunflix')     
addon_id = 'plugin.video.familyfunflix'
addon = Addon(addon_id, sys.argv)
mode = addon.queries['mode']
url = addon.queries.get('url', '')
name = addon.queries.get('name', '')
thumb = addon.queries.get('thumb', '')
ext = addon.queries.get('ext', '')
console = addon.queries.get('console', '')
dlfoldername = addon.queries.get('dlfoldername', '')
favtype = addon.queries.get('favtype', '')
mainimg = addon.queries.get('mainimg', '')

print 'Mode is: ' + mode
print 'Url is: ' + url
print 'Name is: ' + name
print 'Thumb is: ' + thumb
print 'Extension is: ' + ext
Пример #19
0
# -*- coding: utf-8 -*-

### Imports ###
import re, os, sys, xbmc, urllib, xbmcplugin, xbmcgui, xbmcaddon
from addon.common.addon import Addon  # może trzeba więcej
import weblogingoogle
import StorageServer
from config import ps
from addon.common.net import Net  # może trzeba więcej


__settings__ = xbmcaddon.Addon(id="plugin.video.anime-iptv")
addonPath = __settings__.getAddonInfo('path')
iconFav = xbmcaddon.Addon(id="plugin.video.anime-iptv").getAddonInfo('path') + '/art/favorites.png'
net = Net()
_addon = Addon(ps('_addon_id'), sys.argv)
cache = StorageServer.StorageServer(ps('_addon_id'))
#cache = os.path.join(ps('_addon_id'))
_artIcon = _addon.get_icon()
_artFanart = _addon.get_fanart()


def addst(r, s=''):
    return _addon.get_setting(r)

loginGoogle = addst('username3', '')
passwordGoogle = addst('password3', '')


def iFL(t):
    return '[I]' + t + '[/I]'  # For Italic Text ###
Пример #20
0
from __future__ import unicode_literals
from addon.common.addon import Addon
import sys,os
import urlparse,urllib
import xbmc, xbmcgui, xbmcplugin, xbmcaddon
from resources.lib.modules import control
from resources.lib.modules.log_utils import log

addon = Addon('plugin.video.castaway', sys.argv)
addon_handle = int(sys.argv[1])

AddonPath = addon.get_path()
IconPath = os.path.join(AddonPath , "resources/media/")
fanart = os.path.join(AddonPath + "/fanart.jpg")
def icon_path(filename):
    if 'http://' in filename:
        return filename
    return os.path.join(IconPath, filename)

args = urlparse.parse_qs(sys.argv[2][1:])
mode = args.get('mode', None)


if mode is None:
    addon.add_item({'mode': 'live_sport'}, {'title':'Live Sport'}, img=icon_path('live_sport.jpg'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'live_tv'}, {'title':'Live TV'}, img=icon_path('live_tv.jpg'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'p2p_corner'}, {'title':'P2P Corner'}, img=icon_path('p2p_corner.jpg'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'on_demand_sport_categories'}, {'title':'Sport On Demand'}, img=icon_path('sport_on_demand.jpg'), fanart=fanart,is_folder=True)
    #addon.add_item({'mode': 'blogs'}, {'title':'Blogs'}, img=icon_path('blogs.jpg'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'tools'}, {'title':'Tools'}, img=icon_path('tools.jpg'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'my_castaway'}, {'title':'My Castaway'}, img=icon_path('my_castaway.jpg'), fanart=fanart,is_folder=True)
Пример #21
0
import HTMLParser
import xbmc
import xbmcgui
import os
import math
import socket
from operator import itemgetter
from addon.common.net import Net
from addon.common.addon import Addon
from db_utils import DB_Connection

USER_AGENT = ("User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64)"
              "AppleWebKit/537.17 (KHTML, like Gecko)"
              "Chrome/24.0.1312.56")

_1CH = Addon('plugin.video.1channel')
ADDON_PATH = _1CH.get_path()
ICON_PATH = os.path.join(ADDON_PATH, 'icon.png')
MAX_RETRIES=2
TEMP_ERRORS=[500, 502, 503, 504]

class PW_Error(Exception):
    pass


class MyHTTPRedirectHandler(urllib2.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        utils.log('Using Custom Redirect: |%s|%s|%s|%s|%s|' % (req.header_items(),code, msg, headers, newurl), xbmc.LOGDEBUG)
        request=urllib2.HTTPRedirectHandler.redirect_request(self, req, fp, code, msg, headers, newurl)
        if request:
            host = request.get_host()
Пример #22
0
import os
import re
import sys
import xbmc
import xbmcgui
import xbmcplugin

# from functools import wraps

from addon.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')
Пример #23
0
    from addon.common.net import Net
    from addon.common.addon import Addon
except Exception, e:
    xbmc.log('Failed To Import Needed Module: %e') % e
    xbmcgui.Dialog().ok("XxTRUCOxX Import Failure", "Failed to import needed module",
                        "[COLOR red]%e[/COLOR]", "") % e

net = Net()

base_url = 'https://raw.githubusercontent.com/AiWABR/list2/master/Main.xml'
no_image = 'https://corsetsandcutlasses.files.wordpress.com/2013/12/cover-not-yet-available.jpg'
delImage = 'http://www.muziejusalka.lt/files/upload/big_D%C4%97mesio.png'
retry_image = 'http://cdn3.iconfinder.com/data/icons/3d-printing-icon-set/256/Refresh.png'

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

netError = os.path.join(addon.get_path(), 'resources', 'skins', 'Default', 'media', 'network_error.png')

sys.path.append(os.path.join(addon.get_path(), 'resources', 'lib'))
data_path = addon.get_profile()
cookie_file = os.path.join(data_path, 'bu.cookie')

name = addon.queries.get('name', '')
url = addon.queries.get('url', '')
alt = addon.queries.get('alt', '')
mode = addon.queries['mode']
img = addon.queries.get('img', '')

addon.log('Version %s'%addon.get_version())
Пример #24
0
    from addon.common.addon import Addon

    from addon.common.net import Net
except:
    print 'Failed to import script.module.addon.common'
    xbmcgui.Dialog().ok(
        "Import Failure", "Failed to import addon.common",
        "A component needed by P2P Sport is missing on your system",
        "Please visit www.tvaddons.ag.com for support")

base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
args = urlparse.parse_qs(sys.argv[2][1:])
params = urlparse.parse_qs(sys.argv[2][1:])

addon = Addon('plugin.video.p2psport', sys.argv)
AddonPath = addon.get_path()


def build_url(query):
    return base_url + '?' + urllib.urlencode(query)


mode = args.get('mode', None)

my_addon = xbmcaddon.Addon()


def cleanex(text):
    text = text.replace(u'\xda', 'U').replace(u'\xc9', 'E').replace(
        u'\xd3', 'O').replace(u'\xd1', 'N').replace(u'\xcd', 'I').replace(
Пример #25
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/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)    
Пример #26
0
import xbmc, xbmcgui, xbmcplugin
import urllib, urllib2
import re, string

try:
    from addon.common.addon import Addon
    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")

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

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")


#Common Cache
import xbmcvfs
dbg = False # Set to false if you don't want debugging

#Common Cache
try:
  import StorageServer
except:
  import storageserverdummy as StorageServer
cache = StorageServer.StorageServer('plugin.video.projectfreetv')
Пример #27
0
#from common import functions

## XBMC workaround
import _json
if not 'load' in dir(_json):
    import simplejson as _json
    
    
from library import utils


#### Constants & initialization
buggalo.SUBMIT_URL = 'http://buggalo.tvaddons.ag/submit.php'                    # Official XBMC error report generator
ADDON_NAME = 'plugin.video.XBMCKaraoke'                                         # Addon namespace
__addon__ = xbmcaddon.Addon(ADDON_NAME)                                         # Initializing addon properties
__t0mm0addon__ = Addon(ADDON_NAME, sys.argv)                                    # Initializing addon properties
__language__ = __addon__.getLocalizedString


__addonname__   = __addon__.getAddonInfo('name')                                # Humanly readable addon name
PATH = xbmc.translatePath(__addon__.getAddonInfo('path')).decode('utf-8')       # Path where the addon resides (needs absolute paths)
TEMP_DL_DIR =  'tempdl'                                                         # Temp download directory. No write permissions in special://temp so using folder inside the addon
jsonurl = 'http://api.xbmckaraoke.com/'                                         # PHP JSON website (database)
url = None                                                                      # Standard value
donotloaddir = 0                                                                # Standard value

THEME = __t0mm0addon__.get_setting('theme')                                     # Theme settings
THEME_PATH = os.path.join(PATH, 'art', 'themes', THEME)                         # Theme dir


Пример #28
0
# ===================================================================
# --- #
# ===================================================================
import os,sys,re,socket
import xbmcplugin,xbmcaddon,xbmc
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
# ===================================================================
Пример #29
0
from __future__ import unicode_literals
from resources.lib.modules import client,webutils
import re,urlparse,json,sys,os, json

from addon.common.addon import Addon
addon = Addon('plugin.video.castaway', sys.argv)

AddonPath = addon.get_path()
IconPath = AddonPath + "/resources/media/"
def icon_path(filename):
    return os.path.join(IconPath, filename)

class info():
    def __init__(self):
    	self.mode = 'zizo'
        self.name = 'zizo.entejsites.com (full matches & highlights)'
        self.icon = icon_path('zizo.jpg')
        self.paginated = True
        self.categorized = True
        self.multilink = True


class main():
	def __init__(self,url = 'http://zizo.entejsites.com'):
		self.base = 'http://zizo.entejsites.com'
		self.url = url


	def categories(self):
		cats = [('http://zizo.entejsites.com/category/premier-league-full-matches-online/', 'Premier League', 'http://zizo.entejsites.com/wp-content/uploads/2015/04/barclays-premier-league-fixtures1.jpg'),
				('http://zizo.entejsites.com/category/seria-a-full-matches-online/', 'Seria A','http://zizo.entejsites.com/wp-content/uploads/2015/04/serie-a-27-giornata-risultati-e-classifica_1_big1.jpg'),
Пример #30
0
# TVADDONS.ag / TVADDONS.ag - Addon Installer - Module By: Blazetamer (2013-2014)
# Thanks to Blazetamer, Eleazar Coding, Showgun,  ....
siteTitle="TVADDONS.AG"; #siteTitle="XBMCHUB.COM"; 
addon_id='plugin.program.addoninstaller'; import urllib,urllib2,re,xbmcplugin,xbmcgui,xbmc,xbmcaddon,os,sys,time,shutil,downloader,extract
base_url2='http://addons.tvaddons.ag'; #'http://addons.xbmchub.com'
tribeca_url2='http://tribeca.tvaddons.ag/tools/'; #tribeca_url2='http://tribeca.xbmchub.com/tools/'; 
tribeca_url=tribeca_url2+'installer/sources/'; base_url=base_url2+'/'; 
try: 			from addon.common.addon 	import Addon
except:
    try: 		from t0mm0.common.addon import Addon
    except: from t0mm0_common_addon import Addon
addon=Addon(addon_id,sys.argv)
try: 			from addon.common.net 	import Net
except:
    try: 		from t0mm0.common.net import Net
    except: from t0mm0_common_net import Net
net=Net(); settings=xbmcaddon.Addon(id=addon_id); ADDON=xbmcaddon.Addon(id=addon_id); 
artPath=xbmc.translatePath(os.path.join('special://home','addons',addon_id,'resources','art2/')); 
def getArtwork(n): return xbmc.translatePath(os.path.join('special://home','addons',addon_id,'art2',n))
def getArtworkJ(n): return xbmc.translatePath(os.path.join('special://home','addons',addon_id,'art2',n+'.jpg'))
def catArtwork(n): return 'http://addons.tvaddons.ag/images/categories/%s.png'%n

mainPath=xbmc.translatePath(os.path.join('special://home','addons',addon_id)); 
fanart=xbmc.translatePath(os.path.join(mainPath,'fanart.jpg')); #fanart=artPath+'fanart.jpg'; #fanart=xbmc.translatePath(os.path.join('special://home','addons',addon_id+'/'))+'fanart.jpg'; #fanart=getArtworkJ('fanart')
iconart=xbmc.translatePath(os.path.join(mainPath,'icon.png')); #print ['fanart',fanart,'iconart',iconart]; 
TxtAddonUpdater='Addon Updater'; ImgAddonUpdater=getArtworkJ('autoupdater'); 
#****************************************************************
def MAININDEX():
    hubpath=xbmc.translatePath(os.path.join('special://home','addons','repository.xbmchub'))
    hubnotespath=xbmc.translatePath(os.path.join('special://home','addons','plugin.program.xbmchub.notifications'))
    try:
Пример #31
0
# -*- coding: utf-8 -*-
# ErosNow.com video addon
#

import requests, json, re, os, random
import xbmc
import xbmcplugin
import xbmcgui
import xbmcaddon
import urllib
import urllib2
from addon.common.addon import Addon

addon_id = 'plugin.video.erosnow-rain'
addon = Addon(addon_id, sys.argv)
Addon = xbmcaddon.Addon(addon_id)

language = (Addon.getSetting('langType')).lower()

dialog = xbmcgui.Dialog()

if (language=='all'):
	language2 = ''
else:
	language2 = 'language='+language[0:3]+'&'

USERAGENT   = 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0'
headers = {'User-Agent': USERAGENT, 'Accept':"*/*", 'Accept-Encoding':'gzip,deflate,br', 'Accept-Language':'en-US,en;q=0.8', 'X-Requested-With':'XMLHttpRequest'}
	
s=requests.Session()
Пример #32
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 sys
import xbmcgui
import time
import xbmc
import os
import utils
from trans_utils import i18n
from trakt_api import Trakt_API
from addon.common.addon import Addon

_SALTS = Addon('plugin.video.salts', sys.argv)
ICON_PATH = os.path.join(_SALTS.get_path(), 'icon.png')
use_https = _SALTS.get_setting('use_https') == 'true'
trakt_timeout = int(_SALTS.get_setting('trakt_timeout'))

def get_pin():
    AUTH_BUTTON = 200
    LATER_BUTTON = 201
    NEVER_BUTTON = 202
    ACTION_PREVIOUS_MENU = 10
    ACTION_BACK = 92
    CENTER_Y = 6
    CENTER_X = 2
    
    class PinAuthDialog(xbmcgui.WindowXMLDialog):
        auth = False
Пример #33
0
import xbmc, xbmcgui
import urllib, urllib2
import re
import HTMLParser
from elementtree.ElementTree import parse

try:
    from addon.common.addon import Addon
    from addon.common.net import Net
except:
    xbmc.log('Failed to import script.module.addon.common, attempting t0mm0.common')
    xbmcgui.Dialog().ok("Import Failure", "Failed to import addon.common", "A component needed by this addon is missing on your system", "Please visit www.xbmc.org for support")


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

##### Queries ##########
play = addon.queries.get('play', None)
mode = addon.queries['mode']
url = addon.queries.get('url', None)
page_num = addon.queries.get('page_num', None)

addon.log('-----------------RedLetterMedia Addon Params------------------')
addon.log('--- Version: ' + str(addon.get_version()))
addon.log('--- Mode: ' + str(mode))
addon.log('--- Play: ' + str(play))
addon.log('--- URL: ' + str(url))
addon.log('--- Page: ' + str(page_num))
addon.log('---------------------------------------------------------------')
Пример #34
0
addon_id = 'plugin.video.tgun'

#Common Cache
# plugin constants
dbg = False # Set to false if you don't want debugging

#Common Cache
try:
  import StorageServer
except Exception, e:
  import storageserverdummy as StorageServer
cache = StorageServer.StorageServer(addon_id)


##### XBMC  ##########
addon = Addon(addon_id, sys.argv)
datapath = addon.get_profile()


##### Paths ##########
cookie_path = os.path.join(datapath, 'cookies')
cookie_jar = os.path.join(cookie_path, "cookiejar.lwp")
if os.path.exists(cookie_path) == False:
    os.makedirs(cookie_path)

##### Queries ##########
play = addon.queries.get('play', None)
mode = addon.queries['mode']
page_num = addon.queries.get('page_num', None)
url = addon.queries.get('url', None)
Пример #35
0
import sys
import simplejson as simplejson 

import urllib, re
from datetime import datetime
import time
from addon.common.net import Net  
from addon.common.addon import Addon       
from threading import Thread
try:
    import Queue as queue
except ImportError:
    import queue
net = Net()
addon = Addon('script.module.metahandler')

class TMDB(object):
    '''
    This class performs TMDB and IMDB lookups.
    
    First call is made to TMDB by either IMDB ID or Name/Year depending on what is supplied. If movie is not found
    or if there is data missing on TMDB, another call is made to IMDB to fill in the missing information.       
    '''  
    
    def __init__(self, api_key='', view='json', lang='en'):
        #view = yaml json xml
        self.view = view
        self.lang = lang
        self.api_key = api_key
        self.url_prefix = 'http://api.themoviedb.org/3'
Пример #36
0
import re
import sys
import time
import datetime
import json
import _strptime  # fix bug in python import
import xbmc
import xbmcgui
import xbmcplugin
from addon.common.addon import Addon
import strings

DAY_NUMS = list('0123456')
DAY_CODES = ['M', 'T', 'W', 'H', 'F', 'Sa', 'Su']

_1CH = Addon('plugin.video.1channel')
ICON_PATH = os.path.join(_1CH.get_path(), 'icon.png')


def enum(**enums):
    return type('Enum', (), enums)


MODES = enum(SAVE_FAV='SaveFav',
             DEL_FAV='DeleteFav',
             GET_SOURCES='GetSources',
             PLAY_SOURCE='PlaySource',
             CH_WATCH='ChangeWatched',
             PLAY_TRAILER='PlayTrailer',
             SEARCH_QUERY='GetSearchQuery',
             DESC_QUERY='GetSearchQueryDesc',