Skip to content

Commit

Permalink
Remove r34.app support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kisspeace committed Jan 19, 2023
1 parent 91a3df9 commit 3e5a361
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 52 deletions.
44 changes: 2 additions & 42 deletions source/NsfwBox.ContentScraper.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
interface
uses
System.SysUtils, System.Generics.Collections,
NetHttp.R34AppApi, R34App.Types,
R34App.Types,
Nethttp.R34JsonApi, R34JsonAPi.Types, NetHttp.Scraper.NsfwXxx,
NsfwXxx.Types, givemeporn.club.types, givemeporn.club.scraper,
NineHentaito.APITypes, NineHentaito.API, Net.HttpClientComponent,
Expand Down Expand Up @@ -44,7 +44,7 @@ TNBoxScraper = class(TObject)
function GetContentPseudo(AList: INBoxHasOriginList; ARequest: string ): boolean;
function GetContentNsfwXxx(AList: INBoxHasOriginList; AReqParam: string; ASearchType: TNsfwUrlType; APageNum: integer; Asort: TnsfwSort; ATypes: TNsfwItemTypes; AOrientations: TNsfwOris; ASite: TNsfwXxxSite): boolean;
function GetContentR34JsonApi(AList: INBoxHasOriginList; ATags: string = ''; APageId: integer = 1; ALimit: integer = 20): boolean;
function GetContentR34App(AList: INBoxHasOriginList; ATags: string; APageId: integer; ALimit: integer; ABooru: TR34AppFreeBooru): boolean;
// function GetContentR34App(AList: INBoxHasOriginList; ATags: string; APageId: integer; ALimit: integer; ABooru: TR34AppFreeBooru): boolean;
function GetContentGmpClub(AList: INBoxHasOriginList; AReqParam: string; ASearchType: TGmpClubSearchType; APageNum: integer): boolean;
function GetContent9Hentaito(AList: INBoxHasOriginList; const ASearch: T9HentaiBookSearchRec): boolean;
function GetContentCoomerParty(AList: INBoxHasOriginList; ASite: string; ARequest, AUserId, AService: string; APageNum: integer): boolean;
Expand Down Expand Up @@ -234,18 +234,6 @@ function TNBoxScraper.GetContent(ARequest: INBoxSearchRequest;
end;
end;

ORIGIN_R34APP:
begin
with ( ARequest As TNBoxSearchReqR34App ) do begin
Result := self.GetContentR34App
( AList,
Request,
PageId,
20,
Booru );
end;
end;

ORIGIN_R34JSONAPI:
begin
Result := self.GetContentR34JsonApi
Expand Down Expand Up @@ -792,34 +780,6 @@ function TNBoxScraper.TryFetchTags(var APost: INBoxItem): boolean;
Self.TryFetchContentUrls(APost);
end;

function TNBoxScraper.GetContentR34App(AList: INBoxHasOriginList; ATags: string;
APageId, ALimit: integer; ABooru: TR34AppFreeBooru): boolean;
var
Client: TR34AppClient;
i: integer;
content: TR34AppItems;
begin
try
Result := false;
Content := nil;
Client := TR34AppClient.Create;
SyncWebClientSet(Client.WebClient, ORIGIN_R34APP);
Content := Client.GetPosts(ATags, APageId, ALimit, ABooru);
Result := ( length(Content) > 0 )
;
for I := 0 to Length(Content) - 1 do begin
var item: TNBoxR34AppItem;

item := TNBoxR34AppItem.Create;
item.Item := Content[i];
Alist.Add(item);
end;

finally
Client.Free;
end;
end;

function TNBoxScraper.GetContentNsfwXxx(AList: INBoxHasOriginList;
AReqParam: string; ASearchType: TNsfwUrlType; APageNum: integer;
Asort: TnsfwSort; ATypes: TNsfwItemTypes; AOrientations: TNsfwOris;
Expand Down
17 changes: 7 additions & 10 deletions source/Unit2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TNBoxSelectMenu = class(TVertScrollBox)
TNBoxOriginSetMenu = class(TNBoxSelectMenu)
public
BtnOriginNsfwXxx: TRectButton;
BtnOriginR34App: TRectButton;
// BtnOriginR34App: TRectButton;
BtnOriginR34JsonApi: TRectButton;
BtnOriginGivemepornClub: TRectButton;
BtnOrigin9Hentaito: TRectButton;
Expand Down Expand Up @@ -237,7 +237,7 @@ constructor TNBoxOriginSetMenu.Create(AOwner: TComponent);
BtnPvrRule34xxx := NewBtn(PROVIDERS.Rule34xxx.Id);
BtnPvrRealbooru := NewBtn(PROVIDERS.Realbooru.Id);
BtnPvrRule34us := NewBtn(PROVIDERS.Rule34us.Id);
BtnOriginR34App := NewBtn(ORIGIN_R34APP);
// BtnOriginR34App := NewBtn(ORIGIN_R34APP);
BtnOriginGivemepornClub := NewBtn(ORIGIN_GIVEMEPORNCLUB);
BtnOriginBookmarks := NewBtn(ORIGIN_BOOKMARKS);
BtnOriginPseudo := NewBtn(ORIGIN_PSEUDO);
Expand All @@ -251,11 +251,6 @@ constructor TNBoxOriginSetMenu.Create(AOwner: TComponent);

destructor TNBoxOriginSetMenu.Destroy;
begin
BtnOriginNsfwxxx.Free;
BtnOriginR34App.Free;
BtnOriginR34JsonApi.Free;
BtnOriginGivemepornClub.Free;
BtnOriginPseudo.Free;
inherited;
end;

Expand Down Expand Up @@ -709,7 +704,7 @@ constructor TNBoxSearchMenu.Create(AOwner: TComponent);

RandomizerMenu := NewProviderMenu(PROVIDERS.Randomizer.id);
BtnRandNsfwXxx := NewBtnCheck(OriginToStr(ORIGIN_NSFWXXX), RandomizerMenu, Form1.AppStyle.GetImagePath(ORIGIN_NSFWXXX));
BtnRandR34App := NewBtnCheck(OriginToStr(ORIGIN_R34APP), RandomizerMenu, Form1.AppStyle.GetImagePath(ORIGIN_R34APP));
// BtnRandR34App := NewBtnCheck(OriginToStr(ORIGIN_R34APP), RandomizerMenu, Form1.AppStyle.GetImagePath(ORIGIN_R34APP));
BtnRandGmpClub := NewBtnCheck(OriginToStr(ORIGIN_GIVEMEPORNCLUB), RandomizerMenu, Form1.AppStyle.GetImagePath(ORIGIN_GIVEMEPORNCLUB));
BtnRandCoomerParty := NewBtnCheck(OriginToStr(ORIGIN_COOMERPARTY), RandomizerMenu, Form1.AppStyle.GetImagePath(ORIGIN_COOMERPARTY));
BtnRandMotherless := NewBtnCheck(OriginToStr(ORIGIN_MOTHERLESS), RandomizerMenu, Form1.AppStyle.GetImagePath(ORIGIN_MOTHERLESS));
Expand Down Expand Up @@ -1058,7 +1053,10 @@ procedure TNBoxSearchMenu.SetRequest(const value: INBoxSearchRequest);
end else if ( Value is TNBoxSearchReqR34App ) then begin

With ( Value as TNBoxSearchReqR34App ) do begin
Self.R34AppBooruChangeMenu.Selected := Ord(Booru);
Case Booru of
TR34AppFreeBooru.rule34xxx: OriginSetMenu.Selected := PROVIDERS.Rule34xxx.Id;
TR34AppFreeBooru.gelboorucom: OriginSetMenu.Selected := PROVIDERS.Gelbooru.Id;
end;
end;

end else if ( Value is TNBoxSearchReqCoomerParty ) then begin
Expand Down Expand Up @@ -1102,7 +1100,6 @@ procedure TNBoxSearchMenu.SetRequest(const value: INBoxSearchRequest);
FapelloSearchTypeMenu.Selected := Ord(RequestKind);

end;

end;

procedure TNBoxSearchMenu.ShowMainMenu;
Expand Down

0 comments on commit 3e5a361

Please sign in to comment.