C# Class NijieDownloader.Library.Nijie

Afficher le fichier Open project: Nandaka/NijieDownloader Class Usage Examples

Private Properties

Свойство Type Description
DeleteTempFile string
DoLogin bool
ParseImageExtras void
ParseImageLinks void
ParseImageList List
ParseImagePopups NijieDownloader.Library.Model.NijieImage
ParseImageTags void
ParseImageTitleAndDescription void
ParseMemberBookmark void
ParseMemberFromImage NijieDownloader.Library.Model.NijieMember
ParseMemberImages void
ParseMemberProfile void
ParseSearchImageList List
ParseTotalImageCount int
PrepareLoginInfo NijieDownloader.Library.Model.NijieLoginInfo
PrintCookie void
ProcessDoujin void
canOperate void
checkErrorMessage void
checkHttpStatusCode void
checkOverwrite void
downloadPostCheck void
downloadPreCheck System.Int64
getPage WebResponse>.Tuple

Méthodes publiques

Méthode Description
Download ( string url, string referer, string filename, Action progressChanged, CancellationToken cancelToken ) : string

Download image

DownloadData ( string url, string referer ) : byte[]

Download data to memory byte array.

GetInstance ( ILog _log = null, bool useHttps = false ) : Nijie
Login ( string userName, string password ) : bool
LoginAsync ( string userName, string password, string>.Action callback ) : void
Logout ( ) : void
Nijie ( ILog _log ) : System
ParseImage ( NijieImage image, NijieMember member = null ) : NijieImage
ParseImage ( NijieImage image, NijieMember &member, HtmlAgilityPack.HtmlDocument doc ) : NijieImage
ParseImage ( int imageId, string referer = null ) : NijieImage
ParseImagePopUp ( NijieImage image, HtmlAgilityPack.HtmlDocument doc ) : NijieImage
ParseMember ( HtmlAgilityPack.HtmlDocument doc, NijieMember member, MemberMode mode ) : NijieMember

Parse member from html document.

ParseMember ( int memberId, MemberMode mode, int page ) : NijieMember

Parse member from internet based on given member id, mode, and page number.

ParseMyImageBookmark ( int page ) : bool>.Tuple
ParseMyMemberBookmark ( int page ) : bool>.Tuple
ParseSearch ( HtmlAgilityPack.HtmlDocument doc, NijieSearch search ) : NijieSearch

Parse the search page

Search ( NijieSearchOption option ) : NijieSearch

Get and parse the search page

Private Methods

Méthode Description
DeleteTempFile ( string filename, Action progressChanged ) : string
DoLogin ( NijieLoginInfo info ) : bool
ParseImageExtras ( NijieImage image, HtmlAgilityPack.HtmlDocument doc ) : void
ParseImageLinks ( NijieImage image, HtmlAgilityPack.HtmlDocument doc ) : void
ParseImageList ( string html, string referer ) : List

Parse image list from member.

ParseImagePopups ( NijieImage image ) : NijieImage
ParseImageTags ( NijieImage image, HtmlAgilityPack.HtmlDocument doc ) : void
ParseImageTitleAndDescription ( NijieImage image, HtmlAgilityPack.HtmlDocument doc ) : void
ParseMemberBookmark ( HtmlAgilityPack.HtmlDocument doc, NijieMember member ) : void
ParseMemberFromImage ( HtmlAgilityPack.HtmlDocument doc ) : NijieMember
ParseMemberImages ( HtmlAgilityPack.HtmlDocument doc, NijieMember member ) : void
ParseMemberProfile ( HtmlAgilityPack.HtmlDocument doc, NijieMember member ) : void
ParseSearchImageList ( string html, string referer ) : List

Parse image list from search.

ParseTotalImageCount ( HtmlAgilityPack.HtmlNodeCollection imageCountElements ) : int
PrepareLoginInfo ( string userName, string password ) : NijieLoginInfo
PrintCookie ( string header ) : void
ProcessDoujin ( NijieImage image, HtmlAgilityPack.HtmlDocument doc ) : void
canOperate ( ) : void
checkErrorMessage ( HtmlAgilityPack.HtmlDocument doc ) : void
checkHttpStatusCode ( string url, Exception ex ) : void

