Beispiel #1
0
def drumeo():
    session = get_session()
    logger = logging.getLogger(__name__)
    courses = False
    reload = {}
    with shelve.open("cache.db") as d:
        if "courses" in d:
            list_of_courses = d["courses"]
            print(f"got from cache [{len(list_of_courses)}] courses")
        else:
            pages = get_number_of_pages(courses=courses, session=session)
            print(f"number of pages is [{pages}]")
            list_of_courses = get_courses(pages,
                                          courses=courses,
                                          session=session)
            print(f"got [{len(list_of_courses)}] courses")
            d["courses"] = list_of_courses
        for i, course in enumerate(list_of_courses):
            logger.info(f"course number [{i}]")
            if course.number in d and course.number not in reload:
                list_of_courses[i] = d[course.number]
                logger.info(f"got from cache [{list_of_courses[i]}]")
            else:
                get_course_details(course, courses=courses, session=session)
                get_course_urls(course, courses=courses, session=session)
                print(course)
                d[course.number] = course
            download_course(list_of_courses[i], session)
    session.close()
Beispiel #2
0
def photos():
    logger = logging.getLogger(LOGGER_NAME)
    logger.setLevel(ConfigLogging.loglevel)
    session = get_session()
    url_set = UrlSet()
    if ConfigSiteId.site == "facebook":
        scrape_facebook(ConfigSiteId.user_id, session, url_set)
    if ConfigSiteId.site == "instagram":
        scrape_instagram(ConfigSiteId.user_id, session, url_set)
    if ConfigSiteId.site == "travelgirls":
        scrape_travelgirls(ConfigSiteId.user_id, session, url_set)
    if ConfigSiteId.site == "vk":
        scrape_vk(ConfigSiteId.user_id, session, url_set)
    if ConfigSiteId.site == "mamba.ru":
        scrape_mambaru(ConfigSiteId.user_id, session, url_set)
    url_set.download(session)
    session.close()
Beispiel #3
0
def getpocket():
    logger = logging.getLogger(LOGGER_NAME)
    logger.setLevel(ConfigLogging.loglevel)
    session = get_session()
    getpocket_download(session, logger)
Beispiel #4
0
def sxyprn():
    logger = logging.getLogger(LOGGER_NAME)
    logger.setLevel(ConfigLogging.loglevel)
    session = get_session()
    sxyprn_download(session, logger)
Beispiel #5
0
def pornhub_download_url():
    session = get_session()
    download_url(session)