示例#1
0
        public static async Task <ExFavoriteList> DownloadFavoritesAsync(int pagenumber)
        {
            try
            {
                // Get page html
                if (pagenumber == 1)
                {
                    var htmlStr = await ExClient.GetStringWithExCookie($"http://exhentai.org/favorites.php", "dm_l");

                    return(ExFavoriteList.FromHtml(htmlStr));
                }
                else
                {
                    var htmlStr = await ExClient.GetStringWithExCookie($"http://exhentai.org/favorites.php?page= {pagenumber - 1}");

                    return(ExFavoriteList.FromHtml(htmlStr));
                }


                //return await client.GetStringAsync(uri);
            }
            catch (Exception ex)
            {
                throw new Exception("Cannot download favorite list");
            }
        }
示例#2
0
        public static async Task <ExFavoriteList> DownloadFavoritesAsync(int pagenumber, ExFavoriteSortingMode sortingMode)
        {
            try
            {
                // Get page html
                if (pagenumber == 1)
                {
                    var htmlStr = await ExClient.GetStringWithExCookie($"https://exhentai.org/favorites.php?inline_set={SORTING_STRING[(int)sortingMode]}-https://exhentai.org/favorites.php?inline_set-dm_e", $"");

                    return(ExFavoriteList.FromHtml(htmlStr, sortingMode));
                }
                else
                {
                    var htmlStr = await ExClient.GetStringWithExCookie($"https://exhentai.org/favorites.php?page={pagenumber - 1}&inline_set={SORTING_STRING[(int)sortingMode]}-dm_e", $"");

                    return(ExFavoriteList.FromHtml(htmlStr, sortingMode));
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Cannot download favorite list");
            }
        }