Esempio n. 1
0
def addDownload(name, url, image, provider=None):
    try:

        def download():
            return []

        result = cache.get(download, 600000000, table='rel_dl')
        result = [i['name'] for i in result]
    except:
        pass

    if name in result:
        return control.infoDialog('Item Already In Your Queue', name)

    from resources.lib.indexers import phstreams
    url = phstreams.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.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.get(download, 0, table='rel_dl')

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

    if name in result:
        return control.infoDialog('Item Already In Your Queue', name)

    from resources.lib.indexers import phstreams
    url = phstreams.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.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.get(download, 0, table='rel_dl')

    control.infoDialog('Item Added to Queue', name)
Esempio n. 3
0
elif action == 'tvtuner':
    from resources.lib.indexers import phstreams
    phstreams.indexer().tvtuner(url)

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

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

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

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

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

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

elif action == 'queueItem':
    from resources.lib.modules import control
Esempio n. 4
0
if action == None:
    from resources.lib.indexers import phstreams
    phstreams.indexer().root()

elif action == 'directory':
    from resources.lib.indexers import phstreams
    phstreams.indexer().get(url)

elif action == 'developer':
    from resources.lib.indexers import phstreams
    phstreams.indexer().developer()

elif action == 'play':
    from resources.lib.indexers import phstreams
    phstreams.resolver().play(url)

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

elif action == 'search':
    from resources.lib.indexers import phstreams
    phstreams.indexer().search()

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

elif action == 'delSearch':
    from resources.lib.indexers import phstreams