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

Include Rar3 volume number #58

Closed
Safihre opened this issue Sep 26, 2019 · 4 comments
Closed

Include Rar3 volume number #58

Safihre opened this issue Sep 26, 2019 · 4 comments

Comments

@Safihre
Copy link
Contributor

Safihre commented Sep 26, 2019

We (me and @sanderjo) were very happy to see your activity here again!
And now you also added a way to actually retrieve the volume number from Rar5 files.
Could you implement the same for Rar3? It would be very useful for our application where we have to deal with obfuscated Rar files and detect which ones belong together.

We now have our own custom code, but would be great if we could use Rarfile for everything! We already use it in a number of different locations in our application.
sabnzbd/sabnzbd@a5c8318

@markokr
Copy link
Owner

markokr commented Jul 19, 2020

Unfortunately RAR3 does not contain such info, so cannot implement it.

@markokr markokr closed this as completed Jul 19, 2020
@sanderjo
Copy link

sanderjo commented Jul 19, 2020

Unfortunately RAR3 does not contain such info, so cannot implement it.

Did you see sabnzbd/sabnzbd@a5c8318#diff-13c4161154ee8c590e1c06c8cbc3da8dR20-R24 ?

The volume number is at the end of each rar3 file, like this:

            if rar_ver == 3:
                # At the end of the file, we need about 20 bytes
                fh.seek(-20, os.SEEK_END)
                mybuf = fh.read()
                volumenumber = 1 + mybuf[-9] + 256 * mybuf[-8]

We use it like that in the Sabnzbd code. Which works.

@markokr
Copy link
Owner

markokr commented Jul 19, 2020

Aha, I missed it then. Its problably endarc-volnr, which we dont parse yet. But indeed we should.

@markokr markokr reopened this Jul 19, 2020
@markokr
Copy link
Owner

markokr commented Jul 20, 2020

Please see if it works for you now.

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

No branches or pull requests

3 participants