mirror of
https://github.com/kemayo/leech
synced 2025-12-06 16:33:16 +01:00
Slightly more info about what happened
This commit is contained in:
parent
136c31ef22
commit
186daa19fb
1 changed files with 9 additions and 2 deletions
11
leech.py
11
leech.py
|
|
@ -29,6 +29,8 @@ def leech(url, filename=None):
|
|||
return
|
||||
|
||||
story = site.extract(url, fetch)
|
||||
if not story:
|
||||
return
|
||||
|
||||
metadata = {
|
||||
'title': story['title'],
|
||||
|
|
@ -43,6 +45,8 @@ def leech(url, filename=None):
|
|||
|
||||
epub.make_epub(filename, html, metadata)
|
||||
|
||||
return filename
|
||||
|
||||
_sites = []
|
||||
|
||||
def _get_site(url):
|
||||
|
|
@ -66,5 +70,8 @@ if __name__ == '__main__':
|
|||
parser.add_argument('--filename', help="output filename (the title is used if this isn't provided)")
|
||||
args = parser.parse_args()
|
||||
|
||||
leech(args.url, filename=args.filename)
|
||||
pass
|
||||
filename = leech(args.url, filename=args.filename)
|
||||
if filename:
|
||||
print("File created:", filename)
|
||||
else:
|
||||
print("A problem occurred.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue