PHPackages                             easynewsdownloader/easynews - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. easynewsdownloader/easynews

ActiveLibrary[API Development](/categories/api)

easynewsdownloader/easynews
===========================

PHP port of the EasyNews service and query builder.

v1.0.3(today)110↑2600%MITPHPPHP &gt;=8.0

Since Jun 30Pushed todayCompare

[ Source](https://github.com/btafoya/easynewsdownloader)[ Packagist](https://packagist.org/packages/easynewsdownloader/easynews)[ RSS](/packages/easynewsdownloader-easynews/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

easynewsdownloader/easynews
===========================

[](#easynewsdownloadereasynews)

[![PHP](https://camo.githubusercontent.com/8aa41ea7f8168ba0065b3d53aa343b06686652db1bc5b5af410cf795b633c68f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e302d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/286fe4153c62db4004c4b70a664ee81c73063dd127e63486ab6d9dbae282edd6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656173796e657773646f776e6c6f616465722f656173796e6577732e737667)](https://packagist.org/packages/easynewsdownloader/easynews)[![PHPUnit](https://camo.githubusercontent.com/b15e11348e7238f7eef4b687d94daab23c086f26e6d3c767749b3559f3c8e2b6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850556e69742d392d6173736572746976652e737667)](https://phpunit.de/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

PHP library for the EasyNews search and NZB download service.

This library provides a PSR-4, PHP 8.0+ wrapper around the EasyNews members API for searching Usenet video releases and downloading NZB and video files.

Source repository:

Requirements
------------

[](#requirements)

- PHP `>= 8.0`
- `ext-curl`
- `ext-intl`

Installation
------------

[](#installation)

```
composer require easynewsdownloader/easynews
```

Configuration
-------------

[](#configuration)

The library reads configuration from environment variables by default. You may also pass an explicit config array to the constructor.

### Environment variables

[](#environment-variables)

VariableDescriptionDefault`EASYNEWS_ENABLED`Enable or disable the integration`false``EASYNEWS_USERNAME`EasyNews account username—`EASYNEWS_PASSWORD`EasyNews account password—`EASYNEWS_MIN_SIZE_MB`Minimum release size in MB`100``EASYNEWS_TEXT_MODE_ONLY`Disable strict metadata matching`false``ADDON_BASE_URL`Base URL used for generated download links—`EASYNEWS_VIDEO_DOWNLOAD_TIMEOUT_MS`Absolute cURL timeout for video downloads in milliseconds. `0` disables the absolute timeout.`0``EASYNEWS_DOWNLOAD_LOW_SPEED_TIME_MS`Window for low-speed detection in milliseconds`60000``EASYNEWS_DOWNLOAD_LOW_SPEED_LIMIT_BPS`Minimum acceptable transfer speed in bytes per second during the low-speed window`10240`You can also pass a shared array of values as the first argument to the constructor:

```
$service = new EasyNewsDownloader\EasyNews\EasynewsService([
    'EASYNEWS_ENABLED'    => 'true',
    'EASYNEWS_USERNAME'   => 'myuser',
    'EASYNEWS_PASSWORD'   => 'mypass',
    'EASYNEWS_MIN_SIZE_MB'=> '200',
], [
    'sharedSecret' => 'my-secret',
]);
```

The second constructor argument is an optional runtime config array:

KeyDescription`addonBaseUrl`Override `ADDON_BASE_URL``sharedSecret`Secret segment added to generated download URLs`videoDownloadTimeoutMs`Override `EASYNEWS_VIDEO_DOWNLOAD_TIMEOUT_MS``downloadLowSpeedTimeMs`Override `EASYNEWS_DOWNLOAD_LOW_SPEED_TIME_MS``downloadLowSpeedLimitBps`Override `EASYNEWS_DOWNLOAD_LOW_SPEED_LIMIT_BPS`Quick start
-----------

[](#quick-start)

```
require 'vendor/autoload.php';

use EasyNewsDownloader\EasyNews\EasynewsService;

$service = new EasynewsService();

$results = $service->searchEasynews([
    'rawQuery' => 'Dune 2024',
]);

foreach ($results as $result) {
    echo $result['title'] . ' - ' . $result['directUrl'] . PHP_EOL;
}
```

Searching
---------

[](#searching)

`EasynewsService::searchEasynews()` accepts an options array and returns a list of normalized results.

### Options

[](#options)

OptionTypeDescription`rawQuery`stringPrimary search query`fallbackQuery`stringQuery to use if `rawQuery` is empty`year`intExpected release year`season`intExpected season number`episode`intExpected episode number`strictMode`boolEnable strict metadata matching`specialTextOnly`boolTreat the request as a text-only special request### Returned result fields

[](#returned-result-fields)

Each result is an associative array:

FieldTypeDescription`title`stringRelease title`downloadUrl`stringURL that can be used to download the NZB`guid`stringUnique identifier`indexer`stringAlways `Easynews``indexerId`stringAlways `easynews``size`intSize in bytes`pubDate`string|nullISO 8601 post date`publishDateMs`intPost date as milliseconds since epoch`ageDays`intAge in days`release`arrayContains `resolution` and `languages``poster`string|nullUsenet poster`easynewsPayload`stringBase64-encoded payload used for NZB download`directUrl`stringDirect EasyNews video download URL`_sourceType`stringAlways `easynews``group`string|nullUsenet groupBuilding search queries
-----------------------

[](#building-search-queries)

For applications that start with metadata rather than a raw query string, use `EasynewsQueryBuilder::buildEasynewsSearchParams()`. It converts structured metadata into a set of search strings.

```
use EasyNewsDownloader\EasyNews\EasynewsQueryBuilder;

$params = EasynewsQueryBuilder::buildEasynewsSearchParams([
    'type'                => 'series',
    'tmdbTitles'          => [
        ['title' => 'Severance', 'asciiTitle' => 'Severance', 'language' => 'en'],
    ],
    'releaseYear'         => 2022,
    'seasonNum'           => 1,
    'episodeNum'          => 1,
    'textQueryFallbackValue' => 'Severance',
    'strictMode'          => true,
]);

// $params['queries']  => ['Severance S01E01']
```

### Query builder input

[](#query-builder-input)

ParameterTypeDescription`type`string`movie` or `series``releaseYear`int|nullRelease year`seasonNum`int|nullSeason number`episodeNum`int|nullEpisode number`tmdbTitles`arrayArray of title objects with `title`, `asciiTitle`, and `language``isAnimeRequest`boolWhether to include anime titles`animeSearchableTitles`arrayAnime title objects`textQueryFallbackValue`string|nullFallback raw query`movieTitle`string|nullMovie title`baseIdentifier`string|nullLast-resort identifier`isSpecialRequest`boolSpecial/text-only mode`specialMetadataTitle`string|nullTitle to use in special mode`requestLacksIdentifiers`boolForce text-only behavior`strictMode`boolEnable strict matching`normalizeToAscii`callable|nullOptional callable for ASCII normalization### Query builder output

[](#query-builder-output)

Returns `null` when no usable queries can be built, otherwise an array with:

KeyDescription`queries`Array of search strings`fallbackQuery`Query to use as a fallback`year`Parsed year`season`Parsed season`episode`Parsed episode`strictMode`Strict mode flag`specialTextOnly`Text-only flagDownloading NZBs
----------------

[](#downloading-nzbs)

Use a result's `easynewsPayload` with `downloadEasynewsNzb()`:

```
$result = $results[0] ?? null;
if ($result !== null) {
    $nzb = $service->downloadEasynewsNzb($result['easynewsPayload']);

    file_put_contents($nzb['fileName'], $nzb['buffer']);
}
```

The returned array contains:

FieldDescription`buffer`The NZB contents`fileName`Suggested file name`contentType`Content type headerDownloading video files
-----------------------

[](#downloading-video-files)

Each search result includes a `directUrl` that points to the raw video file on EasyNews. Use `downloadVideoFile()` to stream it straight to disk. The method resumes partial files, creates missing parent directories, and throws `RuntimeException` on failure.

```
$result = $results[0] ?? null;
if ($result !== null) {
    $service->downloadVideoFile($result, '/downloads/movie.mp4');
}
```

Behavior:

- Streams directly to disk; large files are not loaded into memory.
- Sends an HTTP `Range` request when the destination already exists so partial downloads resume.
- Auto-creates the destination directory tree.
- Returns `true` on success, throws `RuntimeException` on errors.
- By default there is **no absolute timeout** for video transfers, so large or slow downloads are allowed to run to completion as long as data keeps moving.
- Stalled transfers are aborted using cURL low-speed detection: if the average speed drops below `EASYNEWS_DOWNLOAD_LOW_SPEED_LIMIT_BPS` for `EASYNEWS_DOWNLOAD_LOW_SPEED_TIME_MS`, cURL kills the connection. Defaults are 10 KB/s over a 60-second window.

Helper scripts
--------------

[](#helper-scripts)

The `scripts/` directory contains convenience scripts for manual testing:

- `scripts/easynews_search.sh` — Run an EasyNews search and print JSON results. Reads credentials from `.env`.

    ```
    ./scripts/easynews_search.sh 'Dune+2024+2160p'
    ```
- `scripts/search_and_download.php` — Search for a specific release and download the first result to `/tmp/`. Reads credentials from `.env`.

    ```
    ./scripts/search_and_download.php
    ```

Credential check
----------------

[](#credential-check)

```
echo $service->testEasynewsCredentials([
    'username' => 'myuser',
    'password' => 'mypass',
]);
```

Utilities
---------

[](#utilities)

`EasynewsUtils` exposes the stateless helpers used by the service and query builder.

```
use EasyNewsDownloader\EasyNews\EasynewsUtils;

$ascii  = EasynewsUtils::foldAccents('Über');     // Ueber
$clean  = EasynewsUtils::cleanSearchTitle('Café'); // Cafe
$bool   = EasynewsUtils::toBoolean('yes', false);   // true
$date   = EasynewsUtils::coerceDate('2024-01-01');
$seconds = EasynewsUtils::parseDurationSeconds('1h30m'); // 5400
```

Notes
-----

[](#notes)

- The service only returns results when `EASYNEWS_ENABLED` is truthy and both username and password are set.
- Strict mode performs title, year, season, and episode validation against parsed release metadata.
- The `downloadUrl` field assumes a downstream endpoint that accepts `easynewsPayload` and calls `downloadEasynewsNzb()`.
- The `directUrl` field is the raw EasyNews video URL and can be used directly with `downloadVideoFile()`.

License
-------

[](#license)

This project is released under the MIT License.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f2a110a0584defebf67f20a814a73e1fd431f6203d1bbc25bd6056cc172a95d?d=identicon)[btafoya](/maintainers/btafoya)

---

Top Contributors

[![btafoya](https://avatars.githubusercontent.com/u/4192106?v=4)](https://github.com/btafoya "btafoya (5 commits)")

---

Tags

nntppackagistphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/easynewsdownloader-easynews/health.svg)

```
[![Health](https://phpackages.com/badges/easynewsdownloader-easynews/health.svg)](https://phpackages.com/packages/easynewsdownloader-easynews)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
