def download(path, reponame):
    """
	Parameters
	----------
	path : string
		Link download zip repo.
	reponame : string
		Tên thư mục của repo để kiểm tra đã cài chưa.
		Mặc định được gán cho item["label2"].
		Truyền "" để bỏ qua Kiểm tra đã cài
	"""
    if reponame == "":
        reponame = "temp"
        repo_zip = xbmc.translatePath(os.path.join(tmp, "%s.zip" % reponame))
        urllib.urlretrieve(path, repo_zip)
        with contextlib.closing(zipfile.ZipFile(repo_zip, "r")) as z:
            z.extractall(addons_folder)
    else:
        repo_path = xbmc.translatePath("special://home/addons/%s" % reponame)
        if not os.path.isdir(repo_path):
            if reponame == "":
                reponame = "temp"
            repo_zip = xbmc.translatePath(os.path.join(tmp, "%s.zip" % reponame))
            urllib.urlretrieve(path, repo_zip)
            with contextlib.closing(zipfile.ZipFile(repo_zip, "r")) as z:
                z.extractall(addons_folder)
Example #2
0
def download(download_path, repo_id):
    '''
	Parameters
	----------
	path : string
		Link download zip repo.
	repo_id : string
		Tên thư mục của repo để kiểm tra đã cài chưa.
		Mặc định được gán cho item["label2"].
		Truyền "" để bỏ qua Kiểm tra đã cài
	'''
    if repo_id == "":
        repo_id = "temp"
    if ":/" not in repo_id:
        zipfile_path = xbmc.translatePath(os.path.join(tmp,
                                                       "%s.zip" % repo_id))
        urllib.urlretrieve(download_path, zipfile_path)
        with zipfile.ZipFile(zipfile_path, "r") as z:
            z.extractall(addons_folder)
    else:
        zipfile_path = xbmc.translatePath(
            os.path.join(tmp, "%s.zip" % repo_id.split("/")[-1]))
        urllib.urlretrieve(download_path, zipfile_path)
        with zipfile.ZipFile(zipfile_path, "r") as z:
            z.extractall(xbmc.translatePath("/".join(repo_id.split("/")[:-1])))
Example #3
0
def download(urlvideo):
    try:
        from YDStreamExtractor import getVideoInfo
        from YDStreamExtractor import handleDownload
        info = getVideoInfo(urlvideo, resolve_redirects=True)
        dlpath = plugin.get_setting('downloadpath')
        if not os.path.exists(dlpath):
            dlpath = xbmc.translatePath("home://")
        handleDownload(info, bg=True, path=dlpath)
    except:
        plugin.notify(urlvideo, "Download Failed")
Example #4
0
def download(download_path, repo_id):
	'''
	Parameters
	----------
	path : string
		Link download zip repo.
	repo_id : string
		Tên thư mục của repo để kiểm tra đã cài chưa.
		Mặc định được gán cho item["label2"].
		Truyền "" để bỏ qua Kiểm tra đã cài
	'''
	if repo_id == "":
		repo_id = "temp"
	if ":/" not in repo_id:
		zipfile_path = xbmc.translatePath(os.path.join(tmp, "%s.zip" % repo_id))
		urllib.urlretrieve(download_path, zipfile_path)
		with zipfile.ZipFile(zipfile_path, "r") as z:
			z.extractall(addons_folder)
	else:
		zipfile_path = xbmc.translatePath(
			os.path.join(tmp, "%s.zip" % repo_id.split("/")[-1]))
		urllib.urlretrieve(download_path, zipfile_path)
		with zipfile.ZipFile(zipfile_path, "r") as z:
			z.extractall(xbmc.translatePath("/".join(repo_id.split("/")[:-1])))
Example #5
0
def download(vurl=None):
    if vurl is None:
        return []
    if vurl.find("%20") != -1 or vurl.find("+") != -1:
        vurl = Unquote(vurl)
    try:
        from YDStreamExtractor import getVideoInfo
        from YDStreamExtractor import handleDownload
        info = getVideoInfo(vurl, resolve_redirects=True)
        playurl = info.streamURL
        dlpath = plugin.get_setting('downloadPath')
        if not os.path.exists(dlpath):
            dlpath = xbmc.translatePath("home://")
        handleDownload(info, bg=True, path=dlpath)
        plugin.log.info(msg="** DOWNLOAD VIDEO AT {0} **".format(vurl))
        plugin.log.info(msg=playurl)
        plugin.log.info(msg=str(repr(info)))
    except:
        plugin.notify(vurl, "Download Failed")
