Пример #1
0
def search_main():
    search_input = input('검색할 웹툰명을 입력해주세요 : ')
    webtoon_find = SearchWebtoon()
    webtoon_find.search_webtoon(search_input)
    choice_input1 = input('선택 : ')
    print(
        f'현재 "{webtoon_find.search_list[int(choice_input1)-1]}" 웹툰이 선택되어 있습니다.'
    )
    print('1. 웹툰 정보 보기')
    print('2. 웹툰 저장하기')
    print('3. 다른 웹툰 검색해서 선택하기')
    choice_input2 = input('선택 : ')
    while 1:
        if choice_input2 == '1':
            print('1번을 선택했습니다')
            webtoon1 = Webtoon(
                webtoon_find.webtoon_id_list[int(choice_input1) - 1])
            webtoon1.get_html()
            webtoon1.set_info()
            print(f'{webtoon1.title}')
            print(f'    작가명 : {webtoon1.author}')
            print(f'    설명 : {webtoon1.description}')
            print(f'    총 연재회수 : {webtoon1.num_of_episodes}')
            return search_main()

        elif choice_input2 == '2':
            print('2번을 선택했습니다')
            webtoon1 = Webtoon(
                webtoon_find.webtoon_id_list[int(choice_input1) - 1])
            webtoon1.get_html()
            webtoon1.set_info()
            print(f'웹툰 저장 시작 (총 {webtoon1.num_of_episodes}화)')
            for episode in webtoon1.crawl_episode_list():
                print(f'======{episode} 다운로드 중=====')
                episode.download_all_images()
            print('저장이 완료되었습니다.')
            return search_main()

        elif choice_input2 == '3':
            print('3번을 선택했습니다')
            return search_main()

        else:
            print('다시 선택해주세요')
            choice_input2 = input('선택 : ')
Пример #2
0
def search_main():
    search_input = input('검색할 웹툰명을 입력해주세요 : ')
    webtoon_find = SearchWebtoon()
    webtoon_find.search_webtoon(search_input)
    choice_input1 = input('선택 : ')
    print(
        f'현재 "{webtoon_find.search_list[int(choice_input1)-1]}" 웹툰이 선택되어 있습니다.'
    )
    print('1. 웹툰 정보 보기')
    print('2. 웹툰 저장하기')
    print('3. 다른 웹툰 검색해서 선택하기')
    choice_input2 = input('선택 : ')
    while 1:
        if choice_input2 == '1':
            print('1번을 선택했습니다')
            webtoon1 = Webtoon(
                webtoon_find.webtoon_id_list[int(choice_input1) - 1])
            webtoon1.webtoon_html()
            webtoon1.set_info()
            return search_main()

        elif choice_input2 == '2':
            print('2번은 선택했습니다')
            webtoon1 = Webtoon(
                webtoon_find.webtoon_id_list[int(choice_input1) - 1])
            webtoon1.webtoon_html()
            webtoon1.set_info()
            for episode in webtoon1.crawler_episode_list():
                print(f'======{episode} 다운로드 중=====')
                episode.download_all()
            print('저장이 완료되었습니다.')
            return search_main()

        elif choice_input2 == '3':
            print('3번을 선택했습니다')
            return search_main()

        else:
            print('다시 선택해주세요')
            choice_input2 = input('선택 : ')