title: How to fix bad URI is not URI
body: <p>I'm using the ruby version <code>1.9.3</code>, I like to get host name from the video url below,</p>
  
  <p>I tried with code</p>
  
  <pre><code>require 'uri'
  url = "https://ferrari-view.4me.it/view-share/playerp/?plContext=http://ferrari-%201363948628-stream.4mecloud.it/live/ferrari/ngrp:livegenita/manifest.f4m&amp;cartellaConfig=http://ferrari-4me.weebo.it/static/player/config/&amp;cartellaLingua=http://ferrari-4me.weebo.it/static/player/config/&amp;poster=http://pusher.newvision.it:8080/resources/img1.jpg&amp;urlSkin=http://ferrari-4me.weebo.it/static/player/swf/skin.swf?a=1363014732171&amp;method=GET&amp;target_url=http://ferrari-4me.weebo.it/static/player/swf/player.swf&amp;userLanguage=IT&amp;styleTextColor=#000000&amp;autoPlay=true&amp;bufferTime=2&amp;isLive=true&amp;highlightColor=#eb2323&amp;gaTrackerList=UA-23603234-4"  
  puts URI.parse(url).host  
  </code></pre>
  
  <p>it throws an exception URI::InvalidURIError: bad URI(is not URI?):</p>
  
  <p>I tried with encode the URL then parse like below </p>
  
  <pre><code>puts URI.parse(URI.parse(url)).host
  </code></pre>
  
  <p>it throws an exception same <code>URI::InvalidURIError: bad URI(is not URI?)</code></p>
  
  <p>But above code works for the below URL.</p>
  
  <p>url = <a href="http://www.youtube.com/v/GpQDa3PUAbU?version=3&amp;autohide=1&amp;autoplay=1" rel="noreferrer">http://www.youtube.com/v/GpQDa3PUAbU?version=3&amp;autohide=1&amp;autoplay=1</a></p>
  
  <p>How to fix this? any suggestion please.
  Thanks </p>