Obtain youtube channel id without display name
<p>I wasn't exactly sure how to word the title, but I'm creating an API that retrieves certain JSON date about a persons Youtube channel, and it works fine and dandy until I come across a channel like this,
 <a href="https://www.youtube.com/channel/UCRMZyEp0IzcI0IGpDFRh6fQ" rel="nofollow">https://www.youtube.com/channel/UCRMZyEp0IzcI0IGpDFRh6fQ</a> </p>

<p>where his account ID is in the url instead of
<a href="https://www.youtube.com/user/iceycat25" rel="nofollow">https://www.youtube.com/user/iceycat25</a>. </p>

<p>When I run the API and I search for "iceycat25" the data is pulled normally like it should, but if I search for "<em>MOTO TIME</em>" the API returns no such user exists. Is there any way to fix this?
Here's the relevant code I have as of right now.</p>

<pre><code>// obtain your own API key at
// https://console.developers.google.com
$MyKey = xxxxxxxxxx_xxxxxxxxxx_xxxxxxxxxx;
// Convert the GET data into variables.
$YoutubeName = $_GET["Channel_Name"];
$Command = $_GET["Command"];

// Get the channel ID and Upload ID from the YouTube name inputted
$IDs = json_decode(@file_get_contents("https://www.googleapis.com/youtube/v3/channels?part=contentDetails&amp;forUsername=$YoutubeName&amp;key=$MyKey"), true);
if($IDs['items'][0]['id'] == null)
{
    echo 'No such YouTube channel exists.';
    die();
}
</code></pre>