Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Nginx app #2
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
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Nginx app #2
Changes from all commits
db45642116d972c3573fa2dbee95File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
YTAudioConverterAPI
Description
YTAudioConverterAPI is a Flask-based API that allows you to convert YouTube videos into MP3 audio files. It utilizes the pytube, youtubesearchpython,
youtube_dlyt_dlp, and pydub libraries to search for videos, extract audio, and convert it to MP3 format.Installation
git clone <https://github.com/liwa-dev/YTAudioConverterAPI.git>cd YTAudioConverterAPIpip install -r requirements.txt/mp3directory.envfile. WEBHOOK fires when audio extraction complete, API_KEY verified againstx-keyheader in requestNGINX proxy
nginx.confto/sites-availablenginx.confto/sites-enabledwithsudo ln -ssudo systemctl restart nginx.servicesudo certbot --nginxto generate a SSL certificatesudo systemctl reload nginx.service.envfile with your domain in ALLOWED_ORIGINSUsage
python main.py/searchendpoint with theqparameter to search for YouTube videos./downloadendpoint with thevideo_urlparameter andx-keyheader to convert a YouTube video into an MP3 audio file./audios/<filename>/mp3/<filename>endpoint.API Endpoints
/search: Searches for YouTube videos based on the provided query (qparameter)./download: Converts a YouTube video into an MP3 audio file. Requires thevideo_urlparameter./download: Converts a YouTube video into an MP3 audio file. Requires thevideo_urlparameter andx-keyheader with secret from.env./audios/<filename>/mp3/<filename>: Retrieves the converted audio file.SYSTEMD SERVICE
Edit file paths in
yt-rip.serviceand install as systemd service withsudo cp yt-rip.service /etc/systemd/system/yt-rip.service && sudo systemctl daemon-reload && sudo systemctl restart yt-rip.service && sudo systemctl status yt-rip.serviceCOOKIES
Log in to YouTube and save youtube.com cookies using Firefox plugin. Store in cookies.txt in the same directory as main.py https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/
You can also have local
yt-dlpgenerate the cookie file withyt-dlp --cookies-from-browser BROWSER --cookies cookies.txt https://www.youtube.comFor BROWSER use chrome, chromium, firefox, opera, edge, or safari
.env file
Replace example.com with live domain
Contributing
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Uh oh!
There was an error while loading. Please reload this page.