From: <gre...@us...> - 2007-05-16 16:18:44
|
Revision: 405 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=405&view=rev Author: gregmac45 Date: 2007-05-16 09:18:40 -0700 (Wed, 16 May 2007) Log Message: ----------- Fixed incorrect video url Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs 2007-05-16 14:00:58 UTC (rev 404) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs 2007-05-16 16:18:40 UTC (rev 405) @@ -12,6 +12,7 @@ using System.Xml.XPath; using System.ComponentModel; using System.Threading; +using System.Web; @@ -21,11 +22,14 @@ { public override String getUrl(String fsId) - { - String lsHtml = getHTMLData(String.Format("http://www.metacafe.com/fplayer.php?itemID={0}&fs=n&t=embedded",fsId)); - //Log.Write("html to parse to get url = \n{0}",lsHtml); + { + WebClient client = new WebClient(); + String lsHtml = client.DownloadString(String.Format("http://www.metacafe.com/fplayer.php?itemID={0}&fs=n&t=embedded", fsId)); + Regex loRegex = new Regex("url=\"([^\"]+)"); String lsUrl = loRegex.Match(lsHtml).Groups[1].Value; + + lsUrl = HttpUtility.UrlDecode(lsUrl); Log.Info("MetaCafe flv url = {0}",lsUrl); return lsUrl; } @@ -39,7 +43,7 @@ video.Description = rssItem.description; video.ImageUrl = rssItem.mediaThumbnail; video.Title = rssItem.title; - video.VideoUrl = rssItem.link; + video.VideoUrl = Regex.Match(rssItem.link,@"watch/([\d]*)").Groups[1].Value; loVideoList.Add(video); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |