18 lines
434 B
Python
18 lines
434 B
Python
|
from . import yuku
|
||
|
|
||
|
scrapers = [yuku]
|
||
|
|
||
|
def get_scraper (name):
|
||
|
for scraper in scrapers:
|
||
|
if scraper.__name__.endswith(".{}".format(name)):
|
||
|
return scraper
|
||
|
|
||
|
raise Exception("Unknown scraper: {}".format(name))
|
||
|
|
||
|
def guess_scraper (url):
|
||
|
for scraper in scrapers:
|
||
|
if scraper.can_scrape_url(url):
|
||
|
return scraper
|
||
|
|
||
|
raise Exception("Unable to guess scraper for forum url: {}".format(url))
|