Add default prefetch settings to fetchers

This commit is contained in:
Joakim Soderlund 2016-12-18 19:02:57 +01:00
parent 31c5925a53
commit dbebdfae98

View file

@ -41,6 +41,8 @@ class Fetcher:
""" """
Abstract base class for story fetchers. Abstract base class for story fetchers.
""" """
prefetch_meta = False
prefetch_data = False
def __enter__(self): def __enter__(self):
""" """
@ -113,6 +115,9 @@ class FimfictionFetcher(Fetcher):
""" """
Fetcher for Fimfiction. Fetcher for Fimfiction.
""" """
prefetch_meta = True
prefetch_data = False
data_path = 'https://www.fimfiction.net/download_story.php' data_path = 'https://www.fimfiction.net/download_story.php'
meta_path = 'https://www.fimfiction.net/api/story.php' meta_path = 'https://www.fimfiction.net/api/story.php'
@ -184,6 +189,8 @@ class FimfarchiveFetcher(Fetcher):
""" """
Fetcher for Fimfarchive. Fetcher for Fimfarchive.
""" """
prefetch_meta = True
prefetch_data = True
def __init__(self, file): def __init__(self, file):
""" """