From b7eafd881f77864d450216f636dec2431eb24a97 Mon Sep 17 00:00:00 2001 From: eai04191 Date: Thu, 22 Aug 2019 07:28:28 +0900 Subject: [PATCH] =?UTF-8?q?description=E3=81=8C=E5=AD=98=E5=9C=A8=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/MetadataResolver/IwaraResolver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/MetadataResolver/IwaraResolver.php b/app/MetadataResolver/IwaraResolver.php index 736b3ca..a518d24 100644 --- a/app/MetadataResolver/IwaraResolver.php +++ b/app/MetadataResolver/IwaraResolver.php @@ -28,7 +28,10 @@ class IwaraResolver implements Resolver $descriptionElement = $crawler->filter('#video-player + div, .field-name-field-video-url + div, .field-name-field-images + div'); $title = $descriptionElement->filter('h1.title')->text(); $author = $descriptionElement->filter('.username')->text(); - $description = $descriptionElement->children('div')->eq(1)->text(); + $description = ''; + if ($descriptionElement->filter('.field-type-text-with-summary')->count()) { + $description = $descriptionElement->filter('.field-type-text-with-summary')->text(); + } $tags = $descriptionElement->filter('a[href^="/video-categories"], a[href^="/images"]')->extract('_text'); // 役に立たないタグを削除する $tags = array_values(array_diff($tags, ['Uncategorized', 'Other']));