RedGIFs Niche and Keyword Video Fetcher avatar

RedGIFs Niche and Keyword Video Fetcher

Pricing

from $40.00 / 1,000 results

Go to Apify Store
RedGIFs Niche and Keyword Video Fetcher

RedGIFs Niche and Keyword Video Fetcher

Fetch RedGIFs niche/keyword metadata and optionally Download MP4 Videos by Niche or Keyword.

Pricing

from $40.00 / 1,000 results

Rating

0.0

(0)

Developer

Webdesign Detail

Webdesign Detail

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

4 days ago

Last modified

Categories

Share

Authorized RedGIFs Niche Video Fetcher

An unofficial Python Apify Actor that discovers RedGIFs videos from authorized keyword/niche queries, normalizes their metadata, and can save authorized MP4 files to the run's default key-value store. It uses the Apify SDK for Python 4.x, HTTPX, the integrated Apify Proxy, bounded concurrency, and reproducible Docker builds.

This project is not affiliated with, endorsed by, or operated by RedGIFs.

Mandatory authorization and adult-content notice

RedGIFs hosts sexually explicit 18+ material. Run this Actor only where every operator and viewer is legally permitted to access that material. Before every run, you must have all three of the following:

  1. authorization from RedGIFs for the intended automated access;
  2. creator/rightsholder permission to download and store every requested video; and
  3. a lawful adult-use basis in every applicable jurisdiction.

Set contentRightsAcknowledged to true only when those conditions are satisfied. The checkbox records your acknowledgement; it does not create or prove permission. You remain responsible for the source's terms, privacy and publicity rights, copyright, retention, redistribution, and access controls. Do not use this Actor to bypass authentication, paywalls, technical restrictions, takedowns, or geographic/legal restrictions.

Why HTTPX instead of BeautifulSoup or Playwright?

The niche page is a React/Vite shell, so parsing its initial HTML with BeautifulSoup does not provide the product records. The authorized data path returns structured JSON and direct media URLs, which HTTPX can fetch without rendering a browser. Leaving Playwright out keeps the image smaller, startup faster, and resource usage lower.

The RedGIFs JSON interface used here is private and undocumented. It can change without notice. All endpoint-specific behavior is isolated in the RedGIFs client so it can be updated without changing the storage contract.

How a run works

The Actor:

  1. validates the authorization acknowledgement, download budgets, and standard proxyConfiguration input;
  2. rejects direct connections and custom proxies unless useApifyProxy is true;
  3. creates one sticky Apify Proxy session and stable user agent for temporary authentication, metadata pages, and media streams;
  4. resolves each keyword to a niche slug, follows one source-provided rename safely, and optionally falls back to general keyword search;
  5. paginates with bounded retries and deduplicates records by RedGIFs video ID;
  6. optionally streams each MP4 to temporary disk, validates its type/size, and streams it into the platform key-value store under video-<id>-<quality>.mp4 without loading the whole file into RAM;
  7. publishes each dataset record as soon as its item finishes, so an abort, a timeout, or a platform migration never discards completed work; and
  8. writes RUN_SUMMARY telemetry plus a RUN_STATE migration checkpoint to the default key-value store.

Authentication tokens, proxy credentials, and media bytes are never written to logs or dataset items.

Input

Minimal input:

{
"keywords": ["authorized-niche"],
"contentRightsAcknowledged": true,
"proxyConfiguration": {
"useApifyProxy": true
}
}

Useful controls include:

FieldDefaultPurpose
matchModenicheThenSearchUse only a niche or fall back to keyword search.
sorthotRequest hot, latest, or top ordering.
maxItemsPerKeyword100Bound metadata results independently for each query.
downloadVideostrueStore MP4 files as key-value records.
videoQualitybestPrefer HD, require HD, or require SD.
maxVideoBytes262144000Stop an individual file above 250 MiB.
maxTotalDownloadBytes1073741824Stop storing files after 1 GiB in a run.
downloadConcurrency2Bound simultaneous media streams.
requestTimeoutSecs45HTTP operation timeout.
maxRequestRetries4Bounded transient retry count.

With nicheThenSearch, a missing or renamed niche falls back to keyword search unless RedGIFs provides a replacement slug, in which case the Actor follows that replacement once. nicheOnly is strict: a missing or renamed niche without a usable replacement fails that keyword with an actionable message instead of reporting a misleading empty result.

The Actor fails before source access if the rights acknowledgement is not true or the integrated Apify Proxy is not enabled. Your Apify account must also have proxy access for the requested configuration.

Output and video downloads

