| 103 |
|
|
| 104 |
implementation |
implementation |
| 105 |
|
|
| 106 |
|
uses |
| 107 |
|
Y_TextConverter; |
| 108 |
|
|
| 109 |
constructor TDownloadThread.Create(CreateSuspended: Boolean); |
constructor TDownloadThread.Create(CreateSuspended: Boolean); |
| 110 |
begin |
begin |
| 111 |
inherited Create(CreateSuspended); |
inherited Create(CreateSuspended); |
| 190 |
begin |
begin |
| 191 |
FDownloadTitle := FItem.FThreadItem.Title; |
FDownloadTitle := FItem.FThreadItem.Title; |
| 192 |
if FItem.FThreadItem <> nil then begin |
if FItem.FThreadItem <> nil then begin |
| 193 |
if FItem.FThreadItem.IsBoardPlugInAvailable then begin |
if FItem.FThreadItem.ParentBoard.IsBoardPlugInAvailable then begin |
| 194 |
boardPlugIn := FItem.FThreadItem.BoardPlugIn; |
boardPlugIn := FItem.FThreadItem.ParentBoard.BoardPlugIn; |
| 195 |
Item.State := TGikoDownloadState( boardPlugIn.DownloadThread( DWORD( FItem.FThreadItem ) ) ); |
Item.State := TGikoDownloadState( boardPlugIn.DownloadThread( DWORD( FItem.FThreadItem ) ) ); |
| 196 |
end; |
end; |
| 197 |
|
//if FItem.FThreadItem.IsBoardPlugInAvailable then begin |
| 198 |
|
// boardPlugIn := FItem.FThreadItem.BoardPlugIn; |
| 199 |
|
// Item.State := TGikoDownloadState( boardPlugIn.DownloadThread( DWORD( FItem.FThreadItem ) ) ); |
| 200 |
|
//end; |
| 201 |
end; |
end; |
| 202 |
end; |
end; |
| 203 |
end; |
end; |
| 770 |
Writeln('URL: ' + URL); |
Writeln('URL: ' + URL); |
| 771 |
{$ENDIF} |
{$ENDIF} |
| 772 |
FIndy.Get(URL, ResStream); |
FIndy.Get(URL, ResStream); |
| 773 |
Item.Content := GikoSys.GzipDecompress(ResStream, FIndy.Response.ContentEncoding); |
Item.Content := GikoSys.GzipDecompress(ResStream, FIndy.Response.ContentEncoding); |
| 774 |
|
if (FIndy.URL.Host = 'be.2ch.net') and (FIndy.URL.Path = '/be/') then begin |
| 775 |
|
Item.Content := EUCtoSJIS(Item.Content); |
| 776 |
|
end; |
| 777 |
|
|
| 778 |
Item.LastModified := FIndy.Response.LastModified; |
Item.LastModified := FIndy.Response.LastModified; |
| 779 |
//差分取得で1バイト前からとってきたときはマイナスする |
//差分取得で1バイト前からとってきたときはマイナスする |
| 780 |
// Item.ContentLength := FIndy.Response.ContentLength + AdjustLen; |
// Item.ContentLength := FIndy.Response.ContentLength + AdjustLen; |
| 971 |
index := boardItem.GetIndexFromURL( string( inURL ) ); |
index := boardItem.GetIndexFromURL( string( inURL ) ); |
| 972 |
if index = -1 then begin |
if index = -1 then begin |
| 973 |
//新しいスレッド |
//新しいスレッド |
| 974 |
_ThreadItem := TThreadItem.Create( boardItem.BoardPlugIn, string( inURL ) ); |
_ThreadItem := TThreadItem.Create( boardItem.BoardPlugIn, boardItem, string( inURL ) ); |
| 975 |
|
|
| 976 |
_ThreadItem.Title := string( inTitle ); |
_ThreadItem.Title := string( inTitle ); |
| 977 |
_ThreadItem.AllResCount := inCount; |
_ThreadItem.AllResCount := inCount; |
| 1052 |
if index = -1 then begin |
if index = -1 then begin |
| 1053 |
//新しいスレッド |
//新しいスレッド |
| 1054 |
NewItem := TThreadItem.Create( |
NewItem := TThreadItem.Create( |
| 1055 |
nil, GikoSys.Get2chBoard2ThreadURL( Board, ChangeFileExt( Rec.FFileName, '' ) ) ); |
nil, |
| 1056 |
|
Board, |
| 1057 |
|
GikoSys.Get2chBoard2ThreadURL( Board, ChangeFileExt( Rec.FFileName, '' ) ) ); |
| 1058 |
NewItem.Title := Rec.FTitle; |
NewItem.Title := Rec.FTitle; |
| 1059 |
NewItem.AllResCount := Rec.FCount; |
NewItem.AllResCount := Rec.FCount; |
| 1060 |
NewItem.ParentBoard := Board; |
NewItem.ParentBoard := Board; |
| 1207 |
begin |
begin |
| 1208 |
FileName := ThreadItem.GetThreadFileName; |
FileName := ThreadItem.GetThreadFileName; |
| 1209 |
|
|
| 1210 |
if not ThreadItem.IsBoardPlugInAvailable then begin |
//if not ThreadItem.IsBoardPlugInAvailable then begin |
| 1211 |
|
if not ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin |
| 1212 |
if Trim(Content) = '' then |
if Trim(Content) = '' then |
| 1213 |
Exit; |
Exit; |
| 1214 |
|
|