Download the PHP package shubhank008/php-utorrent without Composer

On this page you can find all versions of the php package shubhank008/php-utorrent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-utorrent

php-utorrent

PHP client library for the classic uTorrent Web UI API (/gui/).

This fork provides an object-oriented wrapper around uTorrent endpoints and maps API responses into typed model/response objects.

Table of Contents

Overview

The library handles:

Primary namespace:

Requirements

Defined in composer.json:

Installation

Quick Start

Core API (UtorrentClient)

Constructor

Methods

Signature Description
getToken() Returns a Model\Token; uses cache first, then fetches /token.html if missing/expired.
setToken(Model\Token $token): UtorrentClient Injects a token instance manually.
getTorrents() Calls ?list=1 and returns Response\ListResponse.
getTorrent(string $hash) Returns the first torrent in list response matching the hash.
getTorrentProps(string $hash) Calls ?action=getprops&hash=... and returns Response\PropResponse.
getSettings() Calls ?action=getsettings and returns Response\SettingsResponse.
addUrl(string $url): ResponseInterface Calls ?action=add-url&s=... to add torrent/magnet by URL.
getHost(): string Gets configured host.
setHost(string $address): UtorrentClient Sets host.
getPort(): int Gets configured port.
setPort(int $port): UtorrentClient Sets port.
getPath(): string Gets configured GUI path.
setPath(string $path): UtorrentClient Sets GUI path.
getUsername(): string Gets username.
setUsername(string $username): UtorrentClient Sets username.
getPassword(): string Gets password.
setPassword(string $password): UtorrentClient Sets password.
setCache(CacheItemPoolInterface $cache) Sets PSR-6 cache pool used for token/torrent caching.
getClient(): ClientInterface Gets current HTTP client; lazily creates GuzzleHttp\Client if unset.
setClient(ClientInterface $client): UtorrentClient Injects custom HTTP client implementation.

Response APIs

BaseResponse

Signature Description
setCache(CacheItemPoolInterface $cache): BaseResponse Assigns cache store for responses that cache model objects.
fromHtml($html) Sanitizes control chars and decodes JSON before dispatching to fromJson.
toOriginalFormatString(): string Serializes response back to uTorrent-like JSON string format.

ListResponse

Signature Description
__construct() Initializes collections (labels, torrents, rssFeeds, rssFilters).
fromJson($json) : ListResponse Hydrates build, labels, torrents, RSS feeds/filters; updates cache for torrents.
getBuild(): int Returns uTorrent build number.
getLabels(): ArrayCollection Returns collection of Model\Label.
getTorrents(): ArrayCollection Returns collection of Model\Torrent.
getTorrentc(): string Returns incremental torrent cache token (torrentc).
getRssFeeds(): ArrayCollection Returns collection of Model\RssFeed.
getRssFilters(): ArrayCollection Returns collection of Model\RssFilter.
filterTorrents(Criteria $criteria): ListResponse Replaces torrents collection with criteria-matched subset.
filterRssFeeds(Criteria $criteria): ListResponse Replaces RSS feed collection with criteria-matched subset.
filterRssFilters(Criteria $criteria): ListResponse Replaces RSS filter collection with criteria-matched subset.

PropResponse

Signature Description
__construct() Initializes props collection.
fromJson($json) Hydrates build and Model\TorrentProp items.
getBuild(): int Returns uTorrent build number.
getProps(): ArrayCollection Returns collection of Model\TorrentProp.

SettingsResponse

Signature Description
__construct() Initializes settings collection.
fromJson($json) Hydrates build and Model\SettingItem items.
getBuild(): int Returns uTorrent build number.
getSettings(): ArrayCollection Returns collection of Model\SettingItem.

FileResponse

Signature Description
__construct() Initializes files collection.
fromJson($json) Hydrates build, torrent hash and Model\File entries from files payload.
getBuild(): int Returns uTorrent build number.
getFiles(): ArrayCollection Returns collection of Model\File.
getTorrentHash(): string Returns torrent hash that the file list belongs to.

Model APIs

BaseModel

Signature Description
fromHtml($html) Decodes JSON and forwards to fromJson.
fromJson($json, array $filter = []) Hydrates model using $map offsets/keys. Optional filter limits updated fields.
toOriginal() Converts model back to original uTorrent array/object representation.
refreshCache($newData) Hook for partial updates; base implementation is no-op.