Example #6
0
def download(vurl=None):
    if vurl is None:
        return []
    if vurl.find("%20") != -1 or vurl.find("+") != -1:
        vurl = Unquote(vurl)
    try:
        from YDStreamExtractor import getVideoInfo
        from YDStreamExtractor import handleDownload
        info = getVideoInfo(vurl, resolve_redirects=True)
        playurl = info.streamURL
        dlpath = plugin.get_setting('downloadPath')
        if not os.path.exists(dlpath):
            dlpath = xbmc.translatePath("home://")
        handleDownload(info, bg=True, path=dlpath)
        plugin.log.info(msg="** DOWNLOAD VIDEO AT {0} **".format(vurl))
        plugin.log.info(msg=playurl)
        plugin.log.info(msg=str(repr(info)))
    except:
        plugin.notify(vurl, "Download Failed")
Example #7
0
# -*- coding: utf-8 -*-
from kodiswift import Plugin, xbmc, xbmcgui, xbmcaddon, xbmcplugin, xbmcvfs, xbmcmixin, ListItem
import json, sys, os, os.path as path, urllib, urllib2, re
from operator import itemgetter
plugin = Plugin()
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
if __addondir__.startswith('/var'): __addondir__ = '/Users/jezza/PycharmProjects/repo-gaymods/plugin.video.hubgay/'
__resdir__ = path.join(__addondir__, 'resources')
__imgsearch__ = path.join(__resdir__, 'search.png')
urlbase = "http://www.spankwire.com/api/HubTrafficApiCall?"
caturl = urlbase + "data=getCategoriesList&output=json&segment=gay"
catvidsurl = urlbase + "data=searchVideos&output=json&thumbsize=small&count=100&segment=gay&search=&tags=&category={0}"
searchurl = urlbase + "data=searchVideos&output=json&thumbsize=small&count=100&segment=gay&search={0}&tags=&category="
thumbcaturl = "http://cdn2.static.spankwire.com/images/category/Gay/{0}.jpg"
APIURLS = {"gaytube": "http://www.gaytube.com/api/webmasters/search/?ordering=newest&period=alltime&thumbsize=all&count=100&page=1&tags[]=&search=", "pornhub": "http://www.pornhub.com/webmasters/search?id=44bc40f3bc04f65b7a35&search=&tags[]=gay&page=1&thumbsize=medium", "redtube": "http://api.redtube.com/?data=redtube.Videos.searchVideos&output=json&search=&tags[]=gay&page=1&thumbsize=medium", "spankwire": "http://www.spankwire.com/api/HubTrafficApiCall?data=searchVideos&output=json&search=&tags=gay&thumbsize=medium&page=1&segment=gay&count=100", "tube8": "http://api.tube8.com/api.php?action=searchVideos&output=json&search=gay&thumbsize=all&page=1&orientation=gay", "xtube": "http://www.xtube.com/webmaster/api.php?action=getVideosBySearchParams&tags=gay&count=100&thumbsize=400x300&fields=rating,username,title,tags,duration,thumbnail,url,embed,categories&page=1&search=", "youporn": "http://www.youporn.com/api/webmasters/search?search=&page=1&tags[]=gay&thumbsize=medium"}

def makeFolderItems(itemlist):
    litems = []
    for item in itemlist:
        assert isinstance(item, dict)
        litems.append(dict(path=item.get('path')))
    return litems

def makeItemExtraThumbs(item, vid):
    getsrc = itemgetter('src')
    xitem = plugin._listitemify(item=item)
    img = []
    thumbslist = vid.get('thumbs')
    if thumbslist.has_key('big'):
        img = thumbslist.get('big')
    else:
Example #8
0
# -*- coding: utf-8 -*-
import os, sys, ssl, time, datetime, json
from kodiswift import Plugin, ListItem, xbmc, xbmcgui, xbmcvfs, xbmcaddon, xbmcplugin, xbmcmixin
from resources.lib import getoauth, TUMBLRAUTH, TumblrRestClient, tumblrsearch
from collections import namedtuple

try:
    from xbmcutil import viewModes
except:
    pass
tclient = TumblrRestClient
viewmode = 20
APIOK = False
plugin = Plugin(name="TumblrV", addon_id="plugin.video.tumblrv", plugin_file="addon.py", info_type="video")
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = os.path.join(__addondir__, 'resources')
__imgdir__ = os.path.join(__resdir__, 'images')
__imgsearch__ = os.path.join(__imgdir__, 'search.png')
__imgnext__ = os.path.join(__imgdir__, 'next.png')
__imgtumblr__ = os.path.join(__imgdir__, 'tumblr.png')
tagpath = os.path.join(xbmc.translatePath('special://profile/addon_data/'), 'plugin.video.tumblrv', 'tagslist.json')
weekdelta = datetime.timedelta(days=7)
updatedelta = datetime.timedelta(minutes=10)
import web_pdb


