{"id":25603261,"url":"https://github.com/toasterofbread/ytm-kt","last_synced_at":"2025-04-13T09:23:05.981Z","repository":{"id":227556323,"uuid":"771753101","full_name":"toasterofbread/ytm-kt","owner":"toasterofbread","description":"A Kotlin Multiplatform library for (unofficially) using the YouTube Music API, optionally with user authentication.","archived":false,"fork":false,"pushed_at":"2024-05-22T17:45:45.000Z","size":305,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-22T18:52:02.013Z","etag":null,"topics":["kotlin","kotlin-library","kotlin-multiplatform","youtube-api","youtube-music"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toasterofbread.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":"2024-03-13T22:14:40.000Z","updated_at":"2024-06-25T18:05:54.740Z","dependencies_parsed_at":"2024-03-30T12:29:40.093Z","dependency_job_id":"13b47122-5dd1-484b-9c27-28262ae5c991","html_url":"https://github.com/toasterofbread/ytm-kt","commit_stats":null,"previous_names":["toasterofbread/ytm-api-kotlin","toasterofbread/ytm-kt"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toasterofbread%2Fytm-kt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toasterofbread%2Fytm-kt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toasterofbread%2Fytm-kt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toasterofbread%2Fytm-kt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toasterofbread","download_url":"https://codeload.github.com/toasterofbread/ytm-kt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248689432,"owners_count":21145933,"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":["kotlin","kotlin-library","kotlin-multiplatform","youtube-api","youtube-music"],"created_at":"2025-02-21T17:25:59.327Z","updated_at":"2025-04-13T09:23:05.951Z","avatar_url":"https://github.com/toasterofbread.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ytm-kt\n\nA Kotlin Multiplatform library for (unofficially) using the YouTube Music API, optionally with user authentication. This library was originally a part of [SpMp](https://github.com/toasterofbread/spmp).\n\n## Setup\n\nytm-kt currently supports the following Kotlin targets:\n  - Android\n  - JVM (Desktop)\n  - Linux x86_64\n  - Linux arm64\n  - Windows x86_64\n  - Wasm\n\n#### Gradle:\n\n1. Add the Maven Central repository to your dependency resolution configuration\n```\nrepositories {\n  mavenCentral()\n}\n```\n\n2. Add the ytm-kt library dependency (replace `\u003cversion\u003e` with the desired ytm-kt [version](https://github.com/toasterofbread/ytm-kt/tags))\n\n```\nimplementation(\"dev.toastbits.ytmkt:ytmkt:\u003cversion\u003e\")\n```\n\n## Usage\n\nAPI endpoints are accessed through the [YtmApi](library/src/commonMain/kotlin/dev/toastbits/ytmkt/model/YtmApi.kt) interface. To use this interface, either implement it yourself or use one of the built-in implementations:\n\n- [YoutubeiApi](library/src/commonMain/kotlin/dev/toastbits/ytmkt/impl/youtubei/YoutubeiApi.kt) - directly accesses YouTube's internal API via https://music.youtube.com/youtubei/v1/.\n- [UnimplementedYtmApi](library/src/commonMain/kotlin/dev/toastbits/ytmkt/impl/unimplemented/UnimplementedYtmApi.kt) - contains dummy implementations of all APIs. Intended to be used as a base for custom API implementations.\n\n### Example usage\n\n```\n// Initialise the Youtubei api implementation\nval api: YtmApi =\n    YoutubeiApi(\n        data_language = \"en-GB\" // The language we want data (such as song names) to be in\n    )\n\n// Download the home page recommendations feed\nval song_feed_result: Result\u003cSongFeedLoadResult\u003e = api.SongFeed.getSongFeed()\n\n// Print feed row titles in our desired language\nfor (layout in song_feed_result.getOrThrow().layouts) {\n  val title_text: String = layout.title.getString(\"en-GB\") // The language we want UI strings to be in\n  println(\"Layout $title_text has ${layout.items.size} items\")\n}\n```\n\n#### See the [sample application](sample/src/commonMain/kotlin/dev/toastbits/sample/Sample.kt) for a more detailed example\n\n## Documentation\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoasterofbread%2Fytm-kt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoasterofbread%2Fytm-kt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoasterofbread%2Fytm-kt/lists"}