golift / xtractr Goto Github PK
View Code? Open in Web Editor NEWGo Library for Queuing and Extracting Archives: Rar, Zip, 7zip, Gz, Tar, Tgz, Bz2, Tbz2
Home Page: https://golift.io/discord
License: MIT License
Go Library for Queuing and Extracting Archives: Rar, Zip, 7zip, Gz, Tar, Tgz, Bz2, Tbz2
Home Page: https://golift.io/discord
License: MIT License
I'm filing this here as the problem is with the xtractr, but it's realized when using your unpackerr.
When the extractor checks to see if the SearchPath is empty, if it errors out while checking, it assumes the path is empty and deletes it. You should check for an error condition and print out a warning instead of deleting.
Lines 338 to 340 in e200b91
Logs:
2022/08/05 10:39:09 Error: Reading path '/media/downloads/complete/sonarr/Some.Folder': lstat /media/downloads/complete/sonarr/Some.Folder/Some.File.mkv: input/output error
2022/08/05 10:39:09 Deleted (recursively): /media/downloads/complete/sonarr/Some.Folder
2022/08/05 10:38:17 Extraction Started: Some.Folder, items in queue: 0
2022/08/05 10:39:09 Deleted (recursively): /media/downloads/complete/sonarr/Some.Folder_unpackerred
2022/08/05 10:39:09 Extraction Finished: Some.Folder => elapsed: 52s, archives: 1, extra archives: 0, files extracted: 1, wrote: 3030MiB
Make sure we do not recurse into ISO files. That's probably not wanted. Unpackerr/unpackerr#232
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/codetests.yml
actions/checkout v4
actions/setup-go v5
actions/setup-go v5
actions/checkout v4
golangci/golangci-lint-action v3
actions/setup-go v5
actions/checkout v4
golangci/golangci-lint-action v3
go.mod
go 1.19
github.com/andybalholm/brotli v1.1.0
github.com/bodgit/sevenzip v1.5.1
github.com/kdomanski/iso9660 v0.4.0
github.com/klauspost/compress v1.17.8
github.com/nwaples/rardecode v1.1.3
github.com/pierrec/lz4/v4 v4.1.21
github.com/sshaman1101/dcompress v0.0.0-20200109162717-50436a6332de@50436a6332de
github.com/stretchr/testify v1.9.0
github.com/therootcompany/xz v1.0.1
Hello,
I had an issue with unpackerr due to one of the *Arrs where an archive was mislabelled as RAR, but it was in fact a 7z archive. This is easily identified using the file command: file actually_7z.rar
. Archives generally have magic numbers to identify their type more reliably, I think this is a less brittle method.
Line 274 in a1f7335
I have scenarios where the total length of the file paths being extracted are too long for the system's maximum path length. Mostly with naming from languages outside of english. Anyway, before I make a PR, I was wondering if there is something I'm missing in the code that can supress this error or ideally can handle it properly?
Again, I am looking at the code and it doesn't look like it but, I can be blind sometimes, so I figured I'd ask before I start a PR.
And for the sake of clarity and example, I a check like this in rar.go:
func MaxPathLength ...
// find the max path length based on the system and return it
// or, if that's annoying, then just set the max to a const with some sane limit that works for all systems
func (x *XFile) unrar(rarReader *rardecode.ReadCloser) (int64, []string, error) {
...
for {
header, err := rarReader.Next()
...
wfile := x.clean(header.Name)
if len(wfile) > MaxPathLength() {
// Skip the file with some warning or something...
log.Warnf("Skipping file with long path: %s", wfile)
continue
// Or, what woiuld be even better is truncate the file name somehow inside the archive...
}
}
}
Your library came in as a life saver for me, so thank you for your work! ๐
PS: if I do a PR, I'm thinking a handler for this so the user can handle the logic for dealing with it but I'm open to whatever you think would be best for your package.
DeleteOrig
only deletes the first archive file and not the entire group.
Make response can receive the current progress.
Just a suggestion I don't think this is definitely a good feature and may cause performance issues. But it would be a good feature to be able to choose whether to restore the current progress.
Add support for these where possible and reasonable:
.lz4
.br
.sz
.xz
.zz
.Z
.zst
.lzh, .lha
(not ready).lzx
(three parts, needs a detector?).deb
.rpm
.cpio
.asar
.cab
.lzma .lz .lzip
arj
(requested but no library exists)Include additional extensions we may be missing, especially for the variants of compression+tar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.