koenhendriks / yifyapi Goto Github PK
View Code? Open in Web Editor NEWA simple PHP wrapper for the YTS / Yify api (version 2)
License: GNU General Public License v3.0
A simple PHP wrapper for the YTS / Yify api (version 2)
License: GNU General Public License v3.0
I've been trying for weeks to extract data based on the IMB code.
My current attempt:
$json = file_get_contents('https://yts.ag/api/v2/list_movies.json?query_term='.$row['IMB'].'');
$YTS_obj = json_decode($json);
echo "YTS id: ".$YTS_obj->id[0];
I have the IMB code so that is not it. Please email me with suggestions?
Hi, I love your wrapper. I gives me GREAT info on new data. The problem I have is the data I've already collected. The above line dumps the info but how do I get at the torrents?
include('YTS.php');
$ytsag = new YTS();
$new_movie = $ytsag->movieDetail($row['YTS'], false);
$T1=$new_movie->torrents[0]."
";
$T1_url=$T1->url;
Just gives the error: Undefined property: stdClass::$torrents, I can see everything with a var_dump, I just can't seem to put it into variables.
First of all, I love your program.
Is there a way to add something to abort, maybe not show an error when/if the site is down? I just started getting this error, this morning.
Warning: file_get_contents(): Peer certificate CN=ssl371477.cloudflaressl.com' did not match expected CN=
yts.am' in /home/hev/www/www250/inc/YTS.php on line 195
Warning: file_get_contents(): Failed to enable crypto in /home/hev/www/www250/inc/YTS.php on line 195
Warning: file_get_contents(https://yts.am/api/v2/movie_details.json?movie_id=5&with_images&with_cast=): failed to open stream: operation failed in /home/hev/www/www250/inc/YTS.php on line 195
Fatal error: Uncaught Exception: HTTP request failed. Error was: file_get_contents(https://yts.am/api/v2/movie_details.json?movie_id=5&with_images&with_cast=): failed to open stream: operation failed in /home/hev/www/www250/inc/YTS.php:198 Stack trace: #0 /home/hev/www/www250/inc/YTS.php(72): YTS->getFromApi('https://yts.am/...') #1 /home/hev/www/www250/movie_details.php(257): YTS->movieDetail('5', false) #2 {main} thrown in /home/hev/www/www250/inc/YTS.php on line 198
I wounder if there is a way to skip the "Fatal error: Uncaught Exception: HTTP request failed. Error was: file_get_contents" because when YTS is under maintenance or I'm off-line, most of my system crashs with that error. Like today, YTS is under maintenance but I'd still like to proceed.
$movie_details=@$ytsag->movieDetail($YTS, false);
var_dump($movie_details);
exit;
Never gets to the var_dump and I can't see how to by pass the error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.