Plugin options
Platform-specific parameters for authentication and configuration.
Credential precedence
All plugins follow this pattern:
- Explicit kwargs (highest priority) - passed directly to
extract() - Environment variables (fallback) - loaded from system environment
- Graceful failure - plugins work without credentials when possible
Example:
import os
import megaloader as mgl
os.environ["FANBOX_SESSION_ID"] = "env_value"
mgl.extract("https://creator.fanbox.cc") # Uses "env_value"
os.environ["FANBOX_SESSION_ID"] = "env_value"
mgl.extract("https://creator.fanbox.cc", session_id="kwarg_value") # Uses "kwarg_value"GoFile
password (string, optional)
Password for accessing password-protected folders.
Environment variable: Not supported
Example:
for item in mgl.extract("https://gofile.io/d/abc123"):
print(item.filename)
for item in mgl.extract("https://gofile.io/d/xyz789", password="secret"):
print(item.filename)CLI:
megaloader download "https://gofile.io/d/xyz789" ./output --password secretGoFile hashes passwords with SHA-256 before sending to the API. Invalid passwords result in empty file lists without raising errors.
Fanbox
session_id (string, required for most content)
Authentication cookie for accessing creator content.
Environment variable: FANBOX_SESSION_ID
How to obtain:
- Log in to Fanbox
- Open browser DevTools (F12)
- Application/Storage → Cookies
- Find
FANBOXSESSID - Copy the value
Example:
for item in mgl.extract(
"https://creator.fanbox.cc",
session_id="your_session_cookie"
):
print(item.filename)
import os
os.environ["FANBOX_SESSION_ID"] = "your_session_cookie"
for item in mgl.extract("https://creator.fanbox.cc"):
print(item.filename)CLI:
export FANBOX_SESSION_ID="your_session_cookie"
megaloader download "https://creator.fanbox.cc" ./outputMost creator content requires authentication. Session cookies expire periodically. Without authentication, you'll get 403 errors.
Pixiv
session_id (string, required for most content)
Authentication cookie for accessing artworks and user profiles.
Environment variable: PIXIV_PHPSESSID
How to obtain:
- Log in to Pixiv
- Open browser DevTools (F12)
- Application/Storage → Cookies
- Find
PHPSESSID - Copy the value
Example:
for item in mgl.extract(
"https://www.pixiv.net/en/artworks/123456",
session_id="your_session_cookie"
):
print(item.filename)
for item in mgl.extract(
"https://www.pixiv.net/en/users/789012",
session_id="your_session_cookie"
):
print(item.filename)CLI:
export PIXIV_PHPSESSID="your_session_cookie"
megaloader download "https://www.pixiv.net/en/artworks/123456" ./outputRequired for most content. Multi-page artworks are automatically detected. User extraction includes profile images and all artworks.
Rule34
api_key (string, optional)
API key for authenticated access with higher rate limits.
Environment variable: RULE34_API_KEY
user_id (string, optional)
User ID associated with the API key.
Environment variable: RULE34_USER_ID
How to obtain:
- Create Rule34 account
- Go to account settings
- Generate API key
- Note user ID from profile
Example:
for item in mgl.extract("https://rule34.xxx/index.php?page=post&s=list&tags=cat"):
print(item.filename)
for item in mgl.extract(
"https://rule34.xxx/index.php?page=post&s=list&tags=cat",
api_key="your_api_key",
user_id="your_user_id"
):
print(item.filename)CLI:
export RULE34_API_KEY="your_api_key"
export RULE34_USER_ID="your_user_id"
megaloader download "https://rule34.xxx/..." ./outputAPI authentication is optional but recommended. Without credentials, the plugin falls back to web scraping (slower). Both api_key and user_id must be provided together.
Security best practices
Never commit credentials to version control:
Bad:
for item in mgl.extract(url, session_id="abc123def456"):
passGood:
import os
session_id = os.getenv("FANBOX_SESSION_ID")
for item in mgl.extract(url, session_id=session_id):
passStore credentials in environment variables or .env files:
# .env file
FANBOX_SESSION_ID=your_session_value
PIXIV_PHPSESSID=your_session_value
RULE34_API_KEY=your_api_key
RULE34_USER_ID=your_user_idLoad them in code:
from dotenv import load_dotenv
load_dotenv()Rotate credentials regularly when sessions expire.