nijieのview_popup.php URLからもIDが引けるので正規化して対応

This commit is contained in:
shibafu 2018-12-17 23:27:19 +09:00
parent b9e29cc283
commit 911957b283
2 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@ class MetadataResolver implements Resolver
{ {
public $rules = [ public $rules = [
'~(((sp\.)?seiga\.nicovideo\.jp/seiga(/#!)?|nico\.ms))/im~' => NicoSeigaResolver::class, '~(((sp\.)?seiga\.nicovideo\.jp/seiga(/#!)?|nico\.ms))/im~' => NicoSeigaResolver::class,
'~nijie\.info/view\.php~' => NijieResolver::class, '~nijie\.info/view(_popup)?\.php~' => NijieResolver::class,
'~komiflo\.com(/#!)?/comics/(\\d+)~' => KomifloResolver::class, '~komiflo\.com(/#!)?/comics/(\\d+)~' => KomifloResolver::class,
'~www\.melonbooks\.co\.jp/detail/detail\.php~' => MelonbooksResolver::class, '~www\.melonbooks\.co\.jp/detail/detail\.php~' => MelonbooksResolver::class,
'~ec\.toranoana\.jp/tora_r/ec/item/.*~' => ToranoanaResolver::class, '~ec\.toranoana\.jp/tora_r/ec/item/.*~' => ToranoanaResolver::class,

View File

@ -9,6 +9,9 @@ class NijieResolver implements Resolver
if (mb_strpos($url, '//sp.nijie.info') !== false) { if (mb_strpos($url, '//sp.nijie.info') !== false) {
$url = preg_replace('~//sp\.nijie\.info~', '//nijie.info', $url); $url = preg_replace('~//sp\.nijie\.info~', '//nijie.info', $url);
} }
if (mb_strpos($url, 'view_popup.php') !== false) {
$url = preg_replace('~view_popup\.php~', 'view.php', $url);
}
$client = new \GuzzleHttp\Client(); $client = new \GuzzleHttp\Client();
$res = $client->get($url); $res = $client->get($url);