wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wget2 | Add support for pre/post download scripts (#80)


From: Andrew White (@awhite27)
Subject: Re: wget2 | Add support for pre/post download scripts (#80)
Date: Fri, 26 Apr 2024 10:41:31 +0000



Andrew White commented: 
https://gitlab.com/gnuwget/wget2/-/issues/80#note_1882314446


Thanks for the sample code. I wrote a plugin for my use case. My observations 
are as follows.

The are a couple of inconsistencies in the API:
- The typdedefs for the URL filter and options callbacks end in `_callback` but 
the finalizer and post_processor callbacks do not.
- The URL filter callback splits the output filename into path and query. The ` 
wget_intercept_action_set_set_local_filename()` takes only the filename (which 
despite the name is actually a path).

I found the `wget_plugin_register_finalizer` function unusual. Usually with 
plugins the initialize and finalize functions are always called. If the plugin 
does not need a finalizer function it just provides a stub. 

I'm hoping the plugin callbacks are always single threaded. This doesn't seem 
to be documented.

Wishlist: a Python based plugin API would be nice. Writing C code for 
manipulating URLs is not fun.

While I was able to get my plugin to do what I wanted, wget2 still does not 
work for me due to #269. I ended up going back to using my patched version of 
wget. I found it trivially easy to patch wget to write the mime type to the 
xattrs and check the mime type in `get_file_flags()`. I couldn't figure out how 
to patch wget2 to fix #269.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/issues/80#note_1882314446
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]