From: <gre...@us...> - 2007-08-29 23:30:16
|
Revision: 876 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=876&view=rev Author: gregmac45 Date: 2007-08-29 16:30:10 -0700 (Wed, 29 Aug 2007) Log Message: ----------- Added code to get all trailers for a movie Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs Added Paths: ----------- trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -21,7 +21,7 @@ { public override string getSiteId() { - return "break"; + return "22"; } protected override String getUrl(String fsId) Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -26,7 +26,7 @@ { //private String msSelectedSiteID; private String msSelectedCategoryName; - private List<GUIOnlineVideos.Site> moSiteList = new List<GUIOnlineVideos.Site>(); + private List<GUIOnlineVideos.SiteSettings> moSiteList = new List<GUIOnlineVideos.SiteSettings>(); public Configuration() { @@ -50,7 +50,7 @@ } txtFilters.Text = lsFilterList; } - foreach(GUIOnlineVideos.Site site in settings.moSiteList.Values){ + foreach(GUIOnlineVideos.SiteSettings site in settings.moSiteList.Values){ siteList.Items.Add(site.name); moSiteList.Add(site); } @@ -61,7 +61,7 @@ { if(siteList.SelectedIndex>-1){ OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; txtSiteName.Text = site.name; TxtSiteId.Text = site.id; txtUserId.Text = site.username; @@ -83,7 +83,7 @@ { if(CategoryList.SelectedIndex>-1){ OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; msSelectedCategoryName = CategoryList.SelectedItem.ToString(); Log.Info("Category change site:{0} with selected category of {1}",site.name,msSelectedCategoryName); @@ -98,7 +98,7 @@ void BtnSiteSaveClick(object sender, EventArgs e) { OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; //site.id = TxtSiteId; site.name = txtSiteName.Text; site.username = txtUserId.Text; @@ -123,7 +123,7 @@ void BtnRssSaveClick(object sender, EventArgs e) { OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; GUIOnlineVideos.RssLink link = site.RssList[msSelectedCategoryName]; link.name = txtRssName.Text; link.url = txtRssUrl.Text; @@ -140,7 +140,7 @@ link.name = "new"; link.url = "http://"; link.isDynamic = false; - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; site.RssList.Add(link.name,link); CategoryList.Items.Add(link.name); CategoryList.SelectedIndex = CategoryList.Items.Count-1; @@ -152,7 +152,7 @@ { if(CategoryList.SelectedIndex>-1){ OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; msSelectedCategoryName = CategoryList.SelectedItem.ToString(); site.RssList.Remove(msSelectedCategoryName); CategoryList.Items.RemoveAt(CategoryList.SelectedIndex); @@ -171,7 +171,7 @@ settings.msThumbLocation = txtThumbLoc.Text; settings.msDownloadDir = txtDownloadDir.Text; settings.moSiteList.Clear(); - foreach(GUIOnlineVideos.Site site in moSiteList){ + foreach(GUIOnlineVideos.SiteSettings site in moSiteList){ settings.moSiteList.Add(site.id,site); } settings.saveSettings(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -39,10 +39,10 @@ { return "100"; } - public override string getUrl(OnlineVideos.GUIOnlineVideos.VideoInfo video, OnlineVideos.GUIOnlineVideos.Site foSite) + public override string getUrl(OnlineVideos.GUIOnlineVideos.VideoInfo video, OnlineVideos.GUIOnlineVideos.SiteSettings foSite) { - GUIOnlineVideos.Site loSite = OnlineVideoSettings.getInstance().moSiteList[video.SiteID]; + GUIOnlineVideos.SiteSettings loSite = OnlineVideoSettings.getInstance().moSiteList[video.SiteID]; return SiteUtilFactory.getSiteUtil(video.SiteID).getUrl(video,loSite);; } public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) @@ -73,8 +73,8 @@ FavoritesDatabase db = FavoritesDatabase.getInstance(); string [] lsSiteIds = db.getSiteIDs(); - Dictionary <String, GUIOnlineVideos.Site> loSiteList = OnlineVideoSettings.getInstance().moSiteList; - GUIOnlineVideos.Site loSite; + Dictionary <String, GUIOnlineVideos.SiteSettings> loSiteList = OnlineVideoSettings.getInstance().moSiteList; + GUIOnlineVideos.SiteSettings loSite; GUIOnlineVideos.RssLink cat; foreach(string lsSiteId in lsSiteIds){ loSite = loSiteList[lsSiteId]; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -33,10 +33,11 @@ //private ILog moLog; protected View currentView = View.Icons; - private Dictionary <String, Site> moSiteList = new Dictionary<String, Site>(); + private Dictionary <String, SiteSettings> moSiteList = new Dictionary<String, SiteSettings>(); private String msSelectedSiteId; private String msSelectedCategoryValue; private String msSelectedCategoryName; + private String msSelectedVideo; private State _CurrentState = State.home; private String msDownloadDir = Directory.GetCurrentDirectory()+"\\"; private List<VideoInfo> moCurrentVideoList = new List<VideoInfo>(); @@ -58,7 +59,7 @@ LargeIcons = 2, FilmStrip = 3 } - public class Site + public class SiteSettings { public String name; public String id; @@ -223,7 +224,7 @@ facadeView.SelectedListItemIndex = miSelectedIndex; } else{ - DisplayVideoDetails(); + DisplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); } UpdateViewSate(); //base.OnPageLoad(); @@ -265,7 +266,7 @@ break; case 2: SiteUtilBase siteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); - Site loSite = moSiteList [msSelectedSiteId]; + SiteSettings loSite = moSiteList [msSelectedSiteId]; if(msSelectedCategoryValue.StartsWith("fav:") == false){ //siteUtil.addFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password); Log.Info("Received request to add video to favorites."); @@ -281,7 +282,7 @@ SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId); //Log.Info("VideoList before:"); //foreach(VideoInfo video in moCurrentVideoList){ - //Log.Info(video.Title); + //Log.Info(video.Title); //} moCurrentVideoList = site.getRelatedVideos(moCurrentVideoList[liSelected].Tags); //Log.Info("VideoList after:"); @@ -298,30 +299,10 @@ { if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) { - if (_CurrentState == State.info) - { - Log.Info("Set the stopDownload to true 1"); - ImageDownloader._stopDownload = true; - DisplayVideos(false); - _CurrentState = State.videos; - return; + OnShowPreviousMenu2(); + return; + } - if (_CurrentState == State.videos) - { - Log.Info("Set the stopDownload to true 1"); - ImageDownloader._stopDownload = true; - DisplayCategories(); - _CurrentState = State.categories; - return; - } - else if (_CurrentState == State.categories) - { - DisplaySites(); - _CurrentState = State.home; - return; - } - - } base.OnAction(action); } protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) @@ -341,8 +322,7 @@ { if (facadeView.SelectedListItemIndex == 0) { - DisplaySites(); - _CurrentState = State.home; + OnShowPreviousMenu2(); } else { @@ -358,18 +338,17 @@ ImageDownloader._stopDownload = true; if (facadeView.SelectedListItemIndex == 0) { - DisplayCategories(); - _CurrentState = State.categories; + OnShowPreviousMenu2(); } else { - miSelectedIndex = facadeView.SelectedListItemIndex; - if(msSelectedCategory == "20"){ - DiplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); - }else{ - - //play the video - Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + miSelectedIndex = facadeView.SelectedListItemIndex; + if(msSelectedSiteId == "15"){ + DisplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); + _CurrentState = State.info; + }else{ + //play the video + Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); } } } @@ -379,14 +358,13 @@ ImageDownloader._stopDownload = true; if (facadeView.SelectedListItemIndex == 0) { - DisplayVideos(false); - _CurrentState = State.videos; + OnShowPreviousMenu2(); } else { miSelectedIndex = facadeView.SelectedListItemIndex; //play the video - Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); } } UpdateViewSate(); @@ -402,10 +380,38 @@ base.OnClicked(controlId, control, actionType); } - private void DiplayVideoDetails(VideoInfo videoInfo) - { - throw new Exception("The method or operation is not implemented."); - } + private void OnShowPreviousMenu2(){ + if (_CurrentState == State.categories) + { + + DisplaySites(); + _CurrentState = State.home; + + + } + else if (_CurrentState == State.videos) + { + Log.Info("Set the stopDownload to true 2"); + ImageDownloader._stopDownload = true; + + DisplayCategories(); + _CurrentState = State.categories; + + + } + else if (_CurrentState == State.info) + { + //Log.Info("Set the stopDownload to true 2"); + ImageDownloader._stopDownload = true; + + DisplayVideos(true); + SwitchView(); + btnViewAs.Visible = true; + _CurrentState = State.videos; + + + } + } public override bool OnMessage(GUIMessage message) { /* @@ -475,7 +481,7 @@ msFilterArray = settings.msFilterArray; moSiteList= settings.moSiteList; //create a favorites site - Site loSite = new Site(); + SiteSettings loSite = new SiteSettings(); loSite.id = "100"; loSite.name = "Favorites"; loSite.enabled = true; @@ -487,7 +493,7 @@ moSiteList.Add("100",loSite); //add a downloaded videos site - loSite = new Site(); + loSite = new SiteSettings(); loSite.id = "99"; loSite.name = "Downloaded Videos"; loSite.enabled = true; @@ -505,7 +511,7 @@ GUIListItem loListItem; String image; - foreach (Site loSite in moSiteList.Values) + foreach (SiteSettings loSite in moSiteList.Values) { if(loSite.enabled){ @@ -535,7 +541,7 @@ loListItem.IsFolder = true; MediaPortal.Util.Utils.SetDefaultIcons(loListItem); facadeView.Add(loListItem); - Site loSite = moSiteList[msSelectedSiteId]; + SiteSettings loSite = moSiteList[msSelectedSiteId]; SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); foreach (RssLink loCat in loSite.RssList.Values) { @@ -685,6 +691,42 @@ } + private void DisplayVideoDetails(VideoInfo foVideo) + { + msSelectedVideo = foVideo.Title; + SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); + List<VideoInfo> loVideoList= loSiteUtil.getOtherVideoList(foVideo); + moCurrentVideoList.Clear(); + GUIControl.ClearControl(GetID, facadeView.GetID); + GUIListItem loListItem = new GUIListItem(".."); + loListItem.IsFolder = true; + loListItem.ItemId = 0; + //loListItem.OnItemSelected+= new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnVideoItemSelected); + MediaPortal.Util.Utils.SetDefaultIcons(loListItem); + facadeView.Add(loListItem); + int liIdx = 0; + foreach (VideoInfo loVideoInfo in loVideoList) + { + liIdx++; + loVideoInfo.Description = cleanString(loVideoInfo.Description); + + loListItem = new GUIListItem(loVideoInfo.Title); + loListItem.Path = loVideoInfo.VideoUrl; + loListItem.ItemId = liIdx; + //loListItem.RetrieveArt = false; + //loListItem.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt); + //loListItem.OnItemSelected+=new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler( OnVideoItemSelected); + facadeView.Add(loListItem); + //loListItem.RetrieveArt = true; + //loImageUrlList.Add(loVideoInfo.ImageUrl); + moCurrentVideoList.Add(loVideoInfo); + } + facadeView.View = GUIFacadeControl.ViewMode.List; + btnViewAs.Visible = false; + DisplayVideoInfo(loVideoList[0]); + //strLine = GUILocalizeStrings.Get(101); + + } /* public void downloadImages(object sender, DoWorkEventArgs e) { @@ -711,7 +753,7 @@ } } - + private bool GetUserInputString(ref string sString) { VirtualKeyboard keyBoard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); @@ -725,7 +767,7 @@ private void Play(VideoInfo foListItem) { //foListItem. - Site loSite = moSiteList[msSelectedSiteId]; + SiteSettings loSite = moSiteList[msSelectedSiteId]; String lsUrl = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getUrl(foListItem,loSite); if (mbPlayFullscreen) { @@ -752,7 +794,7 @@ } private void SaveVideo(VideoInfo foListItem) { - Site loSite = moSiteList[msSelectedSiteId]; + SiteSettings loSite = moSiteList[msSelectedSiteId]; //String lsUrl = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getUrl(foListItem.Path); String lsUrl = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getUrl(foListItem,loSite); WebClient loClient = new WebClient(); @@ -831,9 +873,10 @@ DisplayVideoInfo(null); break; case State.info: - GUIPropertyManager.SetProperty("#header.label",String.Empty); - GUIPropertyManager.SetProperty("#header.image",String.Empty); - DisplayVideoInfo(null); + + GUIPropertyManager.SetProperty("#header.label",msSelectedVideo); + GUIPropertyManager.SetProperty("#header.image","OnlineVidlogo"+msSelectedSiteId+".jpeg"); + //DisplayVideoInfo(); break; } } @@ -965,6 +1008,7 @@ GUIControl.ShowControl(GetID,121); GUIControl.ShowControl(GetID,131); GUIControl.ShowControl(GetID,141); + //if() //Log.Info(foVideo.Description); } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -23,6 +23,10 @@ { return "15"; } + public override bool hasMultipleVideos() + { + return true; + } public override List<GUIOnlineVideos.VideoInfo> getVideoList(String fsUrl) { List<GUIOnlineVideos.VideoInfo> loListItems = new List<GUIOnlineVideos.VideoInfo>(); @@ -82,11 +86,29 @@ return loListItems; } - - public override String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.Site foSite) + public override List<OnlineVideos.GUIOnlineVideos.VideoInfo> getOtherVideoList(OnlineVideos.GUIOnlineVideos.VideoInfo video) { + List<OnlineVideos.GUIOnlineVideos.VideoInfo> videoList = new List<OnlineVideos.GUIOnlineVideos.VideoInfo>(); TrailerInfo trailer = (TrailerInfo)video.Other; + trailer = AppleTrailers.GetTrailerUrls(trailer); + Console.WriteLine("Found {0} trailer urls",trailer.trailers.Count); + GUIOnlineVideos.VideoInfo newVideo; + foreach (String name in trailer.trailers.Keys){ + newVideo = new GUIOnlineVideos.VideoInfo(); + newVideo.Title = name; + newVideo.VideoUrl = trailer.trailers[name]; + newVideo.Description = trailer.Overview; + Console.WriteLine(newVideo.Description); + newVideo.Other = trailer; + videoList.Add(newVideo); + } + return videoList; + } + public override String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.SiteSettings foSite) + { + TrailerInfo trailer = (TrailerInfo)video.Other; trailer = AppleTrailers.ProcessTrailer(trailer); + Console.WriteLine("Found {0} trailer urls",trailer.TrailerStreamCollection.Count); return trailer.TrailerStreamCollection[0].Uri.ToString(); } public List<GUIOnlineVideos.VideoInfo> getAllTrailers(){ @@ -144,12 +166,12 @@ worker.RunWorkerAsync(fsLink); DateTime startTime = DateTime.Now; TimeSpan duration = new TimeSpan(); - using (WaitCursor cursor = new WaitCursor()) + //using (WaitCursor cursor = new WaitCursor()) { while (HDTrailerPlugin.AppleTrailers._workerCompleted == false && duration.TotalSeconds < 10){ //Log.Info("donwload trailer duration = {0} seconds",duration.TotalSeconds); - GUIWindowManager.Process(); + //GUIWindowManager.Process(); duration = DateTime.Now - startTime;; } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -134,6 +134,14 @@ return trailerInfo; } #endregion + public static ITMSClient.TrailerInfo GetTrailerUrls(object obj) + { + + ITMSClient.TrailerInfo trailerInfo = (ITMSClient.TrailerInfo)obj; + // Populate the rest of the meta data + trailerInfo = ITMSClient.ITMSHelper.PopulateTrailerUrls(trailerInfo); + return trailerInfo; + } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -2,22 +2,23 @@ * iTunes Movie Trailer Import * Copyright (c) 2005 Jonathan Bradshaw * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions + * The above copyright notice and this permission notice shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED - * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ using System; using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Text.RegularExpressions; @@ -38,7 +39,41 @@ private const string USER_AGENT = "User-Agent: iTunes/6.0 (Windows)"; private static Hashtable HighDef = HDHelper.GetAvailableMovies(); #endregion - + + + static public TrailerInfo PopulateTrailerUrls(TrailerInfo trailerInfo) + { + MatchCollection matches; + //Console.WriteLine(""); + ITMSContent infoPage = GetITMSPage(trailerInfo.Url); + if (infoPage.IsValid) + { + Match field = RegexParsers.moviedetailsRegex1.Match(infoPage.Xml); + //String desc; + if (field.Success) + { + //Log.Info("got the movie details for {0}",trailerInfo.Title); + trailerInfo.Overview = field.Groups["overview"].Value.Replace("\r\n", " ").Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); + } + String name; + String url; + + Dictionary<string, string> trailers = new Dictionary<string, string>(); + // First regular expression parser + matches = RegexParsers.trailerLinkRegex.Matches(infoPage.Xml); + if (matches.Count>0) + { + foreach(Match fields in matches){ + name = fields.Groups["name"].Value; + url=fields.Groups["url"].Value; + trailers.Add(name,url); + + } + trailerInfo.trailers = trailers; + } + } + return trailerInfo; + } #region Public Methods /// <summary> /// Populates the full meta data for a particular trailer @@ -47,7 +82,7 @@ /// <returns></returns> static public TrailerInfo PopulateTrailerDetails(TrailerInfo trailerInfo, ITMSClient.TrailerSize desiredSize) { - //Log.Info("Populating Trailer details for {0}", trailerInfo.Title); + //Log.Info("Populating Trailer details for {0}", trailerInfo.Title); string[] MONTHS = new string[]{"January","February","March","April","May","June","July","August","September","October","November","December"}; //const string DIRECTOR = "(dir.)"; Match fields; @@ -55,26 +90,26 @@ StringBuilder actors = new StringBuilder("|"); ITMSContent infoPage = GetITMSPage(trailerInfo.Url); - //Log.Info(infoPage.Xml); - if (infoPage.IsValid) - { - // First regular expression parser - fields = RegexParsers.moviedetailsRegex1.Match(infoPage.Xml); - if (fields.Success) - { - //Log.Info("got the movie details for {0}",trailerInfo.Title); - trailerInfo.Title = fields.Groups["title"].Value.Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); - trailerInfo.PosterUrl = new Uri(fields.Groups["poster"].Value); - trailerInfo.Copyright = fields.Groups["copyright"].Value; - trailerInfo.Overview = fields.Groups["overview"].Value.Replace("\r\n", " ").Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); + //Log.Info(infoPage.Xml); + if (infoPage.IsValid) + { + // First regular expression parser + fields = RegexParsers.moviedetailsRegex1.Match(infoPage.Xml); + if (fields.Success) + { + //Log.Info("got the movie details for {0}",trailerInfo.Title); + trailerInfo.Title = fields.Groups["title"].Value.Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); + trailerInfo.PosterUrl = new Uri(fields.Groups["poster"].Value); + trailerInfo.Copyright = fields.Groups["copyright"].Value; + trailerInfo.Overview = fields.Groups["overview"].Value.Replace("\r\n", " ").Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); - // Second regular expression parser (split due to issues with .NET regex spinning out of control) + // Second regular expression parser (split due to issues with .NET regex spinning out of control) - fields = RegexParsers.moviedetailsRegex2.Match(infoPage.Xml); - /* + fields = RegexParsers.moviedetailsRegex2.Match(infoPage.Xml); + /* if (fields.Success) { - trailerInfo.Rating = fields.Groups["rating"].Value; + trailerInfo.Rating = fields.Groups["rating"].Value; // Release details (either a date or Coming Soon) and year (assume this year if we don't find one) trailerInfo.Release = fields.Groups["release"].Value; @@ -83,7 +118,7 @@ { trailerInfo.Year = Convert.ToInt32(date.Groups["year"].Value); trailerInfo.SortDate = new DateTime( - trailerInfo.Year, + trailerInfo.Year, Array.IndexOf(MONTHS, date.Groups["month"].Value)+1, Convert.ToInt32(date.Groups["day"].Value)); } @@ -114,47 +149,48 @@ actors.Append(cast.Value.Trim()).Append("|"); } trailerInfo.Actors = actors.ToString(); - */ - trailerInfo.TrailerStreamCollection = new TrailerStreamCollection(); + */ + trailerInfo.TrailerStreamCollection = new TrailerStreamCollection(); - // WARNING: HACK CODE FOR HIGHDEF TRAILERS - if (desiredSize >= TrailerSize.HD480p) - { - if (HighDef.Contains(trailerInfo.Title)) - { - Console.WriteLine("Found HD movie for " + trailerInfo.Title); - Uri page = HighDef[trailerInfo.Title] as Uri; - Uri mov = HDHelper.GetHDMovie(page, desiredSize); - TrailerStream myStream = new TrailerStream(desiredSize, page); - myStream.Type = "HD"; - trailerInfo.Type = "HD"; - myStream.Movie = mov; - trailerInfo.TrailerStreamCollection.Add(myStream); - } - } - // END HACK CODE + // WARNING: HACK CODE FOR HIGHDEF TRAILERS + if (desiredSize >= TrailerSize.HD480p) + { + if (HighDef.Contains(trailerInfo.Title)) + { + Console.WriteLine("Found HD movie for " + trailerInfo.Title); + Uri page = HighDef[trailerInfo.Title] as Uri; + Uri mov = HDHelper.GetHDMovie(page, desiredSize); + TrailerStream myStream = new TrailerStream(desiredSize, page); + myStream.Type = "HD"; + trailerInfo.Type = "HD"; + myStream.Movie = mov; + trailerInfo.TrailerStreamCollection.Add(myStream); + } + } + // END HACK CODE - // Get movie trailer streams - if (desiredSize != TrailerSize.None && trailerInfo.TrailerStreamCollection.Count == 0) - { - foreach (Capture url in fields.Groups["urls"].Captures) - { - //Log.Info("Found stream url:{0}", url); - TrailerStreamCollection tsc = GetTrailerStreamCollection(new Uri(infoPage.WebResponse.ResponseUri, url.Value)); - TrailerStream myStream = GetDesiredTrailerStream(tsc, desiredSize); - trailerInfo.TrailerStreamCollection.Add(myStream); - } - } - trailerInfo.TrailerStreamCollection.TrimToSize(); - //} - } - } - else - { - Log.Debug("Invalid page {0} for trailer {1}", trailerInfo.Url, trailerInfo.Title); - } + // Get movie trailer streams + if (desiredSize != TrailerSize.None && trailerInfo.TrailerStreamCollection.Count == 0) + { + foreach (Capture url in fields.Groups["urls"].Captures) + { + //Log.Info("Found stream url:{0}", url); + TrailerStreamCollection tsc = GetTrailerStreamCollection(new Uri(infoPage.WebResponse.ResponseUri, url.Value)); + + TrailerStream myStream = GetDesiredTrailerStream(tsc, desiredSize); + trailerInfo.TrailerStreamCollection.Add(myStream); + } + } + trailerInfo.TrailerStreamCollection.TrimToSize(); + //} + } + } + else + { + Log.Debug("Invalid page {0} for trailer {1}", trailerInfo.Url, trailerInfo.Title); + } return trailerInfo; - } + } /// <summary> /// Downloads the cover image to the specified destination directory if @@ -169,14 +205,14 @@ Uri uri = TrailerInfo.PosterUrl; string filename = Path.Combine(destinationDirectory, uri.AbsolutePath.Remove(0, uri.AbsolutePath.LastIndexOf('/')+1)); if (File.Exists(filename) == false) - try - { - webClient.DownloadFile(uri.AbsoluteUri, filename); - } - catch (WebException) - { - return String.Empty; - } + try + { + webClient.DownloadFile(uri.AbsoluteUri, filename); + } + catch (WebException) + { + return String.Empty; + } return filename; } @@ -199,8 +235,8 @@ ITMSContent content = null; //Log.Debug("GetITMSPage: " + uri.AbsoluteUri); - //Log.Info("GetITMSPage: " + uri.AbsoluteUri); - try + //Log.Info("GetITMSPage: " + uri.AbsoluteUri); + try { request = (HttpWebRequest) HttpWebRequest.Create(uri); request.KeepAlive = false; @@ -211,18 +247,18 @@ if (ifModifiedSince != DateTime.MinValue) request.IfModifiedSince = ifModifiedSince; - //Log.Info("getiing request response"); + //Log.Info("getiing request response"); response = (HttpWebResponse) request.GetResponse(); - //Log.Info("got response"); - sReader = new StreamReader(response.GetResponseStream(), - System.Text.Encoding.UTF8, false, (int) Math.Abs(response.ContentLength)); - //Log.Info("Got Response Stream"); - - //Log.Info("Download xml"); - content = new ITMSContent(response, - HttpUtility.HtmlDecode( - sReader.ReadToEnd())); - //Log.Info("created ITMSContent"); + //Log.Info("got response"); + sReader = new StreamReader(response.GetResponseStream(), + System.Text.Encoding.UTF8, false, (int) Math.Abs(response.ContentLength)); + //Log.Info("Got Response Stream"); + + //Log.Info("Download xml"); + content = new ITMSContent(response, + HttpUtility.HtmlDecode( + sReader.ReadToEnd())); + //Log.Info("created ITMSContent"); //Log.Debug(response.LastModified); } catch (WebException ex) @@ -241,14 +277,14 @@ }catch(Exception e){ Log.Error(e); } - finally + finally { - if(sReader != null) + if(sReader != null) sReader.Close(); - if(response != null) + if(response != null) response.Close(); } - return content; + return content; } #endregion @@ -259,8 +295,8 @@ /// <param name="uri">URI.</param> /// <returns></returns> private static TrailerStream GetDesiredTrailerStream(TrailerStreamCollection trailerStreams, TrailerSize desiredSize) - { - //Log.Info("getting desired Trailer size of {0}", desiredSize); + { + //Log.Info("getting desired Trailer size of {0}", desiredSize); // Find the largest desired size supported by the available streams while (trailerStreams.ContainsKey(desiredSize) == false && desiredSize > 0) desiredSize = desiredSize - 1; @@ -282,8 +318,8 @@ stream.Date = content.WebResponse.LastModified; } } - */ - //Log.Info("Finished getting desired trailer"); + */ + //Log.Info("Finished getting desired trailer"); return stream; } @@ -307,21 +343,21 @@ // Details not available for older trailers if (streamDetails.Groups["type"].Success) type = streamDetails.Groups["type"].Value; - if (streamDetails.Groups["minutes"].Success) - { - string minutes = streamDetails.Groups["minutes"].Value; - if (String.IsNullOrEmpty(minutes)) - minutes = "0"; - length = new TimeSpan(0, Convert.ToInt32(minutes), Convert.ToInt32(streamDetails.Groups["seconds"].Value)); - } + if (streamDetails.Groups["minutes"].Success) + { + string minutes = streamDetails.Groups["minutes"].Value; + if (String.IsNullOrEmpty(minutes)) + minutes = "0"; + length = new TimeSpan(0, Convert.ToInt32(minutes), Convert.ToInt32(streamDetails.Groups["seconds"].Value)); + } MatchCollection streamMatches = RegexParsers.streamRegex.Matches(trailerPage.Xml); foreach (Match m in streamMatches) { TrailerSize size = (TrailerSize) Enum.Parse(typeof(TrailerSize), m.Groups["size"].Value, true); - //Log.Info("found size {0}",size); - Uri uri = new Uri(trailerPage.WebResponse.ResponseUri, m.Groups["url"].Value); - //Log.Info("found url {0}", uri.ToString()); + //Log.Info("found size {0}",size); + Uri uri = new Uri(trailerPage.WebResponse.ResponseUri, m.Groups["url"].Value); + //Log.Info("found url {0}", uri.ToString()); TrailerStream ts = new TrailerStream(size, uri); ts.Length = length; ts.Type = type; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -75,6 +75,15 @@ RegexOptions.ExplicitCapture | RegexOptions.Compiled ); + + //Used to find the multiple trailer urls + internal static Regex trailerLinkRegex = new Regex( + "<HBoxView[^>]*>\\s*<GotoURL\\starget=\"main\"\\surl=\"(?<url>[^\"]*)[^=]*=[^=]*=\"(?<name>[^\"]*)", + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); + /// <summary> /// Used to pull the type and length of the Quicktime trailer movies available from Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -18,6 +18,8 @@ */ using System; using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; using System.IO; namespace ITMSClient @@ -45,6 +47,7 @@ private Uri _posterUrl; private DateTime _sortDate; private TrailerStreamCollection _trailerStreamCollection; + private Dictionary<String, String> _trailers; #endregion #region Properties @@ -214,6 +217,11 @@ get { return _sortDate; } set { _sortDate = value; } } + public Dictionary<String, String> trailers + { + get{return _trailers;} + set{_trailers = value;} + } #endregion } } Added: trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs (rev 0) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -0,0 +1,74 @@ +/* + * Created by SharpDevelop. + * User: GZamor1 + * Date: 8/28/2007 + * Time: 3:09 PM + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ + +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using System.Xml; +using System.IO; +using System.ComponentModel; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.Dialogs; +//using Rss; +using MediaPortal.GUI.View ; + +namespace OnlineVideos +{ + /// <summary> + /// Description of LiveVideoUtil. + /// </summary> + public class LiveVideoUtil : SiteUtilBase + { + public override string getSiteId() + { + return "21"; + } + + protected override String getUrl(String fsId) + { + + String lsHtml = getHTMLData(fsId); + Match loMatch = Regex.Match(lsHtml,@"GetFlashPlayer\('([^']*)"); + String lsUrl = ""; + if(loMatch.Success){ + lsUrl = System.Web.HttpUtility.UrlDecode(loMatch.Groups[1].Value); + lsUrl = Regex.Match(lsUrl,"video=([^&]*)").Groups[1].Value; + lsHtml = getHTMLData(lsUrl); + lsHtml = System.Web.HttpUtility.UrlDecode(getHTMLData(lsUrl)); + + //loMatch = Regex.Match(lsHtml,) + //lsUrl = System.Web.HttpUtility.UrlDecode(lsHtml); + lsUrl = Regex.Match(lsHtml,"video_id=([^&]*)").Groups[1].Value; + }else{ + Log.Info("LiveVideo video not found. Site could have changed layout."); + } + return lsUrl; + } + public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) + { + List<RssItem> loRssItemList = getRssDataItems(fsUrl); + List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo video; + foreach(RssItem rssItem in loRssItemList){ + video = new GUIOnlineVideos.VideoInfo(); + video.Description = rssItem.mediaDescription; + video.ImageUrl = rssItem.mediaThumbnail; + video.Title = rssItem.title; + video.Length = rssItem.contentList[0].duration; + video.VideoUrl = rssItem.link; + loVideoList.Add(video); + } + return loVideoList; + } + } +} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -33,9 +33,13 @@ //SiteUtilBase loUtil = new YouTubeUtil(); //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://youtube.com/rss/global/top_rated.rss"); - SiteUtilBase loUtil = new ItunesTrailerUtil(); - List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("%transformers"); + ItunesTrailerUtil loUtil = new ItunesTrailerUtil(); + List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml"); + //loUtil.getUrl(loList[0],null); + loList =loUtil.getOtherVideoList(loList[9]); + //loUtil.getUrl(loList[8],null); + //loUtil.getUrl(loList[loList.Count-1],null); /* SiteUtilBase loUtil = new BlipTvUtil(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -23,7 +23,7 @@ public String msThumbLocation; public String msDownloadDir; public String[] msFilterArray; - public Dictionary<String,GUIOnlineVideos.Site> moSiteList = new Dictionary<String, GUIOnlineVideos.Site>(); + public Dictionary<String,GUIOnlineVideos.SiteSettings> moSiteList = new Dictionary<String, GUIOnlineVideos.SiteSettings>(); private const String SETTINGS_FILE = "OnlineVideoSites.xml"; private const String THUMBNAIL_DIR = "thumbDir"; @@ -69,14 +69,14 @@ XmlNode root = doc.SelectSingleNode("//settings/sites/site"); XmlNodeList nodeList; nodeList = root.SelectNodes("//settings/sites/site"); - List<GUIOnlineVideos.Site> loSiteList = new List<GUIOnlineVideos.Site>(); - GUIOnlineVideos.Site loSite; + List<GUIOnlineVideos.SiteSettings> loSiteList = new List<GUIOnlineVideos.SiteSettings>(); + GUIOnlineVideos.SiteSettings loSite; XmlNodeList RssNodeList; GUIOnlineVideos.RssLink loRssData; bool lbDonwloadDirSet = false; foreach (XmlNode chileNode in nodeList) { - loSite = new GUIOnlineVideos.Site(); + loSite = new GUIOnlineVideos.SiteSettings(); XmlNode node = chileNode.SelectSingleNode("name"); loSite.name = node.InnerText; @@ -202,7 +202,7 @@ XmlElement siteRssNode; XmlElement siteEnabledNode; String lsConfirm; - foreach(GUIOnlineVideos.Site site in moSiteList.Values){ + foreach(GUIOnlineVideos.SiteSettings site in moSiteList.Values){ siteNode = xmlDoc.CreateElement("site"); siteNameNode = xmlDoc.CreateElement("name"); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-29 23:30:10 UTC (rev 876) @@ -40,10 +40,12 @@ <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.DLL</HintPath> + <Private>False</Private> </Reference> <Reference Include="Databases, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Databases.DLL</HintPath> + <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> @@ -69,6 +71,7 @@ <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> @@ -82,6 +85,7 @@ <Compile Include="FavoriteUtil.cs" /> <Compile Include="FavoriteVideo.cs" /> <Compile Include="GenericSiteUtil.cs" /> + <Compile Include="LiveVideoUtil.cs" /> <Compile Include="OnlineVideoSettings.cs" /> <Compile Include="RocketboomUtil.cs" /> <Compile Include="MyVideodeUtil.cs" /> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj 2007-08-29 23:30:10 UTC (rev 876) @@ -24,14 +24,18 @@ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core"> + <HintPath>..\..\..\..\Mediaportal\Databases\bin\Debug\Core.dll</HintPath> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\Mediaportal\Core\bin\Release\Core.DLL</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> + <Reference Include="Utils"> + <HintPath>..\..\..\..\Mediaportal\Databases\bin\Debug\Utils.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Main.cs" /> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -99,12 +99,17 @@ return db.removeFavoriteVideo(foVideo); } - public virtual String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.Site foSite) + public virtual String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.SiteSettings foSite) { return getUrl(video.VideoUrl); } + public virtual bool hasMultipleVideos(){ + return false; + } + public virtual List<GUIOnlineVideos.VideoInfo> getOtherVideoList(GUIOnlineVideos.VideoInfo foVideo){ + return new List<GUIOnlineVideos.VideoInfo>(); + } - public List<RssItem> getRssDataItems(String fsUrl){ List<RssItem> loRssItems = new List<RssItem>(); try{ @@ -293,7 +298,7 @@ _workerCompleted = true; //return HTMLdownload; } - public static abstract String getSiteId(); + public abstract String getSiteId(); protected bool isPossibleVideo(string fsUrl){ string extensionFile = System.IO.Path.GetExtension(fsUrl).ToLower(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -186,14 +186,14 @@ return loListItems; } */ - public override String getUrl(GUIOnlineVideos.VideoInfo foVideo,GUIOnlineVideos.Site foSite) + public override String getUrl(GUIOnlineVideos.VideoInfo foVideo,GUIOnlineVideos.SiteSettings foSite) { String lsSessionId = getSessionId(foVideo.VideoUrl,foSite); String lsUrl = "http://youtube.com/get_video?video_id=" +foVideo.VideoUrl + "&t=" + lsSessionId; Log.Info("youtube video url={0}", lsUrl); return lsUrl+"&txe=.flv"; } - public String getSessionId(String fsId,GUIOnlineVideos.Site foSite) + public String getSessionId(String fsId,GUIOnlineVideos.SiteSettings foSite) { //Log.Info("getting youtube session id"); String lsUrl; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |