Beispiel #1
0
def GetMedia(url):    
    
    if queued == 'true':
    
        wh = watchhistory.WatchHistory(addon_id)    
        
        headers['Referer'] = BASEURL
        url_content = net.http_GET(url, headers=headers).content        
        url_content = re.sub("<!--.+?-->", " ", url_content)
        
        check_for_hosted_media = re.search(r"(?s)<iframe.+?src=\"(.+?)\"", url_content)
        if check_for_hosted_media:        
            hosted_media_url = check_for_hosted_media.group(1)
            hosted_media = urlresolver.HostedMediaFile(url=hosted_media_url)
            if hosted_media:
                resolved_media_url = urlresolver.resolve(hosted_media_url)
                if resolved_media_url:
                    
                    player = playbackengine.Play(resolved_url=resolved_media_url, addon_id=addon_id, video_type='wweonline', 
                            title=title,season='', episode='', year='', watchedCallback=WatchedCallback)
                    
                    # add watch history item                        
                    if historylink:
                        wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True, parent_title=historytitle)
                        wh.add_directory(historytitle, historylink, img=img, level='1')
                    else:
                        wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True)
                        
                    player.KeepAlive()
    else:
        playbackengine.PlayInPL(title, img=img)
Beispiel #2
0
def GetMedia(url):    
    
    if queued == 'true':
    
        wh = watchhistory.WatchHistory(addon_id)    
        
        hosted_media_url = None
        if any(u in url for u in ("pwtalk.net", "wrestlingreviews.net")):
            # Try to scrape page for media url
            headers['Referer'] = BASEURL
            url_content = net.http_GET(url, headers=headers).content        
            url_content = re.sub("<!--.+?-->", " ", url_content)

            soup = BeautifulSoup(url_content, "html5lib")
            check_for_escaped_content = re.search(r"unescape\('(.+?)'\)", url_content)
            check_for_hosted_media = soup.iframe
            if check_for_escaped_content:
                url_content = urllib2.unquote(check_for_escaped_content.group(1))
                soup = BeautifulSoup(url_content, "html5lib")
                url = soup.iframe["src"]
                return GetMedia(url)
            elif check_for_hosted_media:
                hosted_media_url = soup.iframe["src"]
        else:
            hosted_media_url = url
        
        if hosted_media_url:        
            hosted_media = urlresolver.HostedMediaFile(url=hosted_media_url)
            if hosted_media:
                resolved_media_url = urlresolver.resolve(hosted_media_url)
                if resolved_media_url:
                    
                    player = playbackengine.Play(resolved_url=resolved_media_url, addon_id=addon_id, video_type='wweonline', 
                            title=title,season='', episode='', year='', watchedCallback=WatchedCallback)
                    
                    # add watch history item                        
                    if historylink:
                        wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True, parent_title=historytitle)
                        wh.add_directory(historytitle, historylink, img=img, level='1')
                    else:
                        wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True)
                        
                    player.KeepAlive()
    else:
        playbackengine.PlayInPL(title, img=img)
Beispiel #3
0
def Play(url):
    from universal import playbackengine

    item_title = title
    display_name = title

    if queued == 'true':

        resolved_media_url = urlresolver.resolve(url)
        if resolved_media_url:

            player = playbackengine.Play(resolved_url=resolved_media_url,
                                         addon_id=addon_id,
                                         video_type='movie',
                                         title=item_title,
                                         season='',
                                         episode='',
                                         year='',
                                         watchedCallback=WatchedCallback)
            '''
            add to watch history - start
            '''
            wh = watchhistory.WatchHistory(addon_id)

            if historylink:
                wh.add_video_item(display_name,
                                  sys.argv[0] + sys.argv[2],
                                  img=img,
                                  is_playable=True,
                                  parent_title=historytitle)
                wh.add_directory(historytitle, historylink, img=img, level='1')
            else:
                wh.add_video_item(display_name,
                                  sys.argv[0] + sys.argv[2],
                                  img=img,
                                  is_playable=True)
            '''
            add to watch history - end
            '''

            player.KeepAlive()
    else:
        playbackengine.PlayInPL(display_name, img=img)
def Play(url):
    print 'url in play' + url
    from universal import playbackengine
    print 'url in Play' + url + queued
    item_title = title
    display_name = title
    if video_type != VideoType_Movies:
        item_title = show
        
    if queued == 'true':

            hosted_media = urlresolver.HostedMediaFile(url=url)
            if hosted_media:
                resolved_media_url = urlresolver.resolve(url)  
                if resolved_media_url:
                    
                    player = playbackengine.Play(resolved_url=resolved_media_url, addon_id=addon_id, video_type=video_type, 
                                title=item_title,season=season, episode=episode, year=year, watchedCallback=WatchedCallback)
                                
                    '''
                    add to watch history - start
                    '''
                    wh = watchhistory.WatchHistory(addon_id)
                    
                    infolabels = { 'supports_meta' : 'true', 'video_type':video_type, 'name':title, 'imdb_id':imdb_id, 'season':season, 'episode':episode, 'year':year }          
                                        
                    if historylink:
                        wh.add_video_item(display_name + ' - ' + name, sys.argv[0]+sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_playable=True, parent_title=historytitle)
                        wh.add_directory(historytitle, historylink, infolabels=infolabels, img=img, fanart=fanart, level='1')
                    else:
                        wh.add_video_item(display_name + ' - ' + name, sys.argv[0]+sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_playable=True)
                    '''
                    add to watch history - end
                    '''
                    player.KeepAlive()
                                    
    else:
        playbackengine.PlayInPL(display_name, img=img)
Beispiel #5
0
import urllib, urllib2, re, cookielib, urlresolver, sys, os
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
from resources.libs import main

#Mash Up - by Mash2k3 2012.

from t0mm0.common.addon import Addon
from universal import playbackengine, watchhistory
addon_id = 'plugin.video.movie25'
selfAddon = xbmcaddon.Addon(id=addon_id)
addon = Addon('plugin.video.movie25', sys.argv)
art = main.art

wh = watchhistory.WatchHistory('plugin.video.movie25')


def CHANNELCList(murl):
    link = main.OPENURL(murl)
    match = re.compile('<li>(.+?): <a href="(.+?)">(.+?)</a> </li>').findall(
        link)
    dialogWait = xbmcgui.DialogProgress()
    ret = dialogWait.create('Please wait until Show list is cached.')
    totalLinks = len(match)
    loadedLinks = 0
    remaining_display = 'Episodes loaded :: [B]' + str(
        loadedLinks) + ' / ' + str(totalLinks) + '[/B].'
    dialogWait.update(0, '[B]Will load instantly from now on[/B]',
                      remaining_display)
    for date, url, name in match:
        main.addPlayTE(name + ' [COLOR red]' + date + '[/COLOR]', url, 547, '',
                       '', '', '', '', '')
Beispiel #6
0
import urllib, urllib2, re, cookielib, os, sys
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
import main

### VideoBull.com by Kasik. (2013) ###

from t0mm0.common.addon import Addon
from universal import playbackengine, watchhistory
addon_id = 'plugin.video.vdeobull'
selfAddon = xbmcaddon.Addon(id=addon_id)
addon = Addon('plugin.video.vdeobull', sys.argv)
art = main.art
wh = watchhistory.WatchHistory('plugin.video.tvrule')
DownloadLog = os.path.join(main.datapath, 'Downloads')
DownloadFile = os.path.join(DownloadLog, 'DownloadLog')


def LIST():
    if os.path.exists(DownloadFile):
        DownloadLog = re.compile('{name="(.+?)",destination="(.+?)"}').findall(
            open(DownloadFile, 'r').read())
        for name, video in reversed(DownloadLog):
            main.addDLog(name, video, 242, '', '', '', '', '', '')


def LINK(mname, murl):
    ok = True
    if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I):
        infoLabels = main.GETMETAEpiT(mname, '', '')
        video_type = 'episode'
        season = infoLabels['season']
Beispiel #7
0
try:
    import urllib, urllib2, re, string, urlparse, sys, os
    
    from t0mm0.common.net import Net
    from metahandler import metahandlers
    from sqlite3 import dbapi2 as database
    from universal import playbackengine, watchhistory
    import urlresolver
except Exception, e:
    addon.log_error(str(e))
    addon.show_small_popup('MashUP: Tv-Release','Failed To Import Modules', 5000, error_logo)
    addon.show_ok_dialog(['Failed To Import Modules','Please Post Logfile In MashUP Forum @','http://www.xbmchub.com'],
                          'MashUP: TV-Release')
net = Net()
BASEURL = 'http://www.tv-release.net/'
wh = watchhistory.WatchHistory(addon_id)

def MAINMENU():
    main.addDir('Search Tv-Release',    BASEURL+'?s=',                            1006,art+'/tvrsearch1.png')
    main.addDir('TV 480',               BASEURL+'category/tvshows/tv480p/',       1001,art+'/TV480.png')
    main.addDir('TV 720',               BASEURL+'category/tvshows/tv720p/',       1001,art+'/TV720.png')
    main.addDir('TV MP4',               BASEURL+'category/tvshows/tvmp4/',        1001,art+'/TVmp4.png')
    main.addDir('TV Xvid',              BASEURL+'category/tvshows/tvxvid/',       1001,art+'/TVxvid.png')
    main.addDir('TV Packs',             BASEURL+'tv-pack/',                       1007,art+'/TVpacks.png')
    main.addDir('TV Foreign',           BASEURL+'category/tvshows/tv-foreign/',   1001,art+'/TVforeign.png')
    main.addDir('Movies 480',           BASEURL+'category/movies/movies480p/',    1001,art+'/Movies480.png')
    main.addDir('Movies 720',           BASEURL+'category/movies/movies720p/',    1001,art+'/Movies720.png')
    main.addDir('Movies Xvid',          BASEURL+'category/movies/moviesxvid/',    1001,art+'/Moviesxvid.png')
    main.addDir('Movies Foreign',       BASEURL+'category/movies/moviesforeign/', 1001,art+'/Moviesforeign.png')
    main.addSpecial('Resolver Settings',BASEURL,                                  1004,art+'/tvrresolver.png')
    main.VIEWSB()
Beispiel #8
0
import urlresolver
import base64
import xbmc
try: import simplejson as json
except ImportError: import json
import cgi
import datetime
from metahandler import metahandlers
from universal import playbackengine, watchhistory

ADDON = xbmcaddon.Addon(id='plugin.video.vkool')
if ADDON.getSetting('ga_visitor')=='':
    from random import randint
    ADDON.setSetting('ga_visitor',str(randint(0, 0x7fffffff)))
grab=metahandlers.MetaData()
wh = watchhistory.WatchHistory('plugin.video.vkool')

PATH = "vkool"  #<---- PLUGIN NAME MINUS THE "plugin.video"          
UATRACK="UA-44104701-1" #<---- GOOGLE ANALYTICS UA NUMBER   
VERSION = "1.0.4" #<---- PLUGIN VERSION
homeLink="http://m.vkool.net/"

def __init__(self):
    #print 'this call first'
    self.playlist=sys.modules["__main__"].playlist
    #dialog = xbmcgui.Dialog()
    #if not dialog.yesno(ADDON.getLocalizedString(30000),ADDON.getLocalizedString(30001), ADDON.getLocalizedString(30002), ADDON.getLocalizedString(30003), ADDON.getLocalizedString(30004), ADDON.getLocalizedString(30005)):
    #    return

def AUTO_VIEW(content):
        if content:
