parent
5f1a6291f7
commit
a45d5cd558
@ -18,6 +18,7 @@ class MetadataResolver implements Resolver
|
|||||||
'~www\.dlsite\.com/.*/work/=/product_id/..\d+(\.html)?~' => DLsiteResolver::class,
|
'~www\.dlsite\.com/.*/work/=/product_id/..\d+(\.html)?~' => DLsiteResolver::class,
|
||||||
'~dlsite\.jp/mawtw/..\d+~' => DLsiteResolver::class,
|
'~dlsite\.jp/mawtw/..\d+~' => DLsiteResolver::class,
|
||||||
'~www\.pixiv\.net/member_illust\.php\?illust_id=\d+~' => PixivResolver::class,
|
'~www\.pixiv\.net/member_illust\.php\?illust_id=\d+~' => PixivResolver::class,
|
||||||
|
'~www\.pixiv\.net/user/\d+/series/\d+~' => PixivResolver::class,
|
||||||
'~fantia\.jp/posts/\d+~' => FantiaResolver::class,
|
'~fantia\.jp/posts/\d+~' => FantiaResolver::class,
|
||||||
'~dmm\.co\.jp/~' => FanzaResolver::class,
|
'~dmm\.co\.jp/~' => FanzaResolver::class,
|
||||||
'~www\.patreon\.com/~' => PatreonResolver::class,
|
'~www\.patreon\.com/~' => PatreonResolver::class,
|
||||||
|
@ -36,6 +36,18 @@ class PixivResolver implements Resolver
|
|||||||
|
|
||||||
public function resolve(string $url): Metadata
|
public function resolve(string $url): Metadata
|
||||||
{
|
{
|
||||||
|
if (preg_match('~www\.pixiv\.net/user/\d+/series/\d+~', $url, $matches)) {
|
||||||
|
$res = $this->client->get($url);
|
||||||
|
if ($res->getStatusCode() === 200) {
|
||||||
|
$metadata = $this->ogpResolver->parse($res->getBody());
|
||||||
|
$metadata->image = $this->proxize($metadata->image);
|
||||||
|
|
||||||
|
return $metadata;
|
||||||
|
} else {
|
||||||
|
throw new \RuntimeException("{$res->getStatusCode()}: $url");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
parse_str(parse_url($url, PHP_URL_QUERY), $params);
|
parse_str(parse_url($url, PHP_URL_QUERY), $params);
|
||||||
$illustId = $params['illust_id'];
|
$illustId = $params['illust_id'];
|
||||||
$page = 0;
|
$page = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user