Skip to content

Commit

Permalink
fix(linux): search for beginning of the archive from byte 0
Browse files Browse the repository at this point in the history
  • Loading branch information
imLinguin committed Oct 3, 2024
1 parent 1ff0982 commit 53964bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gogdl/dl/objects/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,15 @@ def __init__(self, url, product_id, session):
self.product = product_id
self.session = session
self.file_size = 0

SEARCH_OFFSET = 0
SEARCH_RANGE = 2 * 1024 * 1024 # 2 MiB

beginning_of_file = self.get_bytes_from_file(
from_b=1024*512, size=1024*1024, add_archive_index=False
from_b=SEARCH_OFFSET, size=SEARCH_RANGE, add_archive_index=False
)

self.start_of_archive_index = beginning_of_file.find(LOCAL_FILE_HEADER) + 1024*512
self.start_of_archive_index = beginning_of_file.find(LOCAL_FILE_HEADER) + SEARCH_OFFSET

# ZIP contents
self.central_directory_offset: int
Expand Down

0 comments on commit 53964bd

Please sign in to comment.