Example #1
0
def update_service():
    # this read the settings
    settings = tools.Settings()
    # define the browser
    browser = tools.Browser()
    #Begin Service
    if settings.service == 'true':
        options = {
            'Estrenos de Cine': '%s/categoria/estrenos/pg/',
            'Peliculas en Alta Definicion': '%s/categoria/peliculas-hd/pg/',
            'Peliculas en 3D': '%s/categoria/peliculas-3d/pg/',
            'Peliculas en Castellano': '%s/categoria/peliculas-castellano/pg/',
            'Peliculas Latino': '%s/categoria/peliculas-latino/pg/'
        }
    ret = int(Addon().getSetting('option'))
    if ret < len(options):
        url_search = options.values()[ret] % settings.url_address
        title = []
        magnet = []
        if settings.pages == 0:
            settings.pages = 1  # manual pages if the parameter is zero
        for page in range(1, settings.pages + 1):
            if settings.time_noti > 0:
                settings.dialog.notification(
                    settings.name_provider,
                    'Checking Online page %s...' % page, settings.icon,
                    settings.time_noti)
            settings.log('[%s] %s%d' %
                         (settings.name_provider_clean, url_search, page))
            if browser.open(url_search + str(page)):
                data = browser.content
                for cm, torrent in enumerate(
                        re.findall(r'/descargar/(.*?)"', data)):
                    sname = re.search("_(.*?).html", torrent)
                    if sname is None:
                        name = torrent
                    else:
                        name = sname.group(1)
                    info = tools.format_title(name.replace('-', ' ').title())
                    title.append(info['title'])
                    magnet.append(settings.url_address + '/torrent/' +
                                  torrent)  # create torrent to send Pulsar
                if int(page) % 10 == 0:
                    sleep(3000)  # to avoid too many connections
            else:
                settings.log('[%s] >>>>>>>%s<<<<<<<' %
                             (settings.name_provider_clean, browser.status))
                settings.dialog.notification(settings.name_provider,
                                             browser.status, settings.icon,
                                             1000)
                break
        if len(title) > 0:
            tools.integration(filename=title,
                              magnet=magnet,
                              type_list='MOVIE',
                              folder=settings.movie_folder,
                              name_provider=settings.name_provider,
                              silence=True)
    del settings
    del browser
def search(query='', type='', silence=False):
    results = []
    if type == 'MOVIE':
        folder = settings.movie_folder
    else:
        folder = settings.show_folder
    # start to search
    settings.pages = settings.dialog.numeric(0, 'Number of pages:')
    if settings.pages == '' or settings.pages == 0:
        settings.pages = "1"
    settings.pages = int(settings.pages)
    for page in range(settings.pages):
        url_search = query % (settings.url_address, page)
        settings.log('[%s]%s' % (settings.name_provider_clean, url_search))
        if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Page %s...' % page,
                                                                settings.icon, settings.time_noti)
        if browser.open(url_search):
            results.extend(extract_magnets(browser.content))
            if int(page) % 10 == 0: sleep(3000)  # to avoid too many connections
        else:
            settings.log('[%s]%s' % (settings.name_provider_clean, '>>>>>>>%s<<<<<<<' % browser.status))
            settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    if len(results) > 0:
        title = []
        magnet = []
        for item in results:
            info = tools.format_title(item['name'])
            if info['type'] == type:
                title.append(item['name'])
                magnet.append(item['uri'])
        tools.integration(filename=title, magnet=magnet, type_list=type, folder=folder, silence=silence,
                           name_provider=settings.name_provider)
Example #3
0
def search(query='', type='', silence=False):
    results = []
    if type == 'MOVIE':
        folder = settings.movie_folder
    else:
        folder = settings.show_folder
    # start to search
    settings.pages = settings.dialog.numeric(0, 'Number of pages:')
    if settings.pages == '' or settings.pages == 0:
        settings.pages = "1"
    settings.pages = int(settings.pages)
    for page in range(settings.pages):
        url_search = query % (settings.url_address, page)
        settings.log('[%s]%s' % (settings.name_provider_clean, url_search))
        if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Page %s...' % str(page + 1),
                                                                settings.icon, settings.time_noti)
        if browser.open(url_search):
            results.extend(extract_magnets(browser.content))
            if int(page) % 10 == 0: sleep(3000)  # to avoid too many connections
        else:
            settings.log('[%s]%s' % (settings.name_provider_clean, '>>>>>>>%s<<<<<<<' % browser.status))
            settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    if len(results) > 0:
        title = []
        magnet = []
        for item in results:
            info = tools.format_title(item['name'])
            if info['type'] == type:
                title.append(item['name'])
                magnet.append(item['uri'])
        tools.integration(filename=title, magnet=magnet, type_list=type, folder=folder, silence=silence,
                           name_provider=settings.name_provider, message=type)
