script.module.archive_tool
#1
I made a simple archive module for my own uses. Posting it here in case other addon creators would find it useful.
script.module.archive_tool

Usage:
python:

import archive_tool
my_archive = archive_tool.archive_tool(archive_file = 'myfile.zip',directory_out = '/my/output_directory/') #Current archive object
file_listing = my_archive.list_all() #Lists all files in the archive
file_listing_dict = my_archive.stat_all() #Dict of all files in the archive containing fullpath, filename, file size (extracted)
files_extracted, success_of_extraction = my_archive.extract() #Extracts all files to directory_out, returns list of files extracted and True/False for extraction success. Defaults to extract all files in the archive.

Reply
#2
Is it for extracting.rar field?
Reply
#3
(2019-11-10, 20:33)ed_davidson Wrote: Is it for extracting.rar field?

It should be able to extract any of the following filetypes:
.7z, .tar.gz, .tar.bz2, .tar.xz, .zip, .rar, .tgz, .tbz2, .gz, .bz2, .xz, .cbr
Reply
#4
Hey Zach, can't seem to import the tool on v18.
Get this:

                                                import archive_tool
                                            ImportError: No module named archive_tool

I did install the zip and had to bypass the 3.0.0 on vfs.rar (I know it's optional but it was requesting...)
Thanks.
Reply
#5
(2020-03-09, 22:35)HiGhLaNdeR Wrote: Hey Zach, can't seem to import the tool on v18.
Get this:

                                                import archive_tool
                                            ImportError: No module named archive_tool

I did install the zip and had to bypass the 3.0.0 on vfs.rar (I know it's optional but it was requesting...)
Thanks.

Yeah, looks like there was a small file location error. Try the newest version, and then just make sure you have the following in your addon.xml:
<requires>
<import addon="script.module.archive_tool"/>
</requires>
Reply
#6
Hi Zach,
i want to use your archive.tool, but can i use it for password required zipfiles?
if yes, how ?

Thanks
Reply
#7
(2022-06-17, 12:50)muellaymer Wrote: Hi Zach,
i want to use your archive.tool, but can i use it for password required zipfiles?
if yes, how ?

Thanks

Good question. The script is a wrapper for vfs.libarchive (Archive Support) addon in Kodi, so it would have to support password protected files. I looked and it currently does not appear to (or if it does there's no documentation on it). I'll add a request in the addon repository about supporting it.
Reply

Logout Mark Read Team Forum Stats Members Help
script.module.archive_tool0