Beispiel #9
0
def GetMedia(mediaid):

    from universal import playbackengine
    
    if queued == 'true':
    
        wh = watchhistory.WatchHistory(addon_id)    
                    
        url_content = net.http_POST(MEDIA_PAGE_REQ_URL,
                                    {'watch' : '1',
                                     'episode_id' : mediaid }
                                    ).content
                                    
        media_req_data = re.search(r"proxy\.link\=(.+?)\"", url_content)
        if media_req_data:
            media_req_data = media_req_data.group(1)
                    
            media_response_data = net.http_POST(MEDIA_REQ_URL, {'url':media_req_data}).content            

            media_url = ''
            media_size = 0
                    
            media_content = re.search(r"(?s)\"media\":(.+?),\"description\":", media_response_data)
            if media_content:
                media_links = addon.unescape(media_content.group(1))
                media_links = unescape(media_links)			
                for link in re.finditer("\"url\":\"(.+?)\",\"height\":(.+?),\"width\":(.+?),\"type\":\"(.+?)\"", media_links):

                    if (link.group(4).startswith("image")):
                        continue

                    size = int(link.group(2)) + int(link.group(3))
                    if (size <= media_size):
                        continue

                    media_url = link.group(1)
                    media_size = size

                if media_url:
                    
                    player = playbackengine.Play(resolved_url=media_url, addon_id=addon_id, video_type='wweonline', 
                                title=title,season='', episode='', year='', watchedCallback=WatchedCallback)
                    
                    # add watch history item                    
                    if historylink:
                        wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True, parent_title=historytitle)
                        wh.add_directory(historytitle, historylink, img=img, level='1')
                    else:
                        wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True)
                        
                    player.KeepAlive()
                        
                    
        else:
            check_for_hosted_media = re.search(r"(?s)<embed.*?flashvars.+?file=(.+?)[&\"]{1}", url_content)
            if check_for_hosted_media:        
                hosted_media_url = check_for_hosted_media.group(1)
                hosted_media_url = ReformatHostedMediaUrl(hosted_media_url)
                hosted_media = urlresolver.HostedMediaFile(url=hosted_media_url)
                if hosted_media:
                    resolved_media_url = urlresolver.resolve(hosted_media_url)
                    if resolved_media_url:
                        
                        player = playbackengine.Play(resolved_url=resolved_media_url, addon_id=addon_id, video_type='wweonline', 
                                title=title,season='', episode='', year='', watchedCallback=WatchedCallback)
                        
                        # add watch history item                        
                        if historylink:
                            wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True, parent_title=historytitle)
                            wh.add_directory(historytitle, historylink, img=img, level='1')
                        else:
                            wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True)
                            
                        player.KeepAlive()
            else:
                check_for_hosted_media = re.search(r"(?s)<embed.*?src=\"(.+?)\"", url_content)
               
                if check_for_hosted_media:        
                    hosted_media_url = check_for_hosted_media.group(1)
                    hosted_media_url = ReformatHostedMediaUrl(hosted_media_url)
                    hosted_media = urlresolver.HostedMediaFile(url=hosted_media_url)
                    if hosted_media:
                        print hosted_media_url
                        resolved_media_url = urlresolver.resolve(hosted_media_url)
                        if resolved_media_url:
                            
                            player = playbackengine.Play(resolved_url=resolved_media_url, addon_id=addon_id, video_type='wweonline', 
                                title=title,season='', episode='', year='', watchedCallback=WatchedCallback)
                            
                            # add watch history item
                            if historylink:
                                wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True, parent_title=historytitle)
                                wh.add_directory(historytitle, historylink, img=img, level='1')
                            else:
                                wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True)
                            
                            player.KeepAlive()
                else:
                    check_for_hosted_media = re.search(r"(?s)<iframe.*?src=\"(.+?)\"", url_content)
                    if check_for_hosted_media:        
                        hosted_media_url = check_for_hosted_media.group(1)                        
                        #hosted_media_url = ReformatHostedMediaUrl(hosted_media_url)
                        hosted_media = urlresolver.HostedMediaFile(url=hosted_media_url)
                        if hosted_media:
                            resolved_media_url = urlresolver.resolve(hosted_media_url)
                            if resolved_media_url:
                                
                                player = playbackengine.Play(resolved_url=resolved_media_url, addon_id=addon_id, video_type='wweonline', 
                                    title=title,season='', episode='', year='', watchedCallback=WatchedCallback)
                                
                                # add watch history item
                                if historylink:
                                    wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True, parent_title=historytitle)
                                    wh.add_directory(historytitle, historylink, img=img, level='1')
                                else:
                                    wh.add_video_item(title, sys.argv[0]+sys.argv[2], img=img, is_playable=True)
                                
                                player.KeepAlive()
    else:
        playbackengine.PlayInPL(title, img=img)
Beispiel #10
0
import urllib, urllib2, re, cookielib, os, sys
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
import main

### The DareTv by Kasik. (2013) ###

from t0mm0.common.addon import Addon
from universal import playbackengine, watchhistory
addon_id = 'plugin.video.darewall'
selfAddon = xbmcaddon.Addon(id=addon_id)
addon = Addon('plugin.video.darewall', sys.argv)
art = main.art
wh = watchhistory.WatchHistory('plugin.video.darewall')
DownloadLog = os.path.join(main.datapath, 'Downloads')
DownloadFile = os.path.join(DownloadLog, 'DownloadLog')


def LIST():
    if os.path.exists(DownloadFile):
        DownloadLog = re.compile('{name="(.+?)",destination="(.+?)"}').findall(
            open(DownloadFile, 'r').read())
        for name, video in reversed(DownloadLog):
            main.addDLog(name, video, 242, '', '', '', '', '', '')


def LINK(mname, murl):
    ok = True
    if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I):
        infoLabels = main.GETMETAEpiT(mname, '', '')
        video_type = 'episode'
        season = infoLabels['season']
