Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the downloaded video to M4A and save to disk
For the first time, the downloaded video is converted (again) into M4A in order to be able to normalize the audio and adapt the downloaded file for removing the extra streams not needed (video)
- Loading branch information
1 parent
5fd2844
commit 00c7471
Showing
9 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import unittest | ||
import mutagen | ||
|
||
from YouTubeMDBot.downloader import M4AYouTubeDownloader | ||
from YouTubeMDBot.audio import FFmpegM4A | ||
|
||
|
||
class MyTestCase(unittest.TestCase): | ||
def test_download(self): | ||
dl = M4AYouTubeDownloader( | ||
url="https://www.youtube.com/watch?v=s6VaeFCxta8", | ||
bitrate="128k") | ||
io, data = dl.download() | ||
with open("outex.m4a", "wb") as of: | ||
of.write(data) | ||
print(mutagen.File(io).pprint()) | ||
io.seek(0) | ||
return io, data | ||
|
||
def test_normalization(self): | ||
io, data = self.test_download() | ||
ctr = FFmpegM4A(data, "filename") | ||
assert ctr.get_volume() == 0.0 | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |