示例#1
0
        /// <summary>
        /// Download the list of actors
        /// </summary>
        /// <param name="_seriesId"></param>
        /// <returns></returns>
        internal List <TvdbActor> DownloadActors(int _seriesId)
        {
            String xml  = "";
            String link = "";

            try
            {
                link = TvdbLinks.CreateActorLink(_seriesId, m_apiKey);
                xml  = m_webClient.DownloadString(link);
                return(m_xmlHandler.ExtractActors(xml));
            }
            catch (XmlException ex)
            {
                Log.Error("Error parsing the xml file " + link + "\n\n" + xml, ex);
                throw new TvdbInvalidXmlException("Error parsing the xml file " + link + "\n\n" + xml);
            }
            catch (WebException ex)
            {
                Log.Warn("Couldn't download actor info from thetvdb.com", ex);
                if (ex.Message.Equals("The remote server returned an error: (404) Not Found."))
                {
                    throw new TvdbInvalidApiKeyException("Couldn't connect to Thetvdb.com to retrieve actor info of series " + _seriesId +
                                                         ", it seems like you use an invalid api key");
                }
                else
                {
                    throw new TvdbNotAvailableException("Couldn't connect to Thetvdb.com to retrieve actor info of series " + _seriesId +
                                                        ", check your internet connection and the status of http://thetvdb.com");
                }
            }
        }
示例#2
0
        /// <summary>
        /// Download the list of actors
        /// </summary>
        /// <param name="_seriesId"></param>
        /// <returns></returns>
        internal List <TvdbActor> DownloadActors(int _seriesId)
        {
            String xml = m_webClient.DownloadString(TvdbLinks.CreateActorLink(_seriesId, m_apiKey));

            return(m_xmlHandler.ExtractActors(xml));
        }