Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE REQUEST: return name of finished file or allow post-processing scripts #20

Closed
GoogleCodeExporter opened this issue Apr 1, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

Hi.

Yet another feature request:

I need to postprocess epubs after the download process to add them to my 
library. Currently (I'm on OS X) I dothis with a folder action, (basically a 
watched directory), but it would be nicer, if I could manage a closer 
integration into the toolchain.

There's two possibilities: 
One: would be that the downloader returns the full filepath, so I can take that 
output and stuff it into my script.

Even better would be a config option where an arbitrary script could be defined 
as postprocessing script, and the downloader would call that script after 
writing the file, eg:

post_process_cmd: /usr/local/bin/addbook -f %epub%

or something similar.

If that's already possible or easily hackable somehow, let me know, please.

Thanks. 

Original issue reported on code.google.com by grooving...@gmail.com on 2 Nov 2011 at 7:53

@GoogleCodeExporter
Copy link
Author

Interesting idea.  I'll look into it.

(FYI, I don't get any alerts from code.google.com when a new issue is created.  
Best to drop us a note in the group, too.)

Original comment by retiefj...@gmail.com on 14 Dec 2011 at 4:16

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

I've added this feature (as a post_process_cmd) to the more recent version. 
http://fanficdownloader.googlecode.com/files/fanficdownloader-4.1.1.zip

It works for me on Windows7, let me know if there's any issues with Mac.

Original comment by retiefj...@gmail.com on 14 Dec 2011 at 7:04

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Cool. I'll try it asap and let you know how it works on OS X

Original comment by grooving...@gmail.com on 15 Dec 2011 at 5:18

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Seems to have a problem:


Traceback (most recent call last):
  File "./downloader.py", line 210, in <module>
    main()
  File "./downloader.py", line 198, in main
    .substitute(metadata))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 486, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I've tried the specified command manually and it works.

Original comment by grooving...@gmail.com on 16 Dec 2011 at 2:17

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Hmmm.  It's a problem that I thought of--and I was sure I tested for, but I 
guess not.  

It's treating the entire command as one argument.  Telling it to use a shell to 
run it lets the shell parse the args in the usual fashion.

Try the attached downloader.py file (it's a one-line change) and see if that 
fixes it.

Original comment by retiefj...@gmail.com on 16 Dec 2011 at 4:08

  • Changed state: Started
  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

Works.

Thanks!

Original comment by grooving...@gmail.com on 16 Dec 2011 at 4:15

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Excellent!  I'll check in the change.

Original comment by retiefj...@gmail.com on 16 Dec 2011 at 4:24

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant