Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add internal MP3 converter feature #1

Merged
merged 9 commits into from
Nov 12, 2023

Conversation

mitsuki31
Copy link
Owner

@mitsuki31 mitsuki31 commented Nov 12, 2023

Changes Made

  • Refactor Main Entry File

    • Implemented immediate MP3 conversion after audio download.
    • Refactored the creation of output file paths.
    • Added the await operator to the ytdl.downloadFromInfo function call.
    • Implemented a replacer to replace illegal characters in output file names with underscores.
    • Modified output file naming to exclude author names, preventing long filenames.
  • Initialize acodecs-cvt File

    • Added a new file for audio codecs converter called acodecs-cvt.
    • Declared a new function called convertToMp3 that converts any audio codecs to MP3 codec.
    • Declared a new object representing options for MP3 conversion, named optionsMp3.
  • Maintanances

    • Enabled the strict mode for all modules.
  • Dependencies

    • Added fluent-ffmpeg dependency (production).
All commits
  • 38c726f - Refactor the main entry file
  • ec85003 - Define the exports in acodecs-cvt module
  • 631eb29 - Implement the body function of MP3 converter
  • f8c42c2 - Define the options for MP3 format
  • e571a18 - Add replacer to replace illegal characters
  • 8bf2b7f - Exclude the author name from output file names
  • 50f9491 - Initial a new file for audio converter
  • f68b626 - Enable the strict mode in index.js
  • ae1c139 - Add fluent-ffmpeg dependency

❗ Disadvantages

Concurrent execution is a significant disadvantage when doing audio conversion with numerous processes. Concurrent process execution may result in the collision of progression percentages, thereby causing confusion and mistakes in tracking the individual progress of each process. This lack of synchronization in progress reporting might lead to a less intuitive user experience and make determining the real-time state of each conversion process difficult. To minimize this disadvantage, a synchronized approach to progress reporting might be considered.


Summary

This pull request introduces several enhancements and a new feature to convert the downloaded audio to MP3 codec. It includes refactoring, the addition of functionalities, and the introduction of a new module for audio codecs conversion (acodecs-cvt).

Preventing long file names, and video musics in YouTube almost has
the author name within their title videos.
Now the output file names will not have any illegal characters
anymore and prevent errors during I/O processes. The illegal
character will be replaced by an underscore character ('_').
* Declared the abstract function of the MP3 converter
* Imported several required modules
* Now the audio file will be converted to MP3 immediately after
  being downloaded.
* Refactored the output file path creation
* Added `await` operator on call of function `ytdl.downloadFromInfo`.
@mitsuki31 mitsuki31 added the refactor Refactor and enhancement changes label Nov 12, 2023
@mitsuki31 mitsuki31 self-assigned this Nov 12, 2023
@mitsuki31 mitsuki31 merged commit 9cb5943 into master Nov 12, 2023
@mitsuki31 mitsuki31 deleted the feature/add-internal-converter branch November 12, 2023 03:34
@mitsuki31 mitsuki31 added the feature Bring new features label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Bring new features refactor Refactor and enhancement changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant