SimpleSyntax
SimpleSyntax is a lightweight, CSS-selector-inspired Python library for downloading media and extracting metadata from various platforms. It provides a clean, declarative API for handling media tasks with automatic cookie fallback, metadata extraction, playlist handling, and image fallback support.
Current Version
0.1.3
What's Fixed / Improved in 0.1.3
- Fixed caller-scope variable assignment so values returned by
rz()are available directly in the user's Python scope. - Improved cookie fallback handling with cookie ranking based on the target site's hostname and cookie filename.
- Added a 40% cookie-match threshold so unrelated cookie files are skipped.
- Added ordered cookie fallback attempts for matching cookie files.
- Added successful URL/cookie history support through the helper file.
- Preserved the
ReiZyukicookie-list API for user-supplied cookie files. - Improved media fallback flow between video downloading and image downloading.
- Kept the CSS-inspired selector API and existing
rz({...}, url)syntax unchanged. - Metadata selectors continue to support title, creator, URL, views, likes, comments, duration, thumbnail, date, and live status.
- Playlist selector support remains available through
QUALITY:SKIP:COUNTsyntax.
Requirements
- Python >= 3.9
- yt-dlp
- gallery-dl
ffmpeg(required for merging audio/video streams)
Installation
pip install simplesyntax
The package installs its Python dependencies automatically. ffmpeg should be available separately when media merging is required.
Basic Usage
The library provides a single entry point, rz, using a CSS-inspired selector syntax.
from simplesyntax import rz
url = "https://example.com/video"
rz({
"video[3]": "my_video",
"title": "video_title"
}, url)
print(f"Downloaded: {my_video}")
print(f"Title: {video_title}")
Selector Syntax
Media Selectors
Media selectors support a quality index from 0 to 6:
video[N]: Downloads video/audio media.media[N]: Attempts video downloading first and falls back to image downloading if the video engine fails.
Quality Index (N):
0: Audio only1: 360p2: 480p3: 720p4: 1080p5: 1440p6: Best quality
Metadata Selectors
The following metadata selectors are supported:
titlecreatorurlviewslikescommentsdurationthumbnaildate(YYYY/MM/DD)live
Cookie & Fallback System
SimpleSyntax supports optional cookie files through a variable named ReiZyuki in the caller's scope:
ReiZyuki = [
"/path/to/youtube.txt",
"/path/to/instagram.txt",
"/path/to/reddit.txt"
]
The fallback system:
- Matches the target site's hostname against supplied cookie filenames.
- Calculates a cookie match score.
- Skips cookies below the 40% match threshold.
- Tries the best matching cookie first.
- Falls back to a no-cookie attempt when the matching cookie fails.
- Continues with the next matching cookie when necessary.
- Records successful URL/cookie associations in the helper history file.
No cookie files are scanned automatically; only paths supplied through ReiZyuki are used.
Playlist Handling
Playlist downloads use the existing QUALITY:SKIP:COUNT syntax:
rz({"playlist": "3:0:5"}, url)
This downloads 5 items starting from index 0 using quality index 3 (720p).
Notes
Some platforms may still require valid cookies or may restrict automated access. A platform-side HTTP/API restriction does not necessarily indicate a SimpleSyntax selector or fallback error.
Author: ReiZyuki
SimpleSyntax 0.1.3
Metadata
Release files for simplesyntax 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| simplesyntax-0.1.3.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simplesyntax-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.3 kB
Release files / simplesyntax-0.1.3.tar.gz
| Download URL | simplesyntax-0.1.3.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4548e08c4c8ccf11e2f2d870ecab179659367a095a67da291d6395434bd77ae6
|
|
BLAKE2b-256 checksum How to use checksums |
4bf4675c4eaa0e0fffbfeb12157c3565486c8518df3c756ca8f07401e1056d1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / simplesyntax-0.1.3-py3-none-any.whl
| Download URL | simplesyntax-0.1.3-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
268bf514abcb75ba4da967bc29d103b40a541390487dd90cc1be0953c3069c6e
|
|
BLAKE2b-256 checksum How to use checksums |
5dd03cbd96ac3982bddcc133d064057ce4ecc6cbc8661ac58cca751d8c1001c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log