def doDebug():
    return bool(plugin.get_setting(key='debugon', converter=bool))


def _json_object_hook(d):
Example #9
0
from kodiswift import Plugin, ListItem, xbmc, xbmcgui, xbmcvfs, xbmcaddon, xbmcplugin, xbmcmixin
from resources.lib import getoauth, TUMBLRAUTH, TumblrRestClient, tumblrsearch
from collections import namedtuple

try:
    from xbmcutil import viewModes
except:
    pass
tclient = TumblrRestClient
viewmode = 20
APIOK = False
plugin = Plugin(name="TumblrV",
                addon_id="plugin.video.tumblrv",
                plugin_file="addon.py",
                info_type="episodes")
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = os.path.join(__addondir__, 'resources')
__imgdir__ = os.path.join(__resdir__, 'images')
__imgsearch__ = os.path.join(__imgdir__, 'search.png')
__imgnext__ = os.path.join(__imgdir__, 'next.png')
__imgtumblr__ = os.path.join(__imgdir__, 'tumblr.png')
tagpath = os.path.join(xbmc.translatePath('special://profile/addon_data/'),
                       'plugin.video.tumblrv', 'tagslist.json')
weekdelta = datetime.timedelta(days=7)
updatedelta = datetime.timedelta(minutes=10)
import web_pdb


def doDebug():
    return bool(plugin.get_setting(key='debugon', converter=bool))
Example #10
0
# -*- coding: utf-8 -*-
# https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-web-api-v7-reference
from kodiswift import Plugin, xbmc
from urllib import quote_plus as Quote, unquote_plus as Unquote
import webutil
import sys, os, os.path as path
import json
plugin = Plugin()
APIKEY = plugin.get_setting('apikey')
tplWho = '( jovenes OR chavalo OR chavo OR amigo OR hombre OR hermano OR novinho OR chico OR chavalito )'
tplWhat = '( mecos OR masturbo OR masturbandose OR batendo OR paja OR follando OR cogiendo OR cojiendo OR sobarse OR punheta OR verga OR lefa )'
tplWhere = '( flagra OR flagrou OR trabajo OR publico OR biblioteca OR aula OR "en clase" OR escuela OR omnibus OR autobus OR viajandor )'
tplWank = '( wank OR wanking OR wanked OR stroke OR stroking OR jerk OR jack OR m********e OR masturbating OR cumming OR cum OR jackoff OR jerkoff OR handjob )'
searchq = tplWhere + ' AND ' + tplWhat + ' ' + tplWho
cpath = path.join(xbmc.translatePath('special://userdata'), 'cookies.lwp')
dl = webutil.DemystifiedWebRequest(cookiePath=cpath)
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = os.path.join(__addondir__, 'resources')
__imgdir__ = os.path.join(__resdir__, 'images')
__imgsearch__ = os.path.join(__imgdir__, 'search.png')
__imgnext__ = os.path.join(__imgdir__, 'next.png')
__imgback__ = os.path.join(__imgdir__, 'back.png')
__imgtumblr__ = os.path.join(__imgdir__, 'tumblr.png')


