diff options
author | Ken Kellner <ken@kenkellner.com> | 2018-04-04 17:00:24 -0400 |
---|---|---|
committer | Ken Kellner <ken@kenkellner.com> | 2018-04-04 17:00:24 -0400 |
commit | 52d5cc23a30b76f43522b2d37229d4449f099d73 (patch) | |
tree | 301eff225abcd94152ed31d9f202d3256405264d | |
parent | b37149bedcfcac84f74d8057f1de843c42b85753 (diff) |
Cleanup
-rwxr-xr-x | article-epub.py | 4 | ||||
-rw-r--r-- | article_epub/publisher.py | 12 |
2 files changed, 3 insertions, 13 deletions
diff --git a/article-epub.py b/article-epub.py index 431c330..7b301e9 100755 --- a/article-epub.py +++ b/article-epub.py @@ -6,12 +6,14 @@ import requests def main(): if sys.argv[1] == '-d': url = requests.get('https://doi.org/'+sys.argv[2]).url + doi = sys.argv[2] else: url = sys.argv[1] + doi = None domain = url.split("//")[-1].split("/")[0].split('?')[0] - art = article_epub.publisher.get_publishers()[domain](url=url) + art = article_epub.publisher.get_publishers()[domain](url=url,doi=doi) print('Downloading content...') art.soupify() diff --git a/article_epub/publisher.py b/article_epub/publisher.py index f8e5424..f8abfc8 100644 --- a/article_epub/publisher.py +++ b/article_epub/publisher.py @@ -15,11 +15,6 @@ class Publisher(object): def __init__(self, url, doi=None, out_format='epub'): self.url = url self.doi = doi - self.output_format = out_format - if out_format not in ['epub','kepub']: - sys.exit('Supported formats are epub and kepub') - if doi != None: - self.doi = doi def soupify(self): """Get HTML from article's page""" @@ -112,10 +107,3 @@ def register_publisher(publisher): def get_publishers(): return _publisher_domains - - - - - - - |