-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace glob.glob by pathlib.Path.glob
- Loading branch information
Showing
2 changed files
with
3 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import glob | ||
|
||
from collections.abc import Iterator | ||
from pathlib import Path | ||
|
||
import ffmpeg | ||
|
||
|
||
def files_with_audio(pattern: str = '*.mp4') -> Iterator[str]: | ||
for filename in glob.glob(pattern): | ||
for filename in Path().glob(pattern): | ||
for stream in ffmpeg.probe(filename)['streams']: | ||
if stream['codec_type'] == 'audio': | ||
yield filename |