private async Task <String> ProcessSearchRequest(SearchRequestObject RequestObject)
 {
     using (WebDownloader WebDownloader = new WebDownloader())
     {
         WebDownloader.Encoding = System.Text.Encoding.UTF8;
         WebDownloader.Referer  = RequestObject.Referer;
         switch (RequestObject.Method)
         {
         case SearchMethod.GET:
             return(await WebDownloader.DownloadStringTaskAsync(RequestObject.Url));
         }
     }
     return(null);
 }
        /// <summary>
        /// Download the content of the IExtension for the MangaObject
        /// </summary>
        /// <param name="Extension">The IExtension to use for Cookies and Referer</param>
        /// <param name="MangaObject">The MangaObject used</param>
        /// <returns></returns>
        private async Task <ExtensionContentResult> LoadExtensionSearchContent(IExtension Extension, String SearchTerm)
        {
            using (WebDownloader WebDownloader = new WebDownloader(Extension.Cookies))
            {
                WebDownloader.Encoding = System.Text.Encoding.UTF8;
                WebDownloader.Referer  = Extension.ExtensionDescriptionAttribute.RefererHeader;
                try
                {
                    SearchRequestObject sro = Extension.GetSearchRequestObject(SearchTerm);
                    String Content          = await ProcessSearchRequest(sro).Retry(DOWNLOAD_TIMEOUT);

                    return(new ExtensionContentResult()
                    {
                        Extension = Extension,
                        Location = new LocationObject()
                        {
                            Enabled = true,
                            Url = sro.Url,
                            ExtensionName = Extension.ExtensionDescriptionAttribute.Name,
                            ExtensionLanguage = Extension.ExtensionDescriptionAttribute.Language
                        },
                        Content = Content
                    });
                }
                catch (Exception ex)
                {
                    String Name     = Extension.ExtensionDescriptionAttribute.Name,
                           Language = Extension.ExtensionDescriptionAttribute.Language;
                    if (!Equals(CORE.Logger, null))
                    {
                        CORE.Logger.Warn(String.Format("Unable to load search content from {0}-{1} for {2}.", Name, Language, SearchTerm), ex);
                    }
                    return(null);
                }
            }
        }