Every default-dataset row contains the input query, discovery source, video ID/page URL, description, creator, tags/niches, creation time, duration, dimensions, audio/view/like metadata, thumbnail, selected quality, and download outcome. Successful downloads also include kvsKey, filename, mime, size, and downloadUrl. A sanitized per-item error is present when an item cannot be completed.

MP4 files are in the default key-value store's videos collection. The Output tab links to the dataset, that collection, and RUN_SUMMARY. A generated downloadUrl is subject to the key-value store's access permissions and retention; it is not a permanent hosting guarantee. Download or copy files before their storage expires.

By default, unnamed Apify datasets and key-value stores expire after seven days. Named storages can have different retention. Video downloads incur proxy traffic, platform data transfer, storage, compute, and possibly residential proxy costs. Keep item, byte, and concurrency limits conservative and review the live Apify pricing for your account before a large run.

Local development

Prerequisites: Python 3.13, uv, the Apify CLI, an authenticated Apify account, and integrated-proxy entitlement.

uv sync
apify login
apify run

For local Apify storage emulation, place the input at storage/key_value_stores/default/INPUT.json. Never commit access tokens, proxy credentials, .env files, or local storage.

Run the focused checks with:

uv run ruff check .
uv run ruff format --check .
uv run pytest --cov --cov-report=term-missing
apify validate-schema

Tests run entirely against sanitized synthetic fixtures in tests/fixtures/. They contain no adult media and make no live RedGIFs request. Coverage is gated at 80 percent.

Docker

The production image uses the official apify/actor-python:3.13 base pinned to its multi-architecture manifest digest. Its uv helper image is digest-pinned as well. The build installs only packages locked in uv.lock, copies dependency metadata before source files for efficient layer caching, and runs as the base image's non-root myuser account.

$docker build -t authorized-redgifs-video-fetcher:local .

The container entrypoint is python -m src. Use apify run for normal local execution because it configures the Actor environment and storage paths correctly.

Deployment status

The repository contains Actor definitions suitable for CI/CD, but this README does not claim that any GitHub workflow, cloud build, production tag, or Apify Store publication has completed. Store publication remains a separate manual legal, content-policy, security, and billing review.

Workflows

CI and beta deployment runs on every pull request and every push to main.

  • quality: locked dependency install, Ruff lint and format checks, byte compilation, the test suite behind an 80 percent coverage gate, and apify validate-schema.
  • docker: a linux/amd64 container build, in parallel with quality.
  • deploy-beta: only on a push to main, only after both jobs above pass, and gated on the apify-beta GitHub environment. It pushes a build tagged beta, runs a one-item metadata smoke against that exact build number, and verifies SUCCEEDED, RUN_SUMMARY, and a non-empty dataset.

beta is not the tag normal runs resolve to, so a merge never changes what an existing user gets. The beta smoke does make one authorized metadata request to the target after a successful push.

Release latest Actor build is manual dispatch only. It requires the exact successful beta build ID and the confirm_release checkbox, and it is gated on the apify-production GitHub environment. It runs a bounded one-video smoke against that exact build, verifies the MP4 record, and then moves the latest tag to the already-tested build without rebuilding it. Because latest is the tag normal runs resolve to, this is the step that changes production behavior.

First-time setup

The Actor must exist on Apify before the workflows can target it, so create it from a workstation first with apify push --build-tag beta. Then create both the apify-beta and apify-production GitHub environments and configure these repository or environment secrets:

  • APIFY_TOKEN: token allowed to build, run, inspect, and retag this Actor;
  • APIFY_ACTOR_ID: the Actor ID;
  • APIFY_SMOKE_KEYWORD: an authorized query used for the metadata-only beta smoke; and
  • APIFY_VIDEO_SMOKE_KEYWORD: an authorized query whose first result may be downloaded during the manual production gate.

Add required reviewers to apify-production if releases should need approval. The smoke keywords are secrets so the workflow does not hardcode or expose the authorized target selection.

.actorignore keeps caches, virtualenvs, tests, and local storage out of what is uploaded to the platform.

Operational limitations

  • A source API change can break discovery or downloads even when the website UI still works.
  • Dataset rows are written in completion order rather than discovery order, because items are published as they finish.
  • On Apify, validated files are uploaded to KVS with a streaming authenticated PUT. Local storage emulation still uses the SDK value interface, so keep local test file limits conservative.
  • This Actor deliberately does not crawl RedGIFs watch pages and does not include a browser fallback.

For Apify lifecycle, storage, proxy, and deployment behavior, see the Apify SDK for Python documentation, Actor definition documentation, and storage documentation.