Skip to content

Configuration update#79

Merged
partiallywritten merged 5 commits intomainfrom
docs-update
Mar 11, 2026
Merged

Configuration update#79
partiallywritten merged 5 commits intomainfrom
docs-update

Conversation

@partiallywritten
Copy link
Copy Markdown
Owner

The configuration file now accepts:

  • DDL_TOTAL_LIMIT - Maximum number of simultaneous connections the bot can have open at any given time when dealing with "DDL to Mega.nz" feature. Meaning at any given time, your bot can download 100 files using direct links. If you don't understand it, it is best to leave it as is unless you are expecting very heavy traffic.
  • DDL_POOL_LIMIT - Maximum number of simultaneous connections allowed per host (host = site like myfileserver.com). Again if you don't understand it, it is best to leave it as is unless you are expecting very heavy traffic.
  • SPLITTER_BUFFER_SIZE - The size of file chunk thats read and written at a time by the file splitter. Use default number (1 MiB) to keep ram usage minimal.

Copilot AI review requested due to automatic review settings March 11, 2026 22:01
@partiallywritten partiallywritten merged commit 1c129dd into main Mar 11, 2026
4 checks passed
@partiallywritten partiallywritten deleted the docs-update branch March 11, 2026 22:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates project documentation links and makes file-splitting behavior more configurable by exposing the splitter buffer size via environment/config, aligning installer and sample env defaults with current runtime defaults.

Changes:

  • Updated README documentation/config-var links to the new GitBook site.
  • Made splitit() accept explicit split_size and buffer_size, wired from TG_MAX_SIZE and new SPLITTER_BUFFER_SIZE.
  • Updated installer.sh and .env.sample defaults (including chunk/buffer sizing).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Updates docs/config-vars links to new documentation host.
megadl/helpers/files.py Changes splitit() signature to pass split size + buffer size through to the async splitter.
megadl/helpers/cypher.py Adds SPLITTER_BUFFER_SIZE env var and passes it into splitting during oversized uploads.
installer.sh Writes SPLITTER_BUFFER_SIZE (and DDL limits) into generated .env.
.env.sample Updates sample defaults to match current code defaults and includes SPLITTER_BUFFER_SIZE.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.


self.tmp_loc = f"{self.dl_loc}/temps"
self.mx_size = int(os.getenv("TG_MAX_SIZE", 2040108421))
self.splt_buffer = int(os.getenv("SPLITTER_BUFFER_SIZE", 1048576)) # 1024 * 10224
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment for SPLITTER_BUFFER_SIZE is incorrect (1024 * 10224). This looks like a typo for 1024 * 1024 (1MiB) and could confuse users when tuning the buffer. Please fix the comment (or drop it since the default value already communicates the size).

Suggested change
self.splt_buffer = int(os.getenv("SPLITTER_BUFFER_SIZE", 1048576)) # 1024 * 10224
self.splt_buffer = int(os.getenv("SPLITTER_BUFFER_SIZE", 1048576)) # 1024 * 1024 (1 MiB)

Copilot uses AI. Check for mistakes.
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

Successfully merging this pull request may close these issues.

2 participants