Pinchana YouTube Shorts
This FastAPI module downloads supported public YouTube Shorts with yt-dlp. It prefers H.264 video and AAC audio in MP4, targets up to 1080p, and can transcode output that exceeds the configured size-per-minute threshold.
This module serves /shorts/ URLs through the normal scrape gateway. Ordinary YouTube and youtu.be browser downloads use the separate DLP workflow.
API
POST /scrapeaccepts{"url":"https://www.youtube.com/shorts/VIDEO_ID"}.GET /healthreports service, VPN, and cookie readiness.
External clients should call the gateway's authenticated POST /v1/scrape route.
Configuration
| Variable | Default | Purpose |
|---|---|---|
CACHE_PATH |
./cache |
Media cache path |
CACHE_MAX_SIZE_GB |
10.0 |
Cache size limit |
YTDLP_COOKIES_DIR |
/run/pinchana-cookies |
Read-only source directory for cookie files |
YTDLP_COOKIE_FILE |
unset | Optional explicit cookie-file override |
SHORTS_MAX_MB_PER_MINUTE |
18.0 |
Threshold for optional transcoding |
SHORTS_X264_CRF |
24 |
x264 quality value |
SHORTS_X264_PRESET |
veryfast |
x264 speed/compression preset |
SHORTS_MAXRATE |
2500k |
Maximum target video bitrate |
SHORTS_AUDIO_BITRATE |
128k |
Target AAC bitrate |
Mount the host cookie directory read-only and exclude it from version control. The service copies the selected file to a temporary writable location for yt-dlp and removes that copy after the request.
Age-restricted Shorts require a valid session from a YouTube account that can play the video. If YouTube requires age verification, the scraper returns HTTP 403. The cookies_available health field indicates whether a cookie file is present. If yt-dlp reports that YouTube rotated the cookies, export a fresh session using yt-dlp's instructions and replace the mounted file.
Development
uv sync --frozen
uv run uvicorn pinchana_shorts.main:app --host 0.0.0.0 --port 8083 --reload
# Run from the repository root.
docker build --file scrapers/pinchana-shorts/Dockerfile --tag pinchana-shorts:local .
Metadata
Release files for pinchana-shorts 26.11.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pinchana_shorts-26.11.17.tar.gz | 7.2 kB | With provenance | Details for pinchana_shorts-26.11.17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pinchana_shorts-26.11.17-py3-none-any.whl | Python 3 | none | any | Details for pinchana_shorts-26.11.17-py3-none-any.whl |
Total release size: 15.4 kB
Release files / pinchana_shorts-26.11.17.tar.gz
| Download URL | pinchana_shorts-26.11.17.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6dc0715b40eefb4a13e60296e58d538e45ca28cf9309ef3543380fa6b532beaa
|
|
BLAKE2b-256 checksum How to use checksums |
d2b21b3c74f765f95fe0d1583090b07e55a1dc3e1bbaac4e3e595b953c82ece9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 26, 2026.
Transparency logRelease files / pinchana_shorts-26.11.17-py3-none-any.whl
| Download URL | pinchana_shorts-26.11.17-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2764e87300d59b1291b6040dfe8b9511ae9b42717aa6a08c5c1f7661a8c53896
|
|
BLAKE2b-256 checksum How to use checksums |
fef2e3bc6f38d8a0f75d72c2a40972926546cfb0c0ba695f2d81e39566f48c5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 26, 2026.
Transparency logSecurity for pinchana-shorts 26.11.17
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pinchana_shorts-26.11.17.tar.gz
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 Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.