Giter Club home page Giter Club logo

xtractr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

xtractr's Issues

Deletes SearchPath on Error

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.

xtractr/queue.go

Lines 338 to 340 in e200b91

if len(x.GetFileList(resp.X.SearchPath)) == 0 {
// If the original path is empty, delete it.
x.DeleteFiles(resp.X.SearchPath)

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

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.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
gomod
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

  • Check this box to trigger a request for Renovate to run again on this repository

Xtractr should use file content to determine archive type

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.

if strings.HasSuffix(sName, ext.Extension) {

Handling long paths inside of archives

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.

Add progress bar

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.