{"id":13988641,"url":"https://github.com/Staninna/SpotiAFK","last_synced_at":"2025-07-22T09:31:21.139Z","repository":{"id":54749019,"uuid":"425292727","full_name":"Staninna/SpotiAFK","owner":"Staninna","description":"A simple AFK program that plays Spotify when you are not.","archived":false,"fork":false,"pushed_at":"2021-12-15T07:45:13.000Z","size":167,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-29T07:36:49.034Z","etag":null,"topics":["afk","afk-bot","python","spotify"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Staninna.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}},"created_at":"2021-11-06T16:29:16.000Z","updated_at":"2024-05-21T16:00:59.000Z","dependencies_parsed_at":"2022-08-14T01:40:16.024Z","dependency_job_id":null,"html_url":"https://github.com/Staninna/SpotiAFK","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Staninna/SpotiAFK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staninna%2FSpotiAFK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staninna%2FSpotiAFK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staninna%2FSpotiAFK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staninna%2FSpotiAFK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Staninna","download_url":"https://codeload.github.com/Staninna/SpotiAFK/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staninna%2FSpotiAFK/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266465067,"owners_count":23933054,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["afk","afk-bot","python","spotify"],"created_at":"2024-08-09T13:01:16.937Z","updated_at":"2025-07-22T09:31:20.719Z","avatar_url":"https://github.com/Staninna.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# spotiAFK\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003cimg width=\"80%\" src=\"https://i.imgur.com/VTRXwHa.png\"\u003e      \r\n\u003c/div\u003e\r\n\r\n\u003cbr\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003cimg alt=\"GitHub code size\" src=\"https://img.shields.io/github/languages/code-size/staninna/spotiAFK\"\u003e\r\n    \u003cimg alt=\"GitHub Pipenv locked Python version\" src=\"https://img.shields.io/github/pipenv/locked/python-version/Staninna/spotiAFK\"\u003e\r\n    \u003cimg alt=\"Lines of code\" src=\"https://img.shields.io/tokei/lines/github/Staninna/spotiAFK\"\u003e\r\n    \u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/Staninna/spotiAFK\"\u003e\r\n\u003c/div\u003e\r\n\r\n## What is it?\r\n\r\nIt is a simple AFK program that plays Spotify when you are not using your account. To support your favorite artists on the platform.\r\n\r\n## How does it work?\r\n\r\nIt uses the Spotify API to check if you are listening to music and if you don't for a while, it starts playing on a device you specify.\r\n\r\n## Setting it up\r\n\r\n### 1. Configure telegram bot for notifications\r\n\r\n1.  Make the bot\r\n\r\n    1. Open a dm with [BotFather](https://t.me/BotFather) and click on start\r\n\r\n    2. Send a message with the text`/newbot` and follow the instructions\r\n\r\n    3. Send a message with the text `/mybots` and select the bot we just created\r\n\r\n        - Note that if you want to customize your bot, you can do that also here with `Edit Bot`\r\n\r\n    4. Select `API Token` and copy the token and\u003cbr\u003e\r\n       ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️\u003cbr\u003e\r\n       DON'T SHARE THOSE STRINGS WITH ANYONE\u003cbr\u003e\r\n       ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️\r\n\r\n2.  Make `telegram.conf`\r\n\r\n    1. In the terminal run\u003cbr\u003e\r\n       `sudo python3.9 -m telegram-send -c -g`\r\n\r\n    2. Paste your API token you just copied\r\n\r\n    3. Send the password to your telegram bot click first on `start`\r\n\r\n    4. In the terminal run\u003cbr\u003e\r\n       `sudo mv /etc/telegram-send.conf telegram.conf`\r\n\r\n### 2. Configure `option.py`\r\n\r\n`options.py`\r\n\r\n```py\r\n# Playing\r\nSKIP_SONGS = True\r\nSKIP_DELAY = 35\r\nRANDOM_ORDER_TRACKS = True\r\n\r\n# API\r\nCLIENT_ID = \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\r\nCLIENT_SECRET = \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\r\nREDIRECT_URI = \"http://localhost:8888/callback/\"\r\n\r\n# Account\r\nUSERNAME = \"USERNAME\"\r\nPLAYLIST_NAME = \"PLAYLIST\"\r\nSERVER_NAMES = [\"SERVER-1\", \"SERVER-2\", \"SERVER-3\", \"SERVER-4\"]\r\n\r\n# Checks\r\nCHEAKS_BEFORE_PLAYING = 5\r\nTIME_BETWEEN_CHEAKS = 30\r\n\r\n# Errors\r\nRETRY_TIME = 10\r\n\r\n# Notifications\r\nNOTIFICATION_ENABLED = True\r\nNOTIFICATION_FILENAME = \"telegram.conf\"\r\nSTART_PROGRAM_NOTIFICATION = \"Starting program 🏁\"\r\nSTART_PLAYING_NOTIFICATION = \"Started playing 🟩\"\r\nSTOP_PLAYING_NOTIFICATION = \"Stopped playing 🟥\"\r\nSEND_NOTIFICATION_ON_ERROR = True\r\n\r\n# Timelogging\r\nTIMELOG_FILENAME = \"time.txt\"\r\n```\r\n\r\n1.  Playing\r\n\r\n    |                     | Function                                                                | Default | Format               |\r\n    | ------------------- | ----------------------------------------------------------------------- | ------- | -------------------- |\r\n    | SKIP_SONGS          | If the program skips songs or not                                       | True    | True/False           |\r\n    | SKIP_DELAY          | Amount of time in seconds that the program waits before skipping a song | 35      | All numbers above 30 |\r\n    | RANDOM_ORDER_TRACKS | If the program shuffles the playlist                                    | True    | True/False           |\r\n\r\n2.  API\r\n\r\n    1. Get your API tokens\r\n\r\n        1. Go to the [Spotify developer dashboard](https://developer.spotify.com/dashboard/applications)\r\n\r\n        2. Log in with your Spotify account\r\n\r\n        3. Click on `create an app`\r\n\r\n        4. Pick an `app name` and `app description` of your choice and mark the checkboxes\r\n\r\n        5. After creation, you see your `client Id` and you can click on `show client secret` to show your `client secret` and copy them\u003cbr\u003e\r\n           ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️\u003cbr\u003e\r\n           DON'T SHARE THOSE STRINGS WITH ANYONE\u003cbr\u003e\r\n           ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️\r\n\r\n        6. Click on `edit settings` and add your redirection URL by `redirect uris` than click `save`\r\n\r\n    |               | Function                          | Default                         | Format                                           |\r\n    | ------------- | --------------------------------- | ------------------------------- | ------------------------------------------------ |\r\n    | CLIENT_ID     | Spotify application client id     | XXXXX                           | Your client id                                   |\r\n    | CLIENT_SECRET | Spotify application client secret | XXXXX                           | Your client secret                               |\r\n    | REDIRECT_URI  | Your redirect uri                 | http://localhost:8888/callback/ | Your redirect URI you added into the spotify API |\r\n\r\n3.  Account\r\n\r\n    |               | Function                                 | Default                                          | Format                            |\r\n    | ------------- | ---------------------------------------- | ------------------------------------------------ | --------------------------------- |\r\n    | USERNAME      | Your spotify username                    | USERNAME                                         | Your spotify username             |\r\n    | PLAYLIST_NAME | The name of the playlist you want to use | PLAYLIST                                         | Your playlist name                |\r\n    | SERVER_NAMES  | The names of devices you want to use     | [\"SERVER-1\", \"SERVER-2\", \"SERVER-3\", \"SERVER-4\"] | Python list with names of devices |\r\n\r\n4.  Checks\r\n\r\n    |                       | Function                                                           | Default | Format              |\r\n    | --------------------- | ------------------------------------------------------------------ | ------- | ------------------- |\r\n    | CHEAKS_BEFORE_PLAYING | Amount of checks if your account is free to use before playing     | 5       | All numbers above 0 |\r\n    | TIME_BETWEEN_CHEAKS   | Amount of time in seconds between cheaks if account is free to use | 35      | All numbers above 0 |\r\n\r\n5.  Errors\r\n\r\n    |            | Function                                                 | Default | Format              |\r\n    | ---------- | -------------------------------------------------------- | ------- | ------------------- |\r\n    | RETRY_TIME | Amount of time in seconds before retrying after an error | 10      | All numbers above 0 |\r\n\r\n6.  Notifications\r\n\r\n    |                            | Function                                                         | Default             | Format                                |\r\n    | -------------------------- | ---------------------------------------------------------------- | ------------------- | ------------------------------------- |\r\n    | NOTIFICATION_FILENAME      | The name of the notification config file                         | telegram.conf       | Any string preferred with a extension |\r\n    | START_PROGRAM_NOTIFICATION | Text of notification when program starts                         | Starting program 🏁 | Any string                            |\r\n    | START_PLAYING_NOTIFICATION | Text of notification when the music starts playing on the server | Started playing 🟩  | Any string                            |\r\n    | NOTIFICATION_FILENAME      | Text of notification when the music stops playing on the server  | Stopped playing 🟥  | Any string                            |\r\n    | SEND_NOTIFICATION_ON_ERROR | If you want an error notification                                | True                | True/False                            |\r\n\r\n7.  Timelogging\r\n\r\n    |                  | Function                     | Default  | Format                                |\r\n    | ---------------- | ---------------------------- | -------- | ------------------------------------- |\r\n    | TIMELOG_FILENAME | The name of the timelog file | time.txt | Any string preferred with a extension |\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStaninna%2FSpotiAFK","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStaninna%2FSpotiAFK","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStaninna%2FSpotiAFK/lists"}