@plugin.route('/')
def index():
    itemnew = {
        'label': 'New Bing Video Search!',
        'icon': __imgsearch__,
        'thumbnail': __imgsearch__,
Example #11
0
def InstallRepo(path="0", tracking_string=""):
    '''
	Cài đặt repo
	Parameters
	----------
	path : string
		Nếu truyền "gid" của Repositories sheet:
			Cài tự động toàn bộ repo trong Repositories sheet
		Nếu truyền link download zip repo
			Download và cài zip repo đó
	tracking_string : string
		 Tên dễ đọc của view
	'''
    GA(  # tracking
        "Install Repo - %s" % tracking_string, "/install-repo/%s" % path)
    if path.isdigit():  # xác định GID
        pDialog = xbmcgui.DialogProgress()
        pDialog.create('Vui lòng đợi', 'Bắt đầu cài repo', 'Đang tải...')
        items = getItems(path)
        total = len(items)
        i = 0
        failed = []
        installed = []
        for item in items:
            done = int(100 * i / total)
            pDialog.update(done, 'Đang tải', item["label"] + '...')
            if ":/" not in item["label2"]:
                result = xbmc.executeJSONRPC(
                    '{"jsonrpc":"2.0","method":"Addons.GetAddonDetails", "params":{"addonid":"%s", "properties":["version"]}, "id":1}'
                    % item["label"])
                json_result = json.loads(result)
                if "version" in result and version_cmp(
                        json_result["result"]["addon"]["version"],
                        item["label2"]) >= 0:
                    pass
                else:
                    try:
                        item["path"] = "http" + item["path"].split("http")[-1]
                        download(urllib.unquote_plus(item["path"]),
                                 item["label"])
                        installed += [item["label"].encode("utf-8")]
                    except:
                        failed += [item["label"].encode("utf-8")]
            else:
                if not os.path.exists(xbmc.translatePath(item["label2"])):
                    try:
                        item["path"] = "http" + item["path"].split("http")[-1]
                        download(urllib.unquote_plus(item["path"]),
                                 item["label2"])
                        installed += [item["label"].encode("utf-8")]
                    except:
                        failed += [item["label"].encode("utf-8")]

            if pDialog.iscanceled():
                break
            i += 1
        pDialog.close()
        if len(failed) > 0:
            dlg = xbmcgui.Dialog()
            s = "Không thể cài các rep sau:\n[COLOR orange]%s[/COLOR]" % "\n".join(
                failed)
            dlg.ok('Chú ý: Không cài đủ repo!', s)
        else:
            dlg = xbmcgui.Dialog()
            s = "Tất cả repo đã được cài thành công\n%s" % "\n".join(installed)
            dlg.ok('Cài Repo thành công!', s)

    else:  # cài repo riêng lẻ
        try:
            download(path, "")
            dlg = xbmcgui.Dialog()
            s = "Repo %s đã được cài thành công" % tracking_string
            dlg.ok('Cài Repo thành công!', s)
        except:
            dlg = xbmcgui.Dialog()
            s = "Vùi lòng thử cài lại lần sau"
            dlg.ok('Cài repo thất bại!', s)

    xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
    xbmc.executebuiltin("XBMC.UpdateAddonRepos()")
#!/usr/bin/python
# coding=utf-8
import httplib2, json, re, urllib, os, uuid, contextlib, zipfile

# Tham khảo kodiswift framework cho kodi addon tại
# https://github.com/Sinap/kodiswift
from kodiswift import Plugin, xbmc, xbmcaddon, xbmcgui

path = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo("path")).decode("utf-8")
cache = xbmc.translatePath(os.path.join(path, ".cache"))
tmp = xbmc.translatePath("special://temp")
addons_folder = xbmc.translatePath("special://home/addons")

plugin = Plugin()
addon = xbmcaddon.Addon("plugin.video.thongld.vnplaylist")
pluginrootpath = "plugin://plugin.video.thongld.vnplaylist"
http = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers = {
    "User-Agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
    "Accept-Encoding": "gzip, deflate, sdch, br",
}