Token

Signature Description
__construct(string $token) Stores token and timestamps (created now, expires +25 min).
getCreatedDateTime(): \DateTimeInterface Returns creation datetime.
getExpirationDateTime(): \DateTimeInterface Returns expiration datetime.
getToken(): string Returns token string value.
__toString() Returns token string (or empty string).

Label

Signature Description
getName(): string Gets label name.
setName(string $name): Label Sets label name.
getTorrents(): int Gets number of torrents in label.
setTorrents(int $torrents): Label Sets number of torrents in label.

File

Signature Description
getFilename(): string Gets file name/path in torrent.
setFilename(string $filename): File Sets file name/path.
getFilesize(): int Gets full file size in bytes.
setFilesize(int $filesize): File Sets file size.
getDownloaded(): int Gets bytes downloaded for file.
setDownloaded(int $downloaded): File Sets downloaded bytes.
getPriority(): int Gets uTorrent file priority value.
setPriority(int $priority): File Sets file priority value.

SettingItem

Signature Description
fromJson($json, array $filter = null) Hydrates setting [name, type, value] and normalizes value type.
toOriginal() Converts setting back to original API-compatible array format.
getName(): string Returns setting key name.
getType(): int Returns setting type (0=int, 1=bool, 2=string).
getValue() Returns normalized setting value.

Torrent

Constants:

Signature Description
refreshCache($newData, array $filter = null) Partially updates torrent fields; updates dynamic fields when status indicates active torrent.
getHash(): string / setHash(string $hash): Torrent Torrent hash identifier.
getStatus(): int / setStatus(int $status): Torrent Bitmask status value.
getName(): string / setName(string $name): Torrent Display name.
getSize(): int / setSize(int $size): Torrent Total size in bytes.
getProgress(): int / setProgress(int $progress): Torrent Progress (uTorrent integer scale).
getDownloaded(): int / setDownloaded(int $downloaded): Torrent Downloaded bytes.
getUploaded(): int / setUploaded(int $uploaded): Torrent Uploaded bytes.
getRatio(): int / setRatio(int $ratio): Torrent Ratio (uTorrent integer scale).
getUploadSpeed(): int / setUploadSpeed(int $uploadSpeed): Torrent Upload speed.
getDownloadSpeed(): int / setDownloadSpeed(int $downloadSpeed): Torrent Download speed.
getEta(): int / setEta(int $eta): Torrent ETA in seconds.
getLabel(): string / setLabel(string $label): Torrent Label name.
getPeersConnected(): int / setPeersConnected(int $peersConnected): Torrent Connected peers count.
getPeersInSwarm(): int / setPeersInSwarm(int $peersInSwarm): Torrent Peers in swarm count.
getSeedsConnected(): int / setSeedsConnected(int $seedsConnected): Torrent Connected seeds count.
getSeedsInSwarm(): int / setSeedsInSwarm(int $seedsInSwarm): Torrent Seeds in swarm count.
getAvailability(): int / setAvailability(int $availability): Torrent Availability value.
getQueueOrder(): int / setQueueOrder(int $queueOrder): Torrent Queue order index.
getRemaining(): int / setRemaining(int $remaining): Torrent Remaining bytes.
getAdded(): int / setAdded(int $added): Torrent Added timestamp (epoch).
getCompleted(): int / setCompleted(int $completed): Torrent Completed timestamp (epoch).
getSourceFile(): string / setSourceFile(string $sourceFile): Torrent Source .torrent file path/name.

TorrentProp

Signature Description
getHash(): string / setHash(string $hash): TorrentProp Torrent hash.
getTrackers(): string / setTrackers(string $trackers): TorrentProp Tracker list string.
getUlrate(): int / setUlrate(int $ulrate): TorrentProp Max upload rate (0 means default).
getDlrate(): int / setDlrate(int $dlrate): TorrentProp Max download rate (0 means default).
getSuperseed(): int / setSuperseed(int $superseed): TorrentProp Initial seeding flag/value.
getDht(): int / setDht(int $dht): TorrentProp DHT flag/value.
getPex(): int / setPex(int $pex): TorrentProp Peer exchange flag/value.
getSeedOverride(): int / setSeedOverride(int $seed_override): TorrentProp Seed override flag/value.
getSeedRatio(): int / setSeedRatio(int $seed_ratio): TorrentProp Seed ratio value.
getSeedTime(): int / setSeedTime(int $seed_time): TorrentProp Seed time value.
getUlslots(): int / setUlslots(int $ulslots): TorrentProp Upload slots value.

