{"id":23163543,"url":"https://github.com/bernhardfritz/pytunes","last_synced_at":"2025-09-04T19:23:32.860Z","repository":{"id":206289615,"uuid":"714811615","full_name":"bernhardfritz/pytunes","owner":"bernhardfritz","description":"🎵 Self-hosted music streaming service","archived":false,"fork":false,"pushed_at":"2023-11-21T22:08:40.000Z","size":43,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-18T03:38:56.677Z","etag":null,"topics":["balena","music","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bernhardfritz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2023-11-05T21:49:27.000Z","updated_at":"2024-10-15T00:30:51.000Z","dependencies_parsed_at":"2023-11-18T21:27:40.065Z","dependency_job_id":"43a2cb27-d336-4fac-8387-62915262c420","html_url":"https://github.com/bernhardfritz/pytunes","commit_stats":null,"previous_names":["bernhardfritz/pytunes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bernhardfritz/pytunes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernhardfritz%2Fpytunes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernhardfritz%2Fpytunes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernhardfritz%2Fpytunes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernhardfritz%2Fpytunes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernhardfritz","download_url":"https://codeload.github.com/bernhardfritz/pytunes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernhardfritz%2Fpytunes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273658965,"owners_count":25145371,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["balena","music","raspberry-pi"],"created_at":"2024-12-18T00:19:24.305Z","updated_at":"2025-09-04T19:23:32.792Z","avatar_url":"https://github.com/bernhardfritz.png","language":"Python","funding_links":[],"categories":["\u003ca name=\"music\"\u003e\u003c/a\u003eSound and music"],"sub_categories":[],"readme":"# pytunes\n\n![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white)\n![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge\u0026logo=fastapi)\n![Nginx](https://img.shields.io/badge/nginx-%23009639.svg?style=for-the-badge\u0026logo=nginx\u0026logoColor=white)\n![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)\n![Raspberry Pi](https://img.shields.io/badge/-RaspberryPi-C51A4A?style=for-the-badge\u0026logo=Raspberry-Pi)\n![Redis](https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge\u0026logo=redis\u0026logoColor=white)\n\n## How does it work?\n\npytunes analyzes [ID3](https://en.wikipedia.org/wiki/ID3) metadata of your MP3 files and generates [M3U](https://en.wikipedia.org/wiki/M3U) playlists so you can stream your music with an [HLS](https://en.wikipedia.org/wiki/HTTP_Live_Streaming)-compatible media player over the internet.\n\n## Instructions\n\n- Set up your Raspberry Pi device with balenaOS in **production mode** and bring it online on the balenaCloud dashboard by following the [getting started guide](https://docs.balena.io/learn/getting-started/).\n- Open a terminal on your local computer and type:\n\n  ```bash\n  # clone repository\n  git clone https://github.com/bernhardfritz/pytunes.git\n\n  # change directory\n  cd pytunes\n\n  # generate database password\n  cp .env.template .env \u0026\u0026 echo \"$(date | md5sum | head -c 32)\" \u003e\u003e .env\n\n  # register first user\n  htpasswd -c .htpasswd \u003cusername\u003e\n\n  # register another user\n  # htpasswd .htpasswd \u003canother username\u003e\n\n  # deploy to balenaCloud\n  balena push \u003cfleet name\u003e\n  ```\n\n- Please be patient. It might take a couple of minutes until deployment is complete.\n- You should see a log line in your balenaCloud dashboard once pytunes has started successfully:\n  ```\n  INFO:     Application startup complete.\n  ```\n- Add your public SSH key to balenaCloud by following the [SSH access guide](https://docs.balena.io/learn/manage/ssh-access/#add-an-ssh-key-to-balenacloud).\n- Determine your `balena-username` by typing:\n  ```bash\n  balena whoami\n  ```\n- Determine your `APP ID` by typing:\n  ```bash\n  balena fleet \u003cfleet name\u003e --fields=id\n  ```\n- Copy an MP3 file from your local computer to your Raspberry Pi (`short-uuid` refers to the first 7 characters of your `BALENA_DEVICE_UUID`):\n  ```bash\n  scp -P 22222 track.mp3 \u003cbalena-username\u003e@\u003cshort-uuid\u003e.local:/var/lib/docker/volumes/\u003cAPP ID\u003e_pytunes-data/_data/\n  ```\n  Alternatively you can also use an SFTP client of your choice like [FileZilla](https://filezilla-project.org/).\n- pytunes will automatically start processing MP3 files as soon as they have been received.\n- You should see a log line in your balenaCloud dashboard once an MP3 file has been processed successfully:\n  ```\n  21:01:35 default: Job OK (a9e5765b-f1f8-4dc6-8ecd-166a2e21f6d1)\n  ```\n- Expose your Raspberry Pi to the internet by switching on [public device URL](https://docs.balena.io/learn/manage/actions/#public-device-url).\n- Install an HLS-compatible media player of your choice like [VLC](https://www.videolan.org/vlc/):\n\n  [![Windows](windows.png)](https://www.videolan.org/vlc/download-windows.html)\n  [![macOS](macos.png)](https://www.videolan.org/vlc/download-macosx.html)\n  [![Linux](linux.png)](https://www.videolan.org/vlc/#download)\n  [![Android](android.png)](https://www.videolan.org/vlc/download-android.html)\n  [![iOS](ios.png)](https://www.videolan.org/vlc/download-ios.html)\n\n- Open network stream in VLC:\n  ```\n  https://\u003cusername\u003e:\u003cpassword\u003e@\u003cBALENA_DEVICE_UUID\u003e.balena-devices.com/\n  ```\n- Enjoy!\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernhardfritz%2Fpytunes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernhardfritz%2Fpytunes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernhardfritz%2Fpytunes/lists"}