def M3UToItems(url_path=""):
    """
	Hàm chuyển đổi m3u playlist sang kodiswift items
	Parameters
	----------
	url_path : string
		link chứa nội dung m3u playlist
Example #13
0
# -*- coding: utf-8 -*-
import json
import os.path as path
import re
import urllib, urllib2
from operator import itemgetter
from kodiswift import Plugin, xbmc, ListItem

plugin = Plugin()
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = path.join(__addondir__, 'resources')
__imgsearch__ = path.join(__resdir__, 'search.png')


def makeVideoItems(itemlist):
    """
    Takes a list of dict's returned from the API and looks for the specific fields to build XBMC ListItem for each item
    :param itemlist:
    :return: List of dict(Label, Label2, Icon, Thumb, Path) items created for each dict returned from the API
    """
    litems = []
    vitem = dict()
    vid = dict()
    item = dict()
    getsrc = itemgetter('src')
    try:
        for vitem in itemlist:
            assert isinstance(vitem, dict)
            if vitem.has_key('video'):
                vid = vitem.get('video')
            else:
Example #14
0
import xbmcaddon
import requests
import copy
import platform
import os


# Global vars
plugin = Plugin()
addon = plugin.addon

USER_AGENT = "Kodi ("+platform.system() + ") hearthis.at-Plugin/" + addon.getAddonInfo('version')
HEARTHIS = 'hearthis.at'
API_BASE_URL = "https://api-v2.hearthis.at/"
USER = plugin.get_storage('user_data')
ADDON_PATH = xbmc.translatePath(addon.getAddonInfo('path')).decode('utf-8')

STRINGS = {
        'genres'        : 30000,
        'playlists'     : 30001,
        'show_artist'   : 30002,
        'recently_added': 30003,
        'search'        : 30004,
        'search_artist' : 30005,
        'next'          : 30006,
        'likes'         : 30007,
        'popular'       : 30008,
        'search_track'  : 30009,
        'previous'      : 30010,
        'no_elements'   : 30011,
        'add_like'      : 30012,
Example #15
0
import json
import sqlite3
import time
try:
    from ChineseKeyboard import Keyboard
except Exception, e:
    print e
    from xbmc import Keyboard

ADDON = xbmcaddon.Addon()
ADDON_ID = ADDON.getAddonInfo('id')
ADDON_ICON = ADDON.getAddonInfo('icon')
ADDON_NAME = ADDON.getAddonInfo('name')
ADDON_PATH = ADDON.getAddonInfo('path').decode("utf-8")
ADDON_VERSION = ADDON.getAddonInfo('version')
ADDON_DATA_PATH = xbmc.translatePath("special://profile/addon_data/%s" %
                                     ADDON_ID).decode("utf-8")
sys.path.append(os.path.join(ADDON_PATH, 'resources', 'lib'))
sys.path.append(os.path.join(ADDON_PATH, 'database'))
from highporn import *
from common import *
from videodb import VideoDB
from videodb_functions import VideoDB_Functions

plugin = Plugin()
HighPorn = HighPorn()
DB_FILE = ADDON_PATH + "/database/japanmovies.db"

print sys.argv


# main entrance
Example #16
0
# -*- coding: utf-8 -*-
import os
import time
from resources.lib.utils import *
from kodiswift import Plugin, xbmcgui, xbmc

plugin = Plugin()
last_category = None

_lang = plugin.get_string

os_name = get_os_name()
os_is_android = None

NATIVE_PATH = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
DEFAULT_API_URL = plugin.get_setting('api_url', str)

# try:
#     import hashlib
#     CACHE_ID_SUFFIX = '-' + hashlib.md5(CUSTOM_API_URL.encode('utf-8')).hexdigest()
# except Exception as ex:
#     log("SiTo.tv hashlib error: %s" % ex, level=xbmc.LOGERROR)
#     CACHE_ID_SUFFIX = '-' + CUSTOM_API_URL.replace(':', '_').replace('/', '-').replace('\\', '-')

# sito.log = log
# sito.notice = notice
# sito.image_resource_url = image_resource_url
# sito.url_for = plugin.url_for
# sito.store = plugin.get_storage('basic_cache' + CACHE_ID_SUFFIX)
# sito.requests_cache = plugin.get_storage('requests_cache', ttl=60*4)
#
Example #17
0
def InstallRepo(path="0", tracking_string=""):
	'''
	Cài đặt repo
	Parameters
	----------
	path : string
		Nếu truyền "gid" của Repositories sheet:
			Cài tự động toàn bộ repo trong Repositories sheet
		Nếu truyền link download zip repo
			Download và cài zip repo đó
	tracking_string : string
		 Tên dễ đọc của view
	'''
	GA(  # tracking
		"Install Repo - %s" % tracking_string,
		"/install-repo/%s" % path
	)
	if path.isdigit():  # xác định GID
		pDialog = xbmcgui.DialogProgress()
		pDialog.create('Vui lòng đợi', 'Bắt đầu cài repo', 'Đang tải...')
		items = getItems(path)
		total = len(items)
		i = 0
		failed = []
		installed = []
		for item in items:
			done = int(100 * i / total)
			pDialog.update(done, 'Đang tải', item["label"] + '...')
			if ":/" not in item["label2"]:
				result = xbmc.executeJSONRPC(
					'{"jsonrpc":"2.0","method":"Addons.GetAddonDetails", "params":{"addonid":"%s", "properties":["version"]}, "id":1}' % item["label"])
				json_result = json.loads(result)
				if "version" in result and version_cmp(json_result["result"]["addon"]["version"], item["label2"]) >= 0:
					pass
				else:
					try:
						item["path"] = "http" + item["path"].split("http")[-1]
						download(urllib.unquote_plus(item["path"]), item["label"])
						installed += [item["label"].encode("utf-8")]
					except:
						failed += [item["label"].encode("utf-8")]
			else:
				if not os.path.exists(xbmc.translatePath(item["label2"])):
					try:
						item["path"] = "http" + item["path"].split("http")[-1]
						download(urllib.unquote_plus(item["path"]), item["label2"])
						installed += [item["label"].encode("utf-8")]
					except:
						failed += [item["label"].encode("utf-8")]

			if pDialog.iscanceled():
				break
			i += 1
		pDialog.close()
		if len(failed) > 0:
			dlg = xbmcgui.Dialog()
			s = "Không thể cài các rep sau:\n[COLOR orange]%s[/COLOR]" % "\n".join(
				failed)
			dlg.ok('Chú ý: Không cài đủ repo!', s)
		else:
			dlg = xbmcgui.Dialog()
			s = "Tất cả repo đã được cài thành công\n%s" % "\n".join(installed)
			dlg.ok('Cài Repo thành công!', s)

	else:  # cài repo riêng lẻ
		try:
			download(path, "")
			dlg = xbmcgui.Dialog()
			s = "Repo %s đã được cài thành công" % tracking_string
			dlg.ok('Cài Repo thành công!', s)
		except:
			dlg = xbmcgui.Dialog()
			s = "Vùi lòng thử cài lại lần sau"
			dlg.ok('Cài repo thất bại!', s)

	xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
	xbmc.executebuiltin("XBMC.UpdateAddonRepos()")
Example #18
0
import re
import urllib
import os
import uuid
import contextlib
import zipfile
import random
import base64
import time
import thread
import socket
from datetime import datetime
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from kodiswift import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path = xbmc.translatePath(
	xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
cache = xbmc.translatePath(os.path.join(path, ".cache"))
tmp = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin = Plugin()
#addon = xbmcaddon.Addon("plugin.video.vinh.livetv")
#pluginrootpath = "plugin://plugin.video.vinh.livetv"
addon = xbmcaddon.Addon("plugin.video.vinh.giaitritv")
pluginrootpath = "plugin://plugin.video.vinh.giatritv"
http = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers = {
	"User-Agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
	"Accept-Encoding": "gzip, deflate, sdch"
Example #19
0
import webutil as WebUtils
from kodiswift import Plugin, xbmc, ListItem

urlresolver = None
try:
    import resolveurl as urlresolver
except:
    try:
        import urlresolver as urlresolver
    except:
        urlresolver = None

plugin = Plugin()
ssl._create_default_https_context = ssl._create_unverified_context
__BASEURL__ = 'https://watchseries-online.be'
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__datadir__ = xbmc.translatePath('special://profile/addon_data/{0}/'.format(
    plugin.id))
__cookie__ = path.join(__datadir__, 'cookies.lwp')
__temp__ = path.join(__datadir__, 'temp/')
__resdir__ = path.join(__addondir__, 'resources')
__imgsearch__ = path.join(__resdir__, 'search.png')
__savedjson__ = path.join(
    xbmc.translatePath(plugin.addon.getAddonInfo('profile')),
    'savedshows.json')
getWeb = WebUtils.CachedWebRequest(path.join(__datadir__, 'cookies.lwp'),
                                   __temp__)

# Category Could be changed to use Category Sitemap
# https://watchseries-online.be/category-sitemap.xml
 def addon_path(self):
     return xbmc.translatePath(self.plugin.addon.getAddonInfo('path'))
import xbmcaddon
import requests
import copy
import platform
import os

# Global vars
plugin = Plugin()
addon = plugin.addon

USER_AGENT = "Kodi (" + platform.system(
) + ") hearthis.at-Plugin/" + addon.getAddonInfo('version')
HEARTHIS = 'hearthis.at'
API_BASE_URL = "https://api-v2.hearthis.at/"
USER = plugin.get_storage('user_data')
ADDON_PATH = xbmc.translatePath(addon.getAddonInfo('path')).decode('utf-8')

STRINGS = {
    'genres': 30000,
    'playlists': 30001,
    'show_artist': 30002,
    'recently_added': 30003,
    'search': 30004,
    'search_artist': 30005,
    'next': 30006,
    'likes': 30007,
    'popular': 30008,
    'search_track': 30009,
    'previous': 30010,
    'no_elements': 30011,
    'add_like': 30012,
Example #22
0
import re
import urllib
import os
import uuid
import contextlib
import zipfile
import random
import base64
import time
import thread
import socket
from datetime import datetime
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from kodiswift import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path = xbmc.translatePath(
    xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
cache = xbmc.translatePath(os.path.join(path, ".cache"))
tmp = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin = Plugin()
addon = xbmcaddon.Addon("plugin.video.family")
pluginrootpath = "plugin://plugin.video.family"
http = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers = {
    "User-Agent":
    "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
    "Accept-Encoding": "gzip, deflate, sdch"
}
Example #23
0
    def __init__(self,
                 name=None,
                 addon_id=None,
                 plugin_file=None,
                 info_type=None):
        """
        Args:
            name (Optional[str]): The name of the plugin, e.g. 'Hello Kodi'.
            addon_id (Optional[str): The Kodi addon ID for the plugin,
                e.g. 'plugin.video.hellokodi'. This parameter is now optional
                and is really only useful for testing purposes. If it is not
                provided, the correct value will be parsed from the
                addon.xml file.
            plugin_file (Optional[str]): If provided, it should be the path
                to the plugin.py file in the root of the addon directory.
                This only has an effect when kodiswift is running on the
                command line. Will default to the current working directory
                since kodiswift requires execution in the root addon directory
                anyway. The parameter still exists to ease testing.
            info_type (Optional[str):
        """
        self._name = name
        self._routes = []
        self._view_functions = {}
        self._addon = xbmcaddon.Addon()

        self._addon_id = addon_id or self._addon.getAddonInfo('id')
        self._name = name or self._addon.getAddonInfo('name')

        self._info_type = info_type
        if not self._info_type:
            types = {
                'video': 'video',
                'audio': 'music',
                'image': 'pictures',
            }
            self._info_type = types.get(self._addon_id.split('.')[1], 'video')

        # Keeps track of the added list items
        self._current_items = []

        # Gets initialized when self.run() is called
        self._request = None

        # A flag to keep track of a call to xbmcplugin.endOfDirectory()
        self._end_of_directory = False

        # Keep track of the update_listing flag passed to
        # xbmcplugin.endOfDirectory()
        self._update_listing = False

        # The plugin's named logger
        self._log = setup_log(self._addon_id)

        # The path to the storage directory for the addon
        self._storage_path = xbmc.translatePath(
            'special://profile/addon_data/%s/.storage/' % self._addon_id)
        if not os.path.isdir(self._storage_path):
            os.makedirs(self._storage_path)

        # If we are running in CLI, we need to load the strings.xml manually
        # Since kodiswift currently relies on execution from an addon's root
        # directly, we can rely on cwd for now...
        if kodiswift.CLI_MODE:
            from kodiswift.mockxbmc import utils
            if plugin_file:
                plugin_dir = os.path.dirname(plugin_file)
            else:
                plugin_dir = os.getcwd()
            strings_fn = os.path.join(plugin_dir, 'resources', 'language',
                                      'English', 'strings.po')
            utils.load_addon_strings(self._addon, strings_fn)
Example #24
0
# -*- coding: utf-8 -*-
# https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-web-api-v7-reference
from kodiswift import Plugin, xbmc, ListItem
from urllib import quote_plus as Quote, unquote_plus as Unquote
import webutil
import sys, os, os.path as path
import json
plugin = Plugin()
APIKEY=plugin.get_setting('apikey')
tplWho = '( jovenes OR chavalo OR chavo OR amigo OR hombre OR hermano OR novinho OR chico OR chavalito )'
tplWhat = '( mecos OR masturbo OR masturbandose OR batendo OR paja OR follando OR cogiendo OR cojiendo OR sobarse OR punheta OR verga OR lefa OR mear OR pipi )'
tplWhere = '( flagra OR flagrou OR trabajo OR publico OR biblioteca OR aula OR atrapado OR escuela OR omnibus OR autobus OR viajandor )'
tplWank = '( wank OR wanking OR wanked OR stroke OR stroking OR jerk OR jack OR m********e OR masturbating OR cumming OR cum OR jackoff OR jerkoff OR handjob )'
searchq = tplWhere + ' AND ' + tplWhat + ' ' + tplWho
cpath = path.join(xbmc.translatePath('special://userdata'), 'cookies.lwp')
dl = webutil.DemystifiedWebRequest(cookiePath=cpath)
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = os.path.join(__addondir__, 'resources')
__imgdir__ = os.path.join(__resdir__, 'images')
__imgsearch__ = os.path.join(__imgdir__, 'search.png')
__imgfav__ = os.path.join(__imgdir__, 'fav.png')
__imgnext__ = os.path.join(__imgdir__, 'next.png')
__imgback__ = os.path.join(__imgdir__, 'back.png')
__imgtumblr__ = os.path.join(__imgdir__, 'tumblr.png')

@plugin.route('/')
def index():
    itemnew = {
        'label': 'New Bing Video Search!',
        'icon': __imgsearch__, 'thumbnail': __imgsearch__,
        'path': plugin.url_for(endpoint=query, searchfor='NEW'),
Example #25
0
    def __init__(self, name=None, addon_id=None, plugin_file=None,
                 info_type=None):
        """
        Args:
            name (Optional[str]): The name of the plugin, e.g. 'Hello Kodi'.
            addon_id (Optional[str): The Kodi addon ID for the plugin,
                e.g. 'plugin.video.hellokodi'. This parameter is now optional
                and is really only useful for testing purposes. If it is not
                provided, the correct value will be parsed from the
                addon.xml file.
            plugin_file (Optional[str]): If provided, it should be the path
                to the plugin.py file in the root of the addon directory.
                This only has an effect when kodiswift is running on the
                command line. Will default to the current working directory
                since kodiswift requires execution in the root addon directory
                anyway. The parameter still exists to ease testing.
            info_type (Optional[str):
        """
        self._name = name
        self._routes = []
        self._view_functions = {}
        self._addon = xbmcaddon.Addon()

        self._addon_id = addon_id or self._addon.getAddonInfo('id')
        self._name = name or self._addon.getAddonInfo('name')

        self._info_type = info_type
        if not self._info_type:
            types = {
                'video': 'video',
                'audio': 'music',
                'image': 'pictures',
            }
            self._info_type = types.get(self._addon_id.split('.')[1], 'video')

        # Keeps track of the added list items
        self._current_items = []

        # Gets initialized when self.run() is called
        self._request = None

        # A flag to keep track of a call to xbmcplugin.endOfDirectory()
        self._end_of_directory = False

        # Keep track of the update_listing flag passed to
        # xbmcplugin.endOfDirectory()
        self._update_listing = False

        # The plugin's named logger
        self._log = setup_log(self._addon_id)

        # The path to the storage directory for the addon
        self._storage_path = xbmc.translatePath(
            'special://profile/addon_data/%s/.storage/' % self._addon_id)
        if not os.path.isdir(self._storage_path):
            os.makedirs(self._storage_path)

        # If we are running in CLI, we need to load the strings.xml manually
        # Since kodiswift currently relies on execution from an addon's root
        # directly, we can rely on cwd for now...
        if kodiswift.CLI_MODE:
            from kodiswift.mockxbmc import utils
            if plugin_file:
                plugin_dir = os.path.dirname(plugin_file)
            else:
                plugin_dir = os.getcwd()
            strings_fn = os.path.join(
                plugin_dir, 'resources', 'language', 'English', 'strings.po')
            utils.load_addon_strings(self._addon, strings_fn)
Example #26
0
import json
import re
import urllib
from urllib import quote_plus
import ssl
import requests
import webutil as WebUtils
#from xbmcswift2 import Plugin, xbmc, ListItem, download_page, clean_dict, SortMethod
from kodiswift import Plugin, xbmc, ListItem
#from xbmcswift2 import download_page, clean_dict, SortMethod


plugin = Plugin()
ssl._create_default_https_context = ssl._create_unverified_context
__BASEURL__ = 'https://watchseries-online.be'
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__datadir__ = xbmc.translatePath('special://profile/addon_data/{0}/'.format(plugin.id))
__cookie__ = path.join(__datadir__, 'cookies.lwp')
__temp__ = path.join(__datadir__, 'temp/')
__resdir__ = path.join(__addondir__, 'resources')
__imgsearch__ = path.join(__resdir__, 'search.png')
__savedjson__ = path.join(xbmc.translatePath(plugin.addon.getAddonInfo('profile')), 'savedshows.json')
getWeb = WebUtils.CachedWebRequest(path.join(__datadir__, 'cookies.lwp'), __temp__)


@plugin.route('/')
def index():
    litems = []
    plugin.set_content('episodes')
    itemlatest = {'label': 'Latest Episodes', 'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png',
                  'path': plugin.url_for(latest, offset=0, urlpath='last-350-episodes')}
Example #27
0
import json
import re
import urllib
from urllib import quote_plus
import ssl
import requests
import webutil as WebUtils
#from xbmcswift2 import Plugin, xbmc, ListItem, download_page, clean_dict, SortMethod
from kodiswift import Plugin, xbmc, ListItem
from xbmcswift2 import download_page, clean_dict, SortMethod


plugin = Plugin()
ssl._create_default_https_context = ssl._create_unverified_context
__BASEURL__ = 'https://watchseries-online.pl'
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__datadir__ = xbmc.translatePath('special://profile/addon_data/{0}/'.format(plugin.id))
__cookie__ = path.join(__datadir__, 'cookies.lwp')
__temp__ = path.join(__datadir__, 'temp/')
__resdir__ = path.join(__addondir__, 'resources')
__imgsearch__ = path.join(__resdir__, 'search.png')
__savedjson__ = path.join(xbmc.translatePath(plugin.addon.getAddonInfo('profile')), 'savedshows.json')
getWeb = WebUtils.CachedWebRequest(path.join(__datadir__, 'cookies.lwp'), __temp__)


@plugin.route('/')
def index():
    litems = []
    plugin.set_content('episodes')
    itemlatest = {'label': 'Latest Episodes', 'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png',
                  'path': plugin.url_for(latest, offset=0, urlpath='last-350-episodes')}