def update_service():
    # this read the settings
    settings = tools.Settings()
    # define the browser
    browser = tools.Browser()
    #Begin Service
    if settings.service == 'true':
        options = {
            'Estrenos': '%s/categoria/1/estrenos/modo:listado/pag:',
            'Peliculas': '%s/categoria/2/peliculas/modo:listado/pag:',
            'Peliculas HDRip':
            '%s/categoria/13/peliculas-hdrip/modo:listado/pag:'
        }
        ret = int(Addon().getSetting('option'))
        if ret < len(options):
            url_search = options.values()[ret] % settings.url_address
            title = []
            magnet = []
            if settings.pages == 0:
                settings.pages = 1  # manual pages if the parameter is zero
            for page in range(1, settings.pages + 1):
                if settings.time_noti > 0:
                    settings.dialog.notification(
                        settings.name_provider,
                        'Checking Online page %s...' % page, settings.icon,
                        settings.time_noti)
                settings.log('[%s] %s%d' %
                             (settings.name_provider_clean, url_search, page))
                if browser.open(url_search + str(page)):
                    data = browser.content
                    for (torrent, name) in re.findall(r'/torrent/(.*?)/(.*?)"',
                                                      data):
                        info = tools.format_title(name)
                        title.append(info['title'].replace('-', ' '))
                        magnet.append(settings.url_address + '/get-torrent/' +
                                      torrent)  # create torrent to send P
                    if int(page) % 10 == 0:
                        sleep(3000)  # to avoid too many connections
                else:
                    settings.log(
                        '[%s] >>>>>>>%s<<<<<<<' %
                        (settings.name_provider_clean, browser.status))
                    settings.dialog.notification(settings.name_provider,
                                                 browser.status, settings.icon,
                                                 1000)
                    break
            if len(title) > 0:
                tools.integration(filename=title,
                                  magnet=magnet,
                                  type_list='MOVIE',
                                  folder=settings.movie_folder,
                                  name_provider=settings.name_provider,
                                  silence=True)
    del settings
    del browser
