Herzlichen Dank für eure Hilfe.
Habe es umsetzen können. Sexy !
Für interessierte hier der Code:
PHP
Variante: Delphi | PythonPHP-Code:<?php
$releasename = 'Creed.Rockys.Legacy.2015.German.DL.1080p.BluRay.AVC-SCiENTOLOGY';
function get_match($regex, $content, $pos = 1)
{
/* do your job */
preg_match($regex, $content, $matches);
/* return our result */
return $matches[intval($pos)];
}
function xrelnfo_scene($releasename)
{
$conf['xrel_qurl'] = 'https://www.xrel.to/search.html?mode=full&xrel_search_query=';
/* do some curl magic */
$headers = array(
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $conf['xrel_qurl'] . $releasename);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_REFERER, "https://www.xrel.to/releases.html");
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$xrel_content = curl_exec($ch);
curl_close($ch);
$xrel['nfo'] = @get_match('/<div id="nfo_text" style="padding:10px; display: none;">.<pre>(.+)<\/pre>.<\/div>/s', $xrel_content);
return $xrel['nfo'];
}
$nfo = xrelnfo_scene($releasename);
echo "
NFO TEST 1:
<pre>$nfo</pre>
";
- - - - - - - - - - Beitrag nachträglich erweitert - - - - - - - - - -
Jetzt hätte ich nur noch die Frage, wie man am cleversten die Infos aus dem NFO-Text ausliest.
Wenn z.B Informationen fehlen wie Größe/Size.
Gibt es da auch einen speziellen Regex, der zuverlässig ausliest?



THEMENSTARTER

Zitieren


