antimidas |
25th August 2019 04:27 |
come to u232 forums. v3 subcats CANNOT just be dropped in. plz do not listen to the idiot. forums at u-232.dev/forum. there is already a post on what you want
Bump: Also, there is a replacement for imdb on the u232 forums. A setup for omdb api and tmdb to auto grab trailers as well.
Bump: here is ombd and tmdb.
Code:
////////////OMDB & TMDB by Antimidas and Tundracanine 2018-2019
if (in_array($torrents['category'], $INSTALLER09['movie_cats']){
$INSTALLER09['omdb_key'] = add key here;
$INSTALLER09['tmdb_key'] = add here;
$imdb_id_new = 0;
if (preg_match('(.com/title/tt\d+)', $torrents_txt['descr'], $im_match_imdb) && $torrents['url'] == '') {
$imdb_id_new = str_replace(".com/title/tt", "", $im_match_imdb[0]);
$torrents['url'] = 'https://www.imdb.com/title/tt' . $imdb_id_new;
}
elseif (preg_match('(.com/title/tt\d+)', $torrents['url'], $im_match_imdb) && $torrents['url'] != '') {
$imdb_id_new = str_replace(".com/title/tt", "", $im_match_imdb[0]);
}
if ($torrents['url'] != '') {
$imdb_id = $imdb_id_new;
$url = file_get_contents("https://www.omdbapi.com/?i=tt" . $imdb_id . "&plot=full&tomatoes=True&r=json&apikey=" . $INSTALLER09['omdb_key']."");
$omdb = json_decode($url, true);
foreach ($omdb['Ratings'] as $rat => $rate);
$poster = $omdb['Poster'];
if ($poster != "N/A") {
$omdb['Poster'] = "/imdb/images/" . $imdb_id . ".jpg";
if (!file_exists('./imdb/images/' . $imdb_id . '.jpg')) {
@copy("$poster", "./imdb/images/" . $imdb_id . ".jpg");
}
} else {
if ($poster == "N/A") {
$omdb['Poster'] = "./pic/nopostermov.jpg";
}
}
///////////TMDB Trailer scrape//////////////
i
$json = file_get_contents("https://api.themoviedb.org/3/movie/tt" . $imdb_id . "/videos?api_key=". $INSTALLER09['tmdb_key']."");
$tmdb = json_decode($json, true);
foreach ($tmdb['results'] as $key => $test) {
$yt = $test['key'];
$trailer = 'https://www.youtube.com/embed/' . $yt . '';
}
if ($omdb['Title'] != '') {
$HTMLOUT .= "
|
Title: " . $omdb['Title'] . "
Released: " . $omdb['Released'] . "
Genre: " . $omdb['Genre'] . "
Rated: " . $omdb['Rated'] . "
Director: " . $omdb['Director'] . "
Cast: " . $omdb['Actors'] . "
Studio: " . $omdb['Production'] . "
Description: " . $omdb['Plot'] . "
Runtime: " . $omdb['Runtime'] . "
IMDB Rating: " . $omdb['imdbRating'] . " from  ".$omdb['imdbVotes']." Votes
";
if (empty($torrents["poster"]) or ($torrents["poster"] == "./pic/nopostermov.jpg") && $omdb['Poster'] != "./pic/nopostermov.jpg") {
sql_query("UPDATE torrents SET poster = " . sqlesc($omdb['Poster']) . " WHERE id = $id LIMIT 1") or sqlerr(__file__, __line__);
$torrents["poster"] = $omdb['Poster'];
$torrent_cache['poster'] = $omdb['Poster'];
if ($torrent_cache) {
$mc1->update_row(false, $torrent_cache);
$mc1->commit_transaction($INSTALLER09['expires']['torrent_details']);
$mc1->delete_value('top5_tor_');
$mc1->delete_value('last5_tor_');
$mc1->delete_value('scroll_tor_');
}
}
}
}
}
if (empty($torrents['poster']) or ($torrents['poster'] == './pic/noposter.jpg') && $image != './pic/noposter.jpg') {
}
if (!empty($trailer)) {
$HTMLOUT .= "
Trailer (Some videos may be unavailable in your region)";
$HTMLOUT .= " |
---|
";
} else {
$HTMLOUT.= " No youtube data found | ";
}
full instruction on 2-232 forums. As well as guide if you want to add tool for api's in admin panel and save them to database.
https://u-232.dev/forum/index.php/topic,4362.0.html
Bump: here is ombd and tmdb.
Code:
////////////OMDB & TMDB by Antimidas and Tundracanine 2018-2019
if (in_array($torrents['category'], $INSTALLER09['movie_cats']){
$INSTALLER09['omdb_key'] = add key here;
$INSTALLER09['tmdb_key'] = add here;
$imdb_id_new = 0;
if (preg_match('(.com/title/tt\d+)', $torrents_txt['descr'], $im_match_imdb) && $torrents['url'] == '') {
$imdb_id_new = str_replace(".com/title/tt", "", $im_match_imdb[0]);
$torrents['url'] = 'https://www.imdb.com/title/tt' . $imdb_id_new;
}
elseif (preg_match('(.com/title/tt\d+)', $torrents['url'], $im_match_imdb) && $torrents['url'] != '') {
$imdb_id_new = str_replace(".com/title/tt", "", $im_match_imdb[0]);
}
if ($torrents['url'] != '') {
$imdb_id = $imdb_id_new;
$url = file_get_contents("https://www.omdbapi.com/?i=tt" . $imdb_id . "&plot=full&tomatoes=True&r=json&apikey=" . $INSTALLER09['omdb_key']."");
$omdb = json_decode($url, true);
foreach ($omdb['Ratings'] as $rat => $rate);
$poster = $omdb['Poster'];
if ($poster != "N/A") {
$omdb['Poster'] = "/imdb/images/" . $imdb_id . ".jpg";
if (!file_exists('./imdb/images/' . $imdb_id . '.jpg')) {
@copy("$poster", "./imdb/images/" . $imdb_id . ".jpg");
}
} else {
if ($poster == "N/A") {
$omdb['Poster'] = "./pic/nopostermov.jpg";
}
}
///////////TMDB Trailer scrape//////////////
i
$json = file_get_contents("https://api.themoviedb.org/3/movie/tt" . $imdb_id . "/videos?api_key=". $INSTALLER09['tmdb_key']."");
$tmdb = json_decode($json, true);
foreach ($tmdb['results'] as $key => $test) {
$yt = $test['key'];
$trailer = 'https://www.youtube.com/embed/' . $yt . '';
}
if ($omdb['Title'] != '') {
$HTMLOUT .= "
|
Title: " . $omdb['Title'] . "
Released: " . $omdb['Released'] . "
Genre: " . $omdb['Genre'] . "
Rated: " . $omdb['Rated'] . "
Director: " . $omdb['Director'] . "
Cast: " . $omdb['Actors'] . "
Studio: " . $omdb['Production'] . "
Description: " . $omdb['Plot'] . "
Runtime: " . $omdb['Runtime'] . "
IMDB Rating: " . $omdb['imdbRating'] . " from  ".$omdb['imdbVotes']." Votes
";
if (empty($torrents["poster"]) or ($torrents["poster"] == "./pic/nopostermov.jpg") && $omdb['Poster'] != "./pic/nopostermov.jpg") {
sql_query("UPDATE torrents SET poster = " . sqlesc($omdb['Poster']) . " WHERE id = $id LIMIT 1") or sqlerr(__file__, __line__);
$torrents["poster"] = $omdb['Poster'];
$torrent_cache['poster'] = $omdb['Poster'];
if ($torrent_cache) {
$mc1->update_row(false, $torrent_cache);
$mc1->commit_transaction($INSTALLER09['expires']['torrent_details']);
$mc1->delete_value('top5_tor_');
$mc1->delete_value('last5_tor_');
$mc1->delete_value('scroll_tor_');
}
}
}
}
}
if (empty($torrents['poster']) or ($torrents['poster'] == './pic/noposter.jpg') && $image != './pic/noposter.jpg') {
}
if (!empty($trailer)) {
$HTMLOUT .= "
Trailer (Some videos may be unavailable in your region)";
$HTMLOUT .= " |
---|
";
} else {
$HTMLOUT.= " No youtube data found | ";
}
full instruction on 2-232 forums. As well as guide if you want to add tool for api's in admin panel and save them to database.
https://u-232.dev/forum/index.php/topic,4362.0.html
|