{"id":20459198,"url":"https://github.com/codingstark-dev/videotomp3","last_synced_at":"2025-12-04T01:08:07.344Z","repository":{"id":234947066,"uuid":"623984778","full_name":"codingstark-dev/videotomp3","owner":"codingstark-dev","description":"Convert any video url to an MP3 file using Python and Flask","archived":false,"fork":false,"pushed_at":"2023-04-05T18:34:54.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T00:22:47.857Z","etag":null,"topics":["convert","flask","python","videotomp3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codingstark-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-05T13:56:55.000Z","updated_at":"2023-09-10T19:15:00.000Z","dependencies_parsed_at":"2024-05-07T11:30:46.740Z","dependency_job_id":null,"html_url":"https://github.com/codingstark-dev/videotomp3","commit_stats":null,"previous_names":["codingstark-dev/videotomp3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingstark-dev%2Fvideotomp3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingstark-dev%2Fvideotomp3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingstark-dev%2Fvideotomp3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingstark-dev%2Fvideotomp3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codingstark-dev","download_url":"https://codeload.github.com/codingstark-dev/videotomp3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242014690,"owners_count":20057877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["convert","flask","python","videotomp3"],"created_at":"2024-11-15T12:15:25.026Z","updated_at":"2025-12-04T01:08:02.323Z","avatar_url":"https://github.com/codingstark-dev.png","language":"Python","readme":"## Convert any video url to an MP3 file using Python and Flask\n\n```bash\ngit clone https://github.com/codingstark-dev/videotomp3.git\n```\n\nThe endpoint uses the moviepy library to extract the audio from the video at the provided URL, saves it as an MP3 file, reads the file as bytes, removes the file, and returns the bytes as a response with the MIME type audio/mpeg.\n\n![image](ss.jpg)\n\nHere is a breakdown of the code:\n\n```python\nfrom flask import Flask, request, Response\nimport moviepy.editor as mp\nimport io\nimport os\n\napp = Flask(__name__)\n\n@app.route('/convert', methods=['GET'])\ndef convert():\n    video_url = request.args.get('url')\n    # video_url = request.query_string['video_url']\n    video = mp.VideoFileClip(video_url)\n    audio = video.audio\n    audio_path = os.path.join(os.getcwd(), 'audio.mp3')\n    audio.write_audiofile(audio_path)\n    with open(audio_path, 'rb') as f:\n        audio_bytes = f.read()\n    os.remove(audio_path)\n    return Response(audio_bytes, mimetype=\"audio/mpeg\")\n\nif __name__ == '__main__':\n    app.run()\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingstark-dev%2Fvideotomp3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodingstark-dev%2Fvideotomp3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingstark-dev%2Fvideotomp3/lists"}