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

Release/1.0.2 #7

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bybit_bulk_downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self, destination_dir=".", data_type="trading"):
"""
self._destination_dir = destination_dir
self._data_type = data_type
self.downloaded_list = []

def _get_url_from_bybit(self):
"""
Expand Down Expand Up @@ -79,6 +80,8 @@ def _download(self, url):
# Create the destination directory if it does not exist
parts = url.split("/")
parts.insert(3, "bybit_data")
prefix = "/".join(parts[prefix_start:prefix_end])
self.downloaded_list.append(prefix)

# Download the file
filepath = os.path.join(
Expand Down Expand Up @@ -119,3 +122,4 @@ def run_download(self):
):
with ThreadPoolExecutor() as executor:
executor.map(self._download, prefix_chunk)
self.downloaded_list.extend(prefix_chunk)