Scrapper checks for comics library path and creates it if needed

This commit is contained in:
Bryan Bailey
2022-03-14 23:30:01 -04:00
parent 41b6d33887
commit 9b8bca955b

View File

@@ -1,13 +1,18 @@
import os
import requests import requests
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from yoink.common import supported_sites from yoink.common import supported_sites, library_path
class Scrapable: class Scrapable:
def __init__(self, url) -> None: def __init__(self, url) -> None:
self.url = url self.url = url
comic_path = os.path.join(library_path, 'comics')
if not os.path.exists(comic_path):
os.makedirs(comic_path)
self.__check_site_support() self.__check_site_support()