NOTE
Currently working on porting to YTS.AG API (Update 2016/11/4)
- Some of the features of YTS.AG api are still under construction (i think). So going with what we have at the moment
Since deprecation of API v1 by Yts, YifyLib (since v1.1) no longer support the v1 of Yts API.
See Coming Soon section for future developments.
YifyLib
Introduction
.NET library to access Yts (formaly Yify) API.
This provide access to functionalities of Yts API like,
- Searching for movies (ListMovies)
- Getting movie details (GetMovie)
Etc…
Installing
You can install this library using either
To install via Package Manager Dialog
- Open the Package Manager Dialog.
- Search for
YifyLib
inOnline
>nuget.org
section.
To install via Package Manager Console
- Open Package Manager Console.
- Run the following command.
Install-Package YifyLib
Getting Started
Prerequisites
- .NET Framework 4.5 or later (Download from here)
If you are planning to use more advanced features of YTS API v2 then you need:
- Application Key from YTS (Request one from here)
Installing
- Install
YifyLib
And that's it!.
Examples
Namespaces
using YifyLib;
using YifyLib.Data;
Intialization
Yify yify = new Yify();
or
Yify yify = new Yify(new Uri("https://yts.to/api/v2/"));
If you are planning to use more advanced features of YTS API v2 then you need to initialize as:
Yify yify = new Yify();
yify.ApplicationKey = "<Your Application Key>";
ListMovies
)
Searching for movies (Basic Search
- Search for movies where movie tile contains the word
Bourne
.
List<ListMovie> searchResult = yify.ListMovies("Bourne");
Advanced Search
- Search for movies where movie tile contains the word
Bourne
,720p
quality and with minimum rating of 5.
List<ListMovie> result = y.ListMovies("Bourne",
quality: "720p",
minimumRating: 5);
Sorting and Ordering search result
- To Sort the search results by a particular field use
SearchResultSort
enum. - To Order the search result in ascending or descending order use
SortOrder
enum.
Search movies where movie tile contains the word Bourne
, sorted by added date and orderd in ascending order.
List<ListMovie> result = y.ListMovies("Bourne",
sortBy: SearchResultSort.DateAdded,
orderBy: YifyLib.SortOrder.Asc);
GetMovie
)
Getting movie details (- Getting movie details for movie 100.
Movie m = y.GetMovie(100);
Coming Soon
- YTS.AG API release (Basic Functionality)
- Changes to Examples