Skip to content

Commit

Permalink
Merge pull request #22 from shannah/master
Browse files Browse the repository at this point in the history
Suppress check for valid audio on URLs to fix 'File not present' erro…
  • Loading branch information
wapmorgan authored Feb 20, 2022
2 parents e24b664 + 45c8e67 commit 752935f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mp3Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ public function __construct($filename, $parseTags = false) {
self::$_sampleRateTable = require dirname(__FILE__).'/../data/sampleRateTable.php';

$this->_fileName = $filename;

if (strpos($filename, '://') !== false) {
$isLocal = (strpos($filename, '://') === false);
if (!$isLocal) {
$this->_fileSize = static::getUrlContentLength($filename);
} else {
if (!file_exists($filename)) {
Expand All @@ -223,13 +223,14 @@ public function __construct($filename, $parseTags = false) {
$this->_fileSize = filesize($filename);
}

if (!static::isValidAudio($filename)) {
if ($isLocal and !static::isValidAudio($filename)) {
throw new \Exception('File ' . $filename . ' is not mpeg/audio!');
}

$mode = $parseTags ? self::META | self::TAGS : self::META;
$this->audioSize = $this->parseAudio($this->_fileName, $this->_fileSize, $mode);
}


/**
* @return bool|null
Expand Down

0 comments on commit 752935f

Please sign in to comment.