Throw exception if have httpstatuscode : - 403 Forbidden - 404 NotFound

checkOverwrite ( string filename, Action progressChanged, string &message ) : void

Check if allow overwrite

downloadPostCheck ( string filename, string tempFilename, System.Int64 bytes_total, Action progressChanged, string &message ) : void

if compression is enabled or Content Length is unknown, check after downloaded.

downloadPreCheck ( string filename, ExtendedWebClient client, Action progressChanged, string &message ) : System.Int64

Check if File exists and need to redownload.

getPage ( string url ) : WebResponse>.Tuple

Method Details

Download() public méthode

Download image
public Download ( string url, string referer, string filename, Action progressChanged, CancellationToken cancelToken ) : string
url string
referer string
filename string
progressChanged Action
cancelToken CancellationToken
Résultat string

DownloadData() public méthode

Download data to memory byte array.
public DownloadData ( string url, string referer ) : byte[]
url string
referer string
Résultat byte[]

GetInstance() public static méthode

public static GetInstance ( ILog _log = null, bool useHttps = false ) : Nijie
_log ILog
useHttps bool
Résultat Nijie

Login() public méthode

public Login ( string userName, string password ) : bool
userName string
password string
Résultat bool

LoginAsync() public méthode

public LoginAsync ( string userName, string password, string>.Action callback ) : void
userName string
password string
callback string>.Action
Résultat void

Logout() public méthode

public Logout ( ) : void
Résultat void

Nijie() public méthode

public Nijie ( ILog _log ) : System
_log ILog
Résultat System

ParseImage() public méthode

public ParseImage ( NijieImage image, NijieMember member = null ) : NijieImage
image NijieDownloader.Library.Model.NijieImage
member NijieDownloader.Library.Model.NijieMember
Résultat NijieDownloader.Library.Model.NijieImage

ParseImage() public méthode

public ParseImage ( NijieImage image, NijieMember &member, HtmlAgilityPack.HtmlDocument doc ) : NijieImage
image NijieDownloader.Library.Model.NijieImage
member NijieDownloader.Library.Model.NijieMember
doc HtmlAgilityPack.HtmlDocument
Résultat NijieDownloader.Library.Model.NijieImage

ParseImage() public méthode

public ParseImage ( int imageId, string referer = null ) : NijieImage
imageId int
referer string
Résultat NijieDownloader.Library.Model.NijieImage

ParseImagePopUp() public static méthode

public static ParseImagePopUp ( NijieImage image, HtmlAgilityPack.HtmlDocument doc ) : NijieImage
image NijieDownloader.Library.Model.NijieImage
doc HtmlAgilityPack.HtmlDocument
Résultat NijieDownloader.Library.Model.NijieImage

ParseMember() public méthode

Parse member from html document.
public ParseMember ( HtmlAgilityPack.HtmlDocument doc, NijieMember member, MemberMode mode ) : NijieMember
doc HtmlAgilityPack.HtmlDocument
member NijieDownloader.Library.Model.NijieMember
mode MemberMode
Résultat NijieDownloader.Library.Model.NijieMember

ParseMember() public méthode

Parse member from internet based on given member id, mode, and page number.
public ParseMember ( int memberId, MemberMode mode, int page ) : NijieMember
memberId int
mode MemberMode
page int
Résultat NijieDownloader.Library.Model.NijieMember

ParseMyImageBookmark() public méthode

public ParseMyImageBookmark ( int page ) : bool>.Tuple
page int
Résultat bool>.Tuple

ParseMyMemberBookmark() public méthode

public ParseMyMemberBookmark ( int page ) : bool>.Tuple
page int
Résultat bool>.Tuple

ParseSearch() public méthode

Parse the search page
public ParseSearch ( HtmlAgilityPack.HtmlDocument doc, NijieSearch search ) : NijieSearch
doc HtmlAgilityPack.HtmlDocument
search NijieDownloader.Library.Model.NijieSearch
Résultat NijieDownloader.Library.Model.NijieSearch

Search() public méthode

Get and parse the search page
public Search ( NijieSearchOption option ) : NijieSearch
option NijieDownloader.Library.Model.NijieSearchOption
Résultat NijieDownloader.Library.Model.NijieSearch