Ejemplo n.º 1
0
def extract_torrents(data):
    filters.information()  # print filters settings
    sint = common.ignore_exception(ValueError)(int)
    results = []
    cont = 0
    links = provider.parse_json(data)
    if not links.has_key("error"):
        for link in links["torrent_results"]:
            name = link["filename"]  # name
            magnet = link["download"]  # magnet
            if filters.verify(name, None):
                cont += 1
                results.append(
                    {
                        "name": name.strip(),
                        "uri": magnet,
                        "language": settings.value.get("language", "en"),
                        "provider": settings.name,
                        "icon": settings.icon,
                    }
                )  # return the torrent
                if cont >= int(settings.value.get("max_magnets", 10)):  # limit magnets
                    break
            else:
                provider.log.warning(filters.reason)
    provider.log.info(">>>>>>" + str(cont) + " torrents sent to Quasar<<<<<<<")
    return results
Ejemplo n.º 2
0
def extract_torrents(data):
    filters.information()  # print filters settings
    sint = common.ignore_exception(ValueError)(int)
    results = []
    cont = 0
    links = provider.parse_json(data)
    if not links.has_key("error"):
        for link in links["torrent_results"]:
            name = link["filename"]  # name
            magnet = link["download"]  # magnet
            if filters.verify(name, None):
                cont += 1
                results.append({
                    "name": name.strip(),
                    "uri": magnet,
                    "language": settings.value.get("language", "en"),
                    "provider": settings.name,
                    "icon": settings.icon,
                })  # return the torrent
                if cont >= int(settings.value.get("max_magnets",
                                                  10)):  # limit magnets
                    break
            else:
                provider.log.warning(filters.reason)
    provider.log.info('>>>>>>' + str(cont) + ' torrents sent to Quasar<<<<<<<')
    return results
Ejemplo n.º 3
0
def search_general(info):
    info["extra"] = settings.value.get("extra", "")  # add the extra information
    query = filters.type_filtering(info, "+")  # check type filter and set-up filters.title
    browser.open("%s?get_token=get_token&app_id=script.quasar.rarbg-mc" % settings.value["url_address"])
    items = provider.parse_json(browser.content)
    url_search = "%s?mode=search&search_string=%s&app_id=script.quasar.rarbg-mc&token=%s" % (
        settings.value["url_address"],
        query,
        items["token"],
    )  # change in each provider
    provider.log.info(url_search)
    browser.open(url_search)
    return extract_torrents(browser.content)
Ejemplo n.º 4
0
def search_general(info):
    info["extra"] = settings.value.get("extra",
                                       "")  # add the extra information
    query = filters.type_filtering(
        info, '+')  # check type filter and set-up filters.title
    browser.open("%s?get_token=get_token&app_id=script.quasar.rarbg-mc" %
                 settings.value["url_address"])
    items = provider.parse_json(browser.content)
    url_search = "%s?mode=search&search_string=%s&app_id=script.quasar.rarbg-mc&token=%s" % (
        settings.value["url_address"], query, items["token"]
    )  # change in each provider
    provider.log.info(url_search)
    browser.open(url_search)
    return extract_torrents(browser.content)