Beispiel #11
0
import urllib, urllib2, re, cookielib, os, sys
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
import main

### FilmesOnline2 by Kasik. (2013) ###

from t0mm0.common.addon import Addon
from universal import playbackengine, watchhistory
addon_id = 'plugin.video.filmesonline2'
selfAddon = xbmcaddon.Addon(id=addon_id)
addon = Addon('plugin.video.filmesonline2', sys.argv)
art = main.art
wh = watchhistory.WatchHistory('plugin.video.filmesonline2')
DownloadLog = os.path.join(main.datapath, 'Downloads')
DownloadFile = os.path.join(DownloadLog, 'DownloadLog')


def LIST():
    if os.path.exists(DownloadFile):
        DownloadLog = re.compile('{name="(.+?)",destination="(.+?)"}').findall(
            open(DownloadFile, 'r').read())
        for name, video in reversed(DownloadLog):
            main.addDLog(name, video, 242, '', '', '', '', '', '')


def LINK(mname, murl):
    ok = True
    if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I):
        infoLabels = main.GETMETAEpiT(mname, '', '')
        video_type = 'episode'
        season = infoLabels['season']
Beispiel #12
0
def PLAYB(name, url):
    ok = True
    hname = name
    name = name.split('[COLOR blue]')[0]
    name = name.split('[COLOR red]')[0]
    infoLabels = main.GETMETAT(name, '', '', '')
    video_type = 'movie'
    season = ''
    episode = ''
    img = infoLabels['cover_url']
    fanart = infoLabels['backdrop_url']
    imdb_id = infoLabels['imdb_id']
    infolabels = {
        'supports_meta': 'true',
        'video_type': video_type,
        'name': str(infoLabels['title']),
        'imdb_id': str(infoLabels['imdb_id']),
        'season': str(season),
        'episode': str(episode),
        'year': str(infoLabels['year'])
    }

    try:
        xbmc.executebuiltin(
            "XBMC.Notification(Please Wait!,Resolving Link,3000)")
        stream_url = main.resolve_url(url)

        infoL = {
            'Title': infoLabels['metaName'],
            'Plot': infoLabels['plot'],
            'Genre': infoLabels['genre']
        }
        # play with bookmark
        from universal import playbackengine
        player = playbackengine.PlayWithoutQueueSupport(
            resolved_url=stream_url,
            addon_id=addon_id,
            video_type=video_type,
            title=str(infoLabels['title']),
            season=str(season),
            episode=str(episode),
            year=str(infoLabels['year']),
            img=img,
            infolabels=infoL,
            watchedCallbackwithParams=main.WatchedCallbackwithParams,
            imdb_id=imdb_id)
        #WatchHistory
        if selfAddon.getSetting("whistory") == "true":
            from universal import watchhistory
            wh = watchhistory.WatchHistory('plugin.video.filmesonlinegratis')
            wh.add_item(hname + ' ' +
                        '[COLOR green]Filmesonlinegratis[/COLOR]',
                        sys.argv[0] + sys.argv[2],
                        infolabels=infolabels,
                        img=img,
                        fanart=fanart,
                        is_folder=False)
        player.KeepAlive()
        return ok
    except Exception, e:
        if stream_url != False:
            main.ErrorReport(e)
        return ok
Beispiel #13
0
import xbmc
import re
xbmc_version = re.search('^(\d+)', xbmc.getInfoLabel("System.BuildVersion"))
if xbmc_version:
    xbmc_version = int(xbmc_version.group(1))
else:
    xbmc_version = 1
print xbmc_version
if xbmc_version >= 13.9:
    addon_id = 'script.module.universal'
    lib_addon_dir_name = "lib"
    import xbmcaddon
    import os
    from os.path import join, basename
    import sys
    addon = xbmcaddon.Addon(id=addon_id)
    addon_path = addon.getAddonInfo('path')
    sys.path.append(addon_path)
    lib_addon_dir_path = os.path.join(addon_path, lib_addon_dir_name)
    sys.path.append(lib_addon_dir_path)
    for dirpath, dirnames, files in os.walk(lib_addon_dir_path):
        sys.path.append(dirpath)
# end

from universal import watchhistory

print 'Universal - An Addons Toolkit: - watchhistory - -Auto Cleanup Start'
wh = watchhistory.WatchHistory('script.module.watchhistory')
wh.cleanup_history()
print 'Universal - An Addons Toolkit: - watchhistory - -Auto Cleanup End'