RssFeed

Signature Description
__construct() Initializes RSS items collection.
fromJson($json, array $filter = null) Hydrates feed fields and nested RssItem entries.
toOriginal() Serializes feed and nested items back to original array format.
getId(): int Feed ID.
getEnabled(): bool Feed enabled flag.
getUseFeedTitle(): bool Use feed title flag.
getUserSelected(): bool User-selected flag.
getProgrammed(): bool Programmed flag.
getDownloadState(): int Download state value.
getUrl(): string Feed URL.
getNextUpdate(): int Next update timestamp/value.
getItems(): ArrayCollection Collection of RssItem.
getMap(): array Returns internal mapping array used for hydration.

RssItem

Signature Description
getName(): string / setName(string $name): RssItem Short item name.
getNameFull(): string / setNameFull(string $nameFull): RssItem Full item name/title.
getUrl(): string / setUrl(string $url): RssItem Item URL/magnet/torrent link.
getQuality(): int / setQuality(int $quality): RssItem Quality code.
getCodec(): int / setCodec(int $codec): RssItem Codec code.
getTimestamp(): int / setTimestamp(int $timestamp): RssItem Timestamp value.
getSeason(): int / setSeason(int $season): RssItem Season number.
getEpisode(): int / setEpisode(int $episode): RssItem Episode number.
getEpisodeTo(): int / setEpisodeTo(int $episodeTo): RssItem Episode range upper bound.
getFeedId(): int / setFeedId(int $feedId): RssItem Parent feed ID.
getRepack(): bool / setRepack(bool $repack): RssItem Repack flag.
getInHistory(): bool / setInHistory(bool $inHistory): RssItem Download-history flag.

RssFilter

Signature Description
getId(): int / setId(int $id): RssFilter Filter ID.
getFlags(): int / setFlags(int $flags): RssFilter RSS filter flags bitmask/value.
getName(): string / setName(string $name): RssFilter Filter name.
getFilter(): string / setFilter(string $filter): RssFilter Positive match pattern.
getNotFilter(): string / setNotFilter(string $notFilter): RssFilter Exclusion pattern.
getDirectory(): string / setDirectory(string $directory): RssFilter Target download directory.
getFeed(): int / setFeed(int $feed): RssFilter Feed selector/index.
getQuality(): int / setQuality(int $quality): RssFilter Desired quality value.
getLabel(): string / setLabel(string $label): RssFilter Label to apply on match.
getPostponeMode(): int / setPostponeMode(int $postponeMode): RssFilter Postpone mode value.
getLastMatch(): int / setLastMatch(int $lastMatch): RssFilter Last match timestamp/value.
getSmartEpFilter(): int / setSmartEpFilter(int $smartEpFilter): RssFilter Smart episode filter setting.
getRepackEpFilter(): int / setRepackEpFilter(int $repackEpFilter): RssFilter Repack episode filter setting.
getEpisodeFilterStr(): string / setEpisodeFilterStr(string $episodeFilterStr): RssFilter Episode filter expression string.
getEpisodeFilter(): bool / setEpisodeFilter(bool $episodeFilter): RssFilter Episode filter enabled flag.
getResolvingCandidate(): bool / setResolvingCandidate(bool $resolvingCandidate): RssFilter Resolving-candidate flag.

Notes and Behavior

Examples

See /examples:

License

This fork is licensed under the MIT License. See LICENSE.


All versions of php-utorrent with dependencies

PHP Build Version
Package Version
Requires psr/cache Version ^1.0
doctrine/collections Version ^1.4
doctrine/deprecations Version ^1.1.3
guzzlehttp/psr7 Version ^1.4
guzzlehttp/guzzle Version ^6.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shubhank008/php-utorrent contains the following files

Loading the files please wait ...