예제 #1
0
def addDownload(name, url, image, provider=None):
    try:
        def download(): return []
        result = cache.bennu_download_get(download, 600000000, table='rel_dl')
        result = [i['name'] for i in result]
    except:
        pass

    try:
        if name in result:
            return control.infoDialog('Item Already In Your Queue', name)
    except: 
        pass
        
    from resources.lib.indexers import bennustreams
    url = bennustreams.resolver().link(url)
    if url == None: return

    try:
        u = url.split('|')[0]
        try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1]))
        except: headers = dict('')

        ext = os.path.splitext(urlparse.urlparse(u).path)[1][1:].lower()
        if ext == 'm3u8': raise Exception()
        if not ext in ['mp4', 'm4a', 'mp3', 'aac', 'mkv', 'flv', 'avi', 'mpg']: ext = 'mp4'
        dest = name + '.' + ext

        req = urllib2.Request(u, headers=headers)
        resp = urllib2.urlopen(req, timeout=30)
        size = int(resp.headers['Content-Length'])
        size = ' %.2f GB' % (float(size) / 1073741824)

        no = control.yesnoDialog(dest, 'Complete file is' + size, 'Continue with download?', name + ' - ' + 'Confirm Download', 'Confirm', 'Cancel')

        if no: return
    except:
        return control.infoDialog('Unable to download')
        pass

    def download(): return [{'name': name, 'url': url, 'image': image}]
    result = cache.bennu_download_get(download, 600000000, table='rel_dl')
    result = [i for i in result if not i['url'] == url]
    def download(): return result + [{'name': name, 'url': url, 'image': image}]
    result = cache.bennu_download_get(download, 0, table='rel_dl')

    control.infoDialog('Item Added to Queue', name)
def addDownload(name, url, image, provider=None):
    try:
        def download(): return []
        result = cache.bennu_download_get(download, 600000000, table='rel_dl')
        result = [i['name'] for i in result]
    except:
        pass

    try:
        if name in result:
            return control.infoDialog('Item Already In Your Queue', name)
    except: 
        pass
        
    from resources.lib.indexers import bennustreams
    url = bennustreams.resolver().link(url)
    if url == None: return

    try:
        u = url.split('|')[0]
        try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1]))
        except: headers = dict('')

        ext = os.path.splitext(urlparse.urlparse(u).path)[1][1:].lower()
        if ext == 'm3u8': raise Exception()
        if not ext in ['mp4', 'm4a', 'mp3', 'aac', 'mkv', 'flv', 'avi', 'mpg']: ext = 'mp4'
        dest = name + '.' + ext

        req = urllib2.Request(u, headers=headers)
        resp = urllib2.urlopen(req, timeout=30)
        size = int(resp.headers['Content-Length'])
        size = ' %.2f GB' % (float(size) / 1073741824)

        no = control.yesnoDialog(dest, 'Complete file is' + size, 'Continue with download?', name + ' - ' + 'Confirm Download', 'Confirm', 'Cancel')

        if no: return
    except:
        return control.infoDialog('Unable to download')
        pass

    def download(): return [{'name': name, 'url': url, 'image': image}]
    result = cache.bennu_download_get(download, 600000000, table='rel_dl')
    result = [i for i in result if not i['url'] == url]
    def download(): return result + [{'name': name, 'url': url, 'image': image}]
    result = cache.bennu_download_get(download, 0, table='rel_dl')

    control.infoDialog('Item Added to Queue', name)
예제 #3
0
elif action == 'play':
    from resources.lib.indexers import bennustreams
    bennustreams.player().play(url, content)

elif action == 'addItem':
    from resources.lib.modules import sources
    sources.sources().addItem(title)

elif action == 'playItem':
    from resources.lib.modules import sources
    sources.sources().playItem(title, source)

elif action == 'browser':
    from resources.lib.indexers import bennustreams
    bennustreams.resolver().browser(url)

elif action == 'search':
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().search(url=None)

elif action == 'addSearch':
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().addSearch(url)

elif action == 'delSearch':
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().delSearch()

elif action == 'queueItem':
    from resources.lib.modules import control
예제 #4
0
elif action == 'tvtuner':
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().tvtuner(url)

elif 'youtube' in str(action):
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().youtube(url, action)

elif action == 'play':
    from resources.lib.indexers import bennustreams
    bennustreams.player().play(url, content)

elif action == 'browser':
    from resources.lib.indexers import bennustreams
    bennustreams.resolver().browser(url)

elif action == 'search':
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().search(url=None)

elif action == 'addSearch':
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().addSearch(url)

elif action == 'delSearch':
    from resources.lib.indexers import bennustreams
    bennustreams.indexer().delSearch()

elif action == 'queueItem':
    from resources.lib.modules import control