Can anyone help me use "youtube-mp3.org" API to get the h variable? PHP
<p>Before I say anything, a SAMP scripter has managed to do this in pawn.</p>

<p>Here is his code.
<a href="http://pastebin.com/RMVWdtzj" rel="nofollow">http://pastebin.com/RMVWdtzj</a></p>

<p>When you type this url as shown without the <code>h</code> variable listed, you get redirected to the homepage.</p>

<pre><code>youtube-mp3.org/get?video_id=O-fyNgHdmLI
</code></pre>

<p>If you type the url with the <code>h</code> variable listed, <code>youtube-mp3.org/get?video_id=O-fyNgHdmLI&amp;h=44348f6e92d82b85311aaf3d702d9080&amp;r=1365043075897</code>, a download starts automatically.</p>

<p>Therefore I'm needing to grab the variable called <code>h</code> that is returned from this file so that I can incorporate it into my urls and the download will start automatically. </p>

<p>Here's what I have.</p>

<pre><code>$u2burl = file_get_contents("http://www.youtube-mp3.org/api/itemInfo/?video_id=$ytsong");
</code></pre>

<p>For example if <code>$ytsong = O-fyNgHdmLI</code></p>

<p>Then <code>$u2burl</code> will return </p>

<pre><code>info = { "title" : "Creed - My Sacrifice (Video)", "image" : "http://i.ytimg.com/vi/O-fyNgHdmLI/default.jpg", "length" : "4", "status" : "serving", "progress_speed" : "", "progress" : "", "ads" : "", "pf" : "", "h" : "44348f6e92d82b85311aaf3d702d9080" };
</code></pre>

<p>I need to put just the last part <code>(44348f6e92d82b85311aaf3d702d9080)</code> in a variable.</p>

<p>ex: <code>$hval = 44348f6e92d82b85311aaf3d702d9080</code></p>

<p>But how do I get the script to do this automatically?</p>

<p>I can't set the variable by myself each time, therefore I need to know how to get the script to take the data listed from <code>file_get_contents</code> and grab just the last part <code>(44348f6e92d82b85311aaf3d702d9080)</code> and throw it in a variable for me.</p>

<p>It seems that the <code>h</code> changes with each user's IP address... so this might not be possible.
It's a long shot, but if anyone can help I'd greatly appreciate it.</p>
