Merge pull request #530 from arabcoders/dev
Ignore image based subtitles in playlist manifest.
This commit is contained in:
@@ -72,7 +72,7 @@ readonly class Playlist
|
||||
foreach (findSideCarFiles(new SplFileInfo($path)) as $sideFile) {
|
||||
$extension = getExtension($sideFile);
|
||||
|
||||
if (false === in_array($extension, self::ALLOWED_SUBS)) {
|
||||
if (false === in_array($extension, array_keys(Subtitle::FORMATS))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -164,6 +164,10 @@ readonly class Playlist
|
||||
continue;
|
||||
}
|
||||
|
||||
if (false === in_array(ag($x, 'codec_name'), Subtitle::INTERNAL_NAMING)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$lang = ag($x, 'tags.language', 'und');
|
||||
$title = ag($x, 'tags.title', 'Unknown');
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ use Throwable;
|
||||
|
||||
final readonly class Subtitle
|
||||
{
|
||||
private const array FORMATS = [
|
||||
public const array FORMATS = [
|
||||
'vtt' => 'text/vtt',
|
||||
'webvtt' => 'text/vtt',
|
||||
'srt' => 'text/srt',
|
||||
'ass' => 'text/ass',
|
||||
];
|
||||
|
||||
private const array INTERNAL_NAMING = [
|
||||
public const array INTERNAL_NAMING = [
|
||||
'subrip',
|
||||
'ass',
|
||||
'vtt'
|
||||
|
||||
Reference in New Issue
Block a user