Skip to content

Commit 1173826

Browse files
committed
(#484) Switch eh api url and use useragent everywhere
1 parent c262a99 commit 1173826

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/LANraragi/Plugin/Metadata/EHentai.pm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ sub get_tags {
101101
$logger->debug("EH API Tokens are $gID / $gToken");
102102
}
103103

104-
my ( $ehtags, $ehtitle ) = &get_tags_from_EH( $gID, $gToken, $jpntitle, $additionaltags );
104+
my ( $ehtags, $ehtitle ) = &get_tags_from_EH( $lrr_info->{user_agent}, $gID, $gToken, $jpntitle, $additionaltags );
105105
my %hashdata = ( tags => $ehtags );
106106

107107
# Add source URL and title if possible/applicable
@@ -226,14 +226,12 @@ sub ehentai_parse() {
226226
return ( $gID, $gToken );
227227
}
228228

229-
# get_tags_from_EH(gID, gToken, jpntitle, additionaltags)
229+
# get_tags_from_EH(userAgent, gID, gToken, jpntitle, additionaltags)
230230
# Executes an e-hentai API request with the given JSON and returns tags and title.
231231
sub get_tags_from_EH {
232232

233-
my ( $gID, $gToken, $jpntitle, $additionaltags ) = @_;
234-
my $uri = 'https://e-hentai.org/api.php';
235-
236-
my $ua = Mojo::UserAgent->new;
233+
my ( $ua, $gID, $gToken, $jpntitle, $additionaltags ) = @_;
234+
my $uri = 'https://api.e-hentai.org/api.php';
237235

238236
my $logger = get_logger( "E-Hentai", "plugins" );
239237

0 commit comments

Comments
 (0)