def update_service():
    # this read the settings
    settings = tools.Settings()
    # define the browser
    browser = tools.Browser()
    #Begin Service
    if settings.service == 'true':
        options = {'Estrenos de Cine': '%s/categoria/estrenos/pg/',
                   'Peliculas en Alta Definicion': '%s/categoria/peliculas-hd/pg/',
                   'Peliculas en 3D': '%s/categoria/peliculas-3d/pg/',
                   'Peliculas en Castellano': '%s/categoria/peliculas-castellano/pg/',
                   'Peliculas Latino': '%s/categoria/peliculas-latino/pg/'}
    ret = int(Addon().getSetting('option'))
    if ret < len(options):
        url_search = options.values()[ret] % settings.url_address
        title = []
        magnet = []
        if settings.pages == 0: settings.pages = 1  # manual pages if the parameter is zero
        for page in range(1, settings.pages + 1):
            if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 
                    'Checking Online page %s...' % page, settings.icon, settings.time_noti)
            settings.log('[%s] %s%d' % (settings.name_provider_clean, url_search, page))
            if browser.open(url_search + str(page)):
                data = browser.content
                for cm, torrent in enumerate(re.findall(r'/descargar/(.*?)"', data)):
                    sname = re.search("_(.*?).html", torrent)
                    if sname is None:
                        name = torrent
                    else:
                        name = sname.group(1)
                    info = tools.format_title(name.replace('-', ' ').title())
                    title.append(info['title'])
                    magnet.append(settings.url_address + '/torrent/' + torrent)  # create torrent to send Pulsar
                if int(page) % 10 == 0: sleep(3000)  # to avoid too many connections
            else:
                settings.log('[%s] >>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
                settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
                break
        if len(title) > 0:
            tools.integration(filename=title, magnet=magnet, type_list='MOVIE', folder=settings.movie_folder,
                              name_provider=settings.name_provider, silence=True)
    del settings
    del browser
def update_service():
    # this read the settings
    settings = tools.Settings()
    # define the browser
    browser = tools.Browser()
    #Begin Service
    if settings.service == 'true':
        options = {'Estrenos': '%s/categoria/1/estrenos/modo:listado/pag:',
                   'Peliculas': '%s/categoria/2/peliculas/modo:listado/pag:',
                   'Peliculas HDRip': '%s/categoria/13/peliculas-hdrip/modo:listado/pag:'}
        ret = int(Addon().getSetting('option'))
        if ret < len(options):
            url_search = options.values()[ret] % settings.url_address
            title = []
            magnet = []
            if settings.pages == 0: settings.pages = 1  # manual pages if the parameter is zero
            for page in range(1, settings.pages + 1):
                if settings.time_noti > 0: settings.dialog.notification(settings.name_provider,
                                                                        'Checking Online page %s...' % page,
                                                                        settings.icon, settings.time_noti)
                settings.log('[%s] %s%d' % (settings.name_provider_clean, url_search, page))
                if browser.open(url_search + str(page)):
                    data = browser.content
                    for (torrent, name) in re.findall(r'/torrent/(.*?)/(.*?)"', data):
                        info = tools.format_title(name)
                        title.append(info['title'].replace('-', ' '))
                        magnet.append(settings.url_address + '/get-torrent/' + torrent)  # create torrent to send P
                    if int(page) % 10 == 0: sleep(3000)  # to avoid too many connections
                else:
                    settings.log('[%s] >>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
                    settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
                    break
            if len(title) > 0:
                tools.integration(filename=title, magnet=magnet, type_list='MOVIE', folder=settings.movie_folder,
                                  name_provider=settings.name_provider, silence=True)
    del settings
    del browser
Example #7
0
 items = re.findall('<item>(.*?)</item>', browser.content,
                    re.S)
 for item in items:
     s_title = re.findall('title>(.*?)</title>', item)
     s_link = re.findall(r'magnet:\?[^\'"\s<>\[\]]+', item)
     if len(s_link) == 0:
         s_link = re.findall(
             r'http??[a-zA-Z0-9\.\/\?\:@\-_=#\[\]\s]+[.]torren[a-zA-Z0-9\.\/\?\:@\-_=#\[\]]+',
             item)
     if len(s_link) == 0:
         s_link = re.findall('<link>(.*?)</link>', item,
                             re.S)
     if len(s_link) != 0:
         if len(s_title) > 0:
             if s_title[0] != '':
                 info = tools.format_title(s_title[0])
                 if 'MOVIE' in info['type']:
                     title_movie.append(s_title[0])
                     magnet_movie.append(s_link[0])
                     acum += 1
                 if 'SHOW' in info['type']:
                     title_show.append(s_title[0])
                     magnet_show.append(s_link[0])
                     acum += 1
 if acum == 0:
     if settings.time_noti > 0:
         settings.dialog.notification(
             settings.name_provider,
             'No Movies nor Shows!!', settings.icon,
             settings.time_noti)
 if len(title_movie) > 0:
Example #8
0
def update_service():
    # this read the settings
    settings = tools.Settings()
    # define the browser
    browser = tools.Browser()
    #Begin Service
    if settings.service == 'true':
        if settings.time_noti > 0:
            settings.dialog.notification(settings.name_provider,
                                         'Checking Online...', settings.icon,
                                         settings.time_noti)
        list_url_search = []
        path = translatePath('special://temp')
        Dict_RSS = {}
        try:
            with open(path + 'RSS2PULSAR.txt', 'r') as fp:
                for line in fp:
                    listedline = line.strip().split(
                        '::')  # split around the :: sign
                    if len(listedline) > 1:  # we have the : sign in there
                        Dict_RSS[listedline[0]] = listedline[1]
        except:
            database = shelve.open(path + 'RSS2PULSAR.db')
            if database.has_key('dict'):
                Dict_RSS = database['dict']
        rep = 0
        list_url_search = Dict_RSS.values()
        if settings.time_noti > 0:
            settings.dialog.notification(settings.name_provider,
                                         'Checking Online...', settings.icon,
                                         settings.time_noti)
        # Begin reading
        for url_search in list_url_search:
            if url_search is not '':
                magnet_movie = []
                title_movie = []
                magnet_show = []
                title_show = []
                if settings.time_noti > 0:
                    settings.dialog.notification(settings.name_provider,
                                                 'Checking %s...' % url_search,
                                                 settings.icon,
                                                 settings.time_noti)
                acum = 0
                if browser.open(url_search):
                    items = re.findall('<item>(.*?)</item>', browser.content,
                                       re.S)
                    for item in items:
                        s_title = re.findall('title>(.*?)<', item)
                        s_link = re.findall(r'magnet:\?[^\'"\s<>\[\]]+', item)
                        if len(s_link) == 0:
                            s_link = re.findall(r'http://(.*?)[.]torrent',
                                                item)
                        if len(s_link) != 0:
                            if 'magnet' not in s_link[0]:
                                s_link[0] = 'http://' + s_link[0].replace(
                                    '&amp;', '&') + '.torrent'
                            if len(s_title) > 0:
                                if s_title[0] != '':
                                    info = tools.format_title(s_title[0])
                                    if 'MOVIE' in info['type']:
                                        title_movie.append(s_title[0])
                                        magnet_movie.append(s_link[0])
                                        acum += 1
                                    if 'SHOW' in info['type']:
                                        title_show.append(s_title[0])
                                        magnet_show.append(s_link[0])
                                        acum += 1
                    if acum == 0:
                        if settings.time_noti > 0:
                            settings.dialog.notification(
                                settings.name_provider,
                                'No Movies nor Shows!!', settings.icon,
                                settings.time_noti)
                    if len(title_movie) > 0:
                        tools.integration(filename=title_movie,
                                          magnet=magnet_movie,
                                          type_list='MOVIE',
                                          folder=settings.movie_folder,
                                          silence=True,
                                          name_provider=settings.name_provider)
                    if len(title_show) > 0:
                        tools.integration(filename=title_show,
                                          magnet=magnet_show,
                                          type_list='EPISODES',
                                          folder=settings.show_folder,
                                          silence=True,
                                          name_provider=settings.name_provider)
                else:
                    settings.log(
                        '[%s]>>>>>>>%s<<<<<<<' %
                        (settings.name_provider_clean, browser.status))
                    settings.dialog.notification(settings.name_provider,
                                                 browser.status, settings.icon,
                                                 1000)
    del settings
    del browser
 acum = 0
 if browser.open(url_search):
     items = re.findall("<item>(.*?)</item>", browser.content, re.S)
     for item in items:
         s_title = re.findall("title>(.*?)</title>", item)
         s_link = re.findall(r'magnet:\?[^\'"\s<>\[\]]+', item)
         if len(s_link) == 0:
             s_link = re.findall(
                 r"http??[a-zA-Z0-9\.\/\?\:@\-_=#\[\]\s]+[.]torren[a-zA-Z0-9\.\/\?\:@\-_=#\[\]]+", item
             )
         if len(s_link) == 0:
             s_link = re.findall("<link>(.*?)</link>", item, re.S)
         if len(s_link) != 0:
             if len(s_title) > 0:
                 if s_title[0] != "":
                     info = tools.format_title(s_title[0])
                     if "MOVIE" in info["type"]:
                         title_movie.append(s_title[0])
                         magnet_movie.append(s_link[0])
                         acum += 1
                     if "SHOW" in info["type"]:
                         title_show.append(s_title[0])
                         magnet_show.append(s_link[0])
                         acum += 1
     if acum == 0:
         if settings.time_noti > 0:
             settings.dialog.notification(
                 settings.name_provider, "No Movies nor Shows!!", settings.icon, settings.time_noti
             )
     if len(title_movie) > 0:
         tools.integration(
def update_service():
    # this read the settings
    settings = tools.Settings()
    # define the browser
    browser = tools.Browser()
    #Begin Service
    if settings.service == 'true':
        if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Online...', settings.icon, settings.time_noti)
        list_url_search = []
        path = translatePath('special://temp')
        Dict_RSS = {}
        try:
            with open(path + 'RSS2PULSAR.txt', 'r') as fp:
                for line in fp:
                    listedline = line.strip().split('::')  # split around the :: sign
                    if len(listedline) > 1:  # we have the : sign in there
                        Dict_RSS[listedline[0]] = listedline[1]
        except:
            database = shelve.open(path + 'RSS2PULSAR.db')
            if database.has_key('dict'):
                Dict_RSS = database['dict']
        rep = 0
        list_url_search = Dict_RSS.values()
        if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Online...', settings.icon, settings.time_noti)
        # Begin reading
        for url_search in list_url_search:
            if url_search is not '':
                magnet_movie = []
                title_movie = []
                magnet_show = []
                title_show = []
                if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking %s...' % url_search, settings.icon, settings.time_noti)
                acum = 0
                if browser.open(url_search):
                    items = re.findall('<item>(.*?)</item>', browser.content, re.S)
                    for item in items:
                        s_title = re.findall('title>(.*?)<', item)
                        s_link = re.findall(r'magnet:\?[^\'"\s<>\[\]]+', item)
                        if len(s_link) == 0:
                            s_link = re.findall(r'http://(.*?)[.]torrent', item)
                        if len(s_link) != 0:
                            if 'magnet' not in s_link[0]:
                                s_link[0] = 'http://' + s_link[0].replace('&amp;', '&') + '.torrent'
                            if len(s_title) > 0:
                                if s_title[0] != '':
                                    info = tools.format_title(s_title[0])
                                    if 'MOVIE' in info['type']:
                                        title_movie.append(s_title[0])
                                        magnet_movie.append(s_link[0])
                                        acum += 1
                                    if 'SHOW' in info['type']:
                                        title_show.append(s_title[0])
                                        magnet_show.append(s_link[0])
                                        acum += 1
                    if acum == 0:
                        if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'No Movies nor Shows!!', settings.icon, settings.time_noti)
                    if len(title_movie) > 0:
                        tools.integration(filename=title_movie, magnet=magnet_movie, type_list='MOVIE',
                                        folder=settings.movie_folder, silence=True, name_provider=settings.name_provider)
                    if len(title_show) > 0:
                        tools.integration(filename=title_show, magnet=magnet_show, type_list='EPISODES',
                                        folder=settings.show_folder, silence=True, name_provider=settings.name_provider)
                else:
                    settings.log('[%s]>>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
                    settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    del settings
    del browser
    settings.pages = settings.dialog.numeric(0, 'Number of pages:')
    if settings.pages == '' or settings.pages == 0:
        settings.pages = "1"
    settings.pages = int(settings.pages)
    for page in range(1, settings.pages + 1):
        if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Page %s...' %
            page, settings.icon, settings.time_noti)
        settings.log('[%s] %s%d' % (settings.name_provider_clean, url_search, page))
        if browser.open(url_search + str(page)):
            data = browser.content
            sname = re.findall('<li style="width:136px;height:263px;margin:0px 15px 0px 0px;">(.*?)title="(.*?)"', data,
                               re.S)
            torrent = re.findall(r'/descargar/(.*?)"', data)
            for cm, temp in enumerate(sname):
                name = sname[cm][1].replace('Descargar', '').replace('torrent gratis', '')
                info = tools.format_title(name.title())
                title.append(info['title'])
                magnet.append(settings.url_address + '/torrent/' + torrent[cm])  # create torrent to send P
            if int(page) % 10 == 0: sleep(3000)  # to avoid too many connections
        else:
            settings.log('[%s] >>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
            settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
            break
    if len(title) > 0:
        tools.integration(filename=title, magnet=magnet, type_list='MOVIE', folder=settings.movie_folder,
                          name_provider=settings.name_provider)
if ret == len(options):
    settings.settings.openSettings()
    settings = tools.Settings()
if ret == len(options) + 1:
        settings.dialog.ok("Help", "Please, check this address to find the user's operation:\n[B]http://goo.gl/0b44BY[/B]")