Handling the case when there is no video yet, locally or online.
This commit is contained in:
@@ -65,10 +65,10 @@ class HtmlParser
|
||||
return $chapters;
|
||||
}
|
||||
|
||||
public function getVideoSource(Response $respose): string
|
||||
public function getVideoSource(Response $respose): ?string
|
||||
{
|
||||
$document = new Document($respose->getBody()->getContents());
|
||||
return $document->first('video source')->getAttribute('src');
|
||||
return $document->first('video source')?->getAttribute('src');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user