# -*- coding: utf-8 -*- from __future__ import unicode_literals # noinspection PyUnresolvedReferences from codequick import Route, Resolver, Listitem, utils, run import urlquick # Localized string Constants TAGS = 20459 FEATURED_VIDEO = 30001 # Base url constructor BASE_URL = "https://www.watchmojo.com" url_constructor = utils.urljoin_partial(BASE_URL) # ###### Functions ###### # def extract_videos(lbl_tags, elem, date_format): item = Listitem() item.label = elem.findtext(".//div[@class='hptitle']").replace("\t", " ").strip() item.art["thumb"] = url_constructor(elem.find(".//img").get("src")) duration = elem.find(".//img[@class='hpplay']") if duration is not None and duration.tail: item.info["duration"] = duration.tail.strip(";") date = elem.findtext(".//div[@class='hpdate']").strip() if date: item.info.date(date, date_format)
import inputstreamhelper import json import os import re import urlquick from itertools import chain from kodi_six import xbmc from kodi_six import xbmcgui from kodi_six import xbmcplugin # TO DO # Readd Playlist (if needed) # Add more infos videos (saison, episodes, casts, etc ...) # Find a way to get Id for each API call URL_ROOT = utils.urljoin_partial("https://www.tf1.fr") URL_VIDEO_STREAM = 'https://delivery.tf1.fr/mytf1-wrd/%s?format=%s' # videoId, format['hls', 'dash'] URL_LICENCE_KEY = 'https://drm-wide.tf1.fr/proxy?id=%s|Content-Type=&User-Agent=Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3041.0 Safari/537.36&Host=drm-wide.tf1.fr|R{SSM}|' # videoId URL_API = 'https://www.tf1.fr/graphql/web' DESIRED_QUALITY = Script.setting['quality'] VIDEO_TYPES = {'Replay': 'replay', 'Extrait': 'extract', 'Exclu': 'bonus'} @Route.register
# 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from __future__ import unicode_literals from codequick import Route, Resolver, Listitem, run, utils import urlquick # Localized string Constants TAGS = 20459 # Base url constructor url_constructor = utils.urljoin_partial("https://www.watchmojo.com") # ###### Functions ###### # def extract_videos(lbl_tags, elem, date_format): item = Listitem() item.label = elem.findtext(".//div[@class='hptitle']").replace("\t", " ").strip() item.art["thumb"] = url_constructor(elem.find(".//img").get("src")) duration = elem.find(".//img[@class='hpplay']") if duration is not None and duration.tail: item.info["duration"] = duration.tail.strip(";") url = elem.find("a").get("href") item.info.date(elem.findtext(".//div[@class='hpdate']").strip(), date_format)
from codequick import Route, Resolver, Listitem, utils import urlquick import json import re from kodi_six import xbmcgui from resources.lib.labels import LABELS from resources.lib import download from resources.lib import resolver_proxy from resources.lib.menu_utils import item_post_treatment # TO DO # Fix Bonus URL_ROOT = utils.urljoin_partial('https://mytaratata.com') URL_EMBED_FTV = 'http://api-embed.webservices.francetelevisions.fr/key/%s' # Id Video # http://embed.francetv.fr/?ue=fb23d5e2c7e5c020b2e710c5fe233aea SHOW_INFO_FTV = 'https://api-embed.webservices.francetelevisions.fr/v2/key/%s' # idEmbeded def website_entry(plugin, item_id, **kwargs): """ First executed function after website_bridge """ return root_taratata(plugin, item_id)
from __future__ import unicode_literals from builtins import str import re from codequick import Route, Resolver, Listitem, utils import urlquick from resources.lib import resolver_proxy from resources.lib.menu_utils import item_post_treatment # TO DO # Play Spanish Videos URL_ROOT = utils.urljoin_partial('https://www.tetesaclaques.tv') def website_entry(plugin, item_id, **kwargs): """ First executed function after website_bridge """ return root(plugin, item_id) def root(plugin, item_id, **kwargs): """Add modes in the listing""" resp = urlquick.get(URL_ROOT('')) root = resp.parse("li", attrs={"id": "menu-videos"}) for category in root.iterfind(".//li"):
from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest try: from html import unescape except ImportError: from six.moves.html_parser import HTMLParser HTML_PARSER = HTMLParser() unescape = HTML_PARSER.unescape """ Channels: * france.tv (https://www.france.tv/) """ URL_API_MOBILE = utils.urljoin_partial("https://api-mobile.yatta.francetv.fr/") URL_API_FRONT = utils.urljoin_partial("http://api-front.yatta.francetv.fr") @Route.register def francetv_root(plugin, **kwargs): # Channels item = Listitem() item.label = Script.localize(30006) item.set_callback(channels) item_post_treatment(item) yield item # Categories item = Listitem() item.label = Script.localize(30725)
from resources.lib import web_utils from resources.lib import resolver_proxy from resources.lib import download from resources.lib.menu_utils import item_post_treatment from resources.lib.kodi_utils import get_selected_item_art, get_selected_item_label, get_selected_item_info import json import time import urlquick from kodi_six import xbmcgui ''' Channels: * Franceinfo ''' URL_API = utils.urljoin_partial('http://api-front.yatta.francetv.fr') URL_LIVE_JSON = URL_API('standard/edito/directs') URL_JT_ROOT = 'https://stream.francetvinfo.fr/stream/program/list.json/origin/jt/support/long/page/1/nb/1000' URL_MAGAZINES_ROOT = 'https://stream.francetvinfo.fr/stream/program/list.json/origin/magazine/support/long/page/1/nb/1000' URL_AUDIO_ROOT = 'https://stream.francetvinfo.fr/stream/program/list.json/origin/audio/support/long/page/1/nb/1000' URL_STREAM_ROOT = 'https://stream.francetvinfo.fr' URL_VIDEOS_ROOT = 'https://stream.francetvinfo.fr/stream/contents/list/videos.json/support/long' URL_MODULES_ROOT = 'https://stream.francetvinfo.fr/stream/contents/list/videos-selection.json/support/long'
def test_urljoin_partial(self): url_constructor = utils.urljoin_partial("https://google.ie/") self.assertIsInstance(url_constructor, types.FunctionType) ret = url_constructor("/gmail") self.assertEqual(ret, "https://google.ie/gmail")
PERSONA_BASE_URL = "https://persona.hotstar.com" IMG_BASE = "https://img1.hotstar.com/image/upload" IMG_FANART_H_URL = IMG_BASE + "/f_auto,w_1920,h_1080/%s.jpg" IMG_POSTER_V_URL = IMG_BASE + "/f_auto,t_web_vl_3x/%s.jpg" IMG_THUMB_H_URL = IMG_BASE + "/f_auto,t_web_hs_3x/%s.jpg" BASE_HEADERS = {"x-country-code": "in", "x-platform-code": "ANDROID"} CONTENT_TYPE = { "MOVIE": "movies", "SHOW": "tvshows", "SEASON": "tvshows", "EPISODE": "episodes" } MEDIA_TYPE = { "MOVIE": "movie", "SHOW": "tvshow", "SEASON": "season", "EPISODE": "episode" } url_constructor = urljoin_partial(API_BASE_URL) # def plugin_url_constructor( # x): return "plugin://%s/resources/lib/main/%s/" % (NAME, x) TRAY_IDENTIFIERS = { "CONTINUE_WATCHING_TRAY": "/v1/users/{pid}/preferences/continue-watching?meta=true&size=20", "WATCHLIST_TRAY": "/v1/users/{pid}/trays/watchlist?meta=true&limit=20" }
# The unicode_literals import only has # an effect on Python 2. # It makes string literals as unicode like in Python 3 from __future__ import unicode_literals from codequick import Route, Resolver, Listitem, utils, Script, youtube import urlquick from resources.lib.labels import LABELS from resources.lib import web_utils from resources.lib import resolver_proxy import json LANG = Script.setting['france24.language'] TOKEN_APP = '66b85dad-3ad5-40f3-ab32-2305fc2357ea' URL_API = utils.urljoin_partial('http://apis.france24.com') def replay_entry(plugin, item_id): """ First executed function after replay_bridge """ return root(plugin, item_id) def root(plugin, item_id): # http://apis.france24.com/products/get_product/78dcf358-9333-4fb2-a035-7b91e9705b13?token_application=66b85dad-3ad5-40f3-ab32-2305fc2357ea root_json_url = 'products/get_product/78dcf358-9333-4fb2-a035-7b91e9705b13' root_json_r = urlquick.get(URL_API(root_json_url), params={'token_application': TOKEN_APP}) json_root = json.loads(root_json_r.text)
from __future__ import unicode_literals from codequick import Route, Resolver, Listitem, utils, run import urlquick import xbmcgui import re # Localized string Constants VIDEO_OF_THE_DAY = 30004 WATCHING_NOW = 30005 TOP_VIDEOS = 30002 SELECT_TOP = 30001 PARTY_MODE = 589 # Base url constructor url_constructor = utils.urljoin_partial("http://metalvideo.com") # noinspection PyUnusedLocal @Route.register def root(plugin, content_type="video"): """ :param Route plugin: The plugin parent object. :param str content_type: The type of content been listed e.g. video, music. This is passed in from kodi and we have no use for it as of yet. """ yield Listitem.recent(recent_videos) yield Listitem.from_dict(top_videos, plugin.localize(TOP_VIDEOS)) yield Listitem.from_dict(watching_now, plugin.localize(WATCHING_NOW)) yield Listitem.search(video_list)
# of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from __future__ import unicode_literals from codequick import Route, Resolver, Listitem, run, utils # Base url constructor url_constructor = utils.urljoin_partial("http://johnlocker.com") @Route.register def root(plugin): """ Lists all categories and link's to 'Shows', 'MsMojo' and 'All videos'. site: http://johnlocker.com :param Route plugin: Tools related to callback. :return: A generator of listitems. """ url = url_constructor("/us") source = plugin.request.get(url)