Scrapper checks for comics library path and creates it if needed
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user