{"id":13827462,"url":"https://github.com/kernoeb/Telegramusic","last_synced_at":"2025-07-09T04:32:00.478Z","repository":{"id":41859916,"uuid":"298990419","full_name":"kernoeb/Telegramusic","owner":"kernoeb","description":"Python Telegram Bot to download music from Deezer and YouTube (Docker, Heroku)","archived":false,"fork":false,"pushed_at":"2025-07-08T17:50:45.000Z","size":140,"stargazers_count":86,"open_issues_count":0,"forks_count":54,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-08T18:57:51.848Z","etag":null,"topics":["bot","deezer","deezer-api","docker","flac","heroku","mp3","python","python3","soundcloud","telegram","telegram-bot","youtube","youtube-dl","zip"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kernoeb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":["kernoeb"],"ko_fi":"kernoeb"}},"created_at":"2020-09-27T08:46:52.000Z","updated_at":"2025-07-08T17:50:49.000Z","dependencies_parsed_at":"2024-04-25T23:58:38.178Z","dependency_job_id":"ce8844d9-4a34-459b-895c-19e845227783","html_url":"https://github.com/kernoeb/Telegramusic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kernoeb/Telegramusic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernoeb%2FTelegramusic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernoeb%2FTelegramusic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernoeb%2FTelegramusic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernoeb%2FTelegramusic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kernoeb","download_url":"https://codeload.github.com/kernoeb/Telegramusic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernoeb%2FTelegramusic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264393674,"owners_count":23601143,"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":["bot","deezer","deezer-api","docker","flac","heroku","mp3","python","python3","soundcloud","telegram","telegram-bot","youtube","youtube-dl","zip"],"created_at":"2024-08-04T09:01:58.088Z","updated_at":"2025-07-09T04:32:00.472Z","avatar_url":"https://github.com/kernoeb.png","language":"Python","funding_links":["https://github.com/sponsors/kernoeb","https://ko-fi.com/kernoeb"],"categories":["Python"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  Telegramusic\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eA Telegram bot to download music from Deezer, YouTube and SoundCloud\u003c/h4\u003e\n\n## Disclaimer\n\n:warning: For educational purposes only (or for free music)\nPlease don't use this for illegal stuff.\nIt's **against Deezer's terms of service**.\n\n## Translations\n\nYour native language is not in the `langs.json` file ? Just make a pull request or send me a message !\n\n## Usage\n\n- Get an `arl` cookie on Deezer for `DEEZER_TOKEN` (\n  see [this repo](https://github.com/nathom/streamrip/wiki/Finding-Your-Deezer-ARL-Cookie))\n- Create a bot on Telegram and grab a token with [Bot Father](https://t.me/botfather) (`TELEGRAM_TOKEN`)\n- Activate `Inline Mode` on BotFather for the bot you just created\n\n---\n\nSearch for music in `inline mode` :\n\n```\n@xxxxxxx_bot (album|track) \u003csearch\u003e\n```\n\n![image](https://user-images.githubusercontent.com/24623168/141982877-ca7589d4-fe47-4b5a-b751-6d945c21f944.png)\n\n![image](https://user-images.githubusercontent.com/24623168/141983477-b7692d78-134a-4176-98ba-d6388ac4b80b.png)\n\n## or send a Deezer / YouTube / SoundCloud link\n\n## Configuration\n\n### Docker\n\n#### Prerequisites\n\n- Docker ([Linux installation](https://docs.docker.com/engine/install/ubuntu/)\n  and [Linux post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/))\n- Docker compose (should be included in the Docker installation)\n\nCreate a `token.env` file with the following content, replacing the values with your own tokens :\n\n```\nDEEZER_TOKEN=abcdefghijklmnoxxxxxxxxxxxx\nTELEGRAM_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ\nBOT_LANG=fr\n```\n\n#### Run\n\n```bash\n./update.sh\n```\n\n\u003e Or manually : `git pull \u0026\u0026 docker-compose up -d --build`\n\n### Local usage\n\n- Add `DEEZER_TOKEN` and `TELEGRAM_TOKEN` as variable environment\n- python3.13 -m pip install -r requirements.txt\n- python3.13 main.py\n\n\u003e You should use a `venv` to avoid conflicts with your system python packages\n\n### Compressed files (zip)\n\nYou can send a zip file with multiple tracks inside, the bot will send you a zip file with all the tracks downloaded and\nthe cover.\n\nIn the `token.env` file, add the following line :\n\n```\nFORMAT=zip\n```\n\nIf the `zip` file is too big (more than 50MB), the bot will split the zip file into multiple parts.\n\n### Download URL\n\nYou can also make the bot move a file to a specific directory and send you the download link.\n\nIn the `token.env` file, add the following line :\n\n```\nFORMAT=zip\nCOPY_FILES_PATH=/path/to/your/directory\nFILE_LINK_TEMPLATE=https://yourdomain.com/download/{0}\n```\n\nThe `{0}` will be replaced by the file name.\n\nI recommend using a reverse proxy to serve the files, like Nginx or Caddy.\n\nIf you use `Docker`, you can mount a volume to the container and set the `COPY_FILES_PATH` to `/files`, like this :\n\n```yaml\nvolumes:\n  - /path/to/your/directory:/files\n```\n\n### Allow FLAC format\n\nIf you have Deezer premium, you can allow the bot to download FLAC files by adding the following line in the `token.env`\nfile :\n\n```\nENABLE_FLAC=1\n```\n\n### Do not send album art\n\nThe default behavior is to send album cover and liks to the album and song. If you do not want to send it, set the `SEND_ALBUM_COVER` to `true`.\n\n```\nSEND_ALBUM_COVER=true\n```\n\n### Troubleshooting\n\n\u003e \"Sign in to confirm you’re not a bot. This helps protect our community. Learn more.\"\n\u003e Please note that your account may be banned if you use this feature.\n\nAdd a `cookies.txt` in `./local_resources`.\nTo generate this file, please see : \u003chttps://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp\u003e.\n\nYou don't need to restart the bot, it will automatically reload the cookies when downloading a YouTube video.\n\n### Example configuration\n\n```dotenv\n# Global configuration\nBOT_LANG=en\n\n# Tokens\nDEEZER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nTELEGRAM_TOKEN=1234567890:ABCDEFghijklmnopqrstuvwxyz012345678\n\n# Specific configuration\nCOPY_FILES_PATH=/files\nFILE_LINK_TEMPLATE=https://example.com/dl/{0}\nFORMAT=zip\n```\n\n### Debugging\n\n\u003e docker logs telegramusic 2\u003e/dev/null | grep \"USER_DEBUG\"\n\n```bash\ngrep \"USER_DEBUG\"                     # All user activities\ngrep \"USER_DEBUG.*user_id=123456789\"  # Activities for specific user ID\ngrep \"USER_DEBUG.*username=john\"      # Activities for specific username\ngrep \"USER_DEBUG.*Error\"              # All user-related errors\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernoeb%2FTelegramusic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkernoeb%2FTelegramusic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernoeb%2FTelegramusic/lists"}