File: README.md
π Features
- π§© Plugin powered, supports any platform or custom music service through plugins.
- πΊοΈ Community driven plugins for popular platforms or create your own.
- β¬οΈ Freely downloadable tracks with tagged metadata.
- π₯οΈ π± Cross-platform support.
- πͺΆ Small size & less data usage.
- π Time synced lyrics regardless of the plugin support.
- β No telemetry, diagnostics or user data collection.
- π Native performance.
- π Open source/libre software.
- π Playback control is done locally, not on the server.
π β¬οΈ Installation guide
New versions usually release every 3-4 months.
This handy table lists all the methods you can use to install Spotube:
| Platform | Package/Installation Method |
|---|---|
| Windows | |
| MacOS | |
| Android | |
| iOS | *iPA file only. Requires sideloading with AltStore or similar tools. |
| Flatpak | flatpak install com.github.KRTirtho.Spotube |
| AppImage | AppImage's lacking stability led to it's temporary removal. More information at https://github.com/KRTirtho/spotube/issues/1082 |
| Debian/Ubuntu | Then run: sudo apt install ./Spotube-linux-x86_64.deb |
| Arch/Manjaro | With pamac: sudo pamac install spotube-bin |
With yay: `yay -Sy spotube-bin` || Fedora/OpenSuse | For Fedora: sudo dnf install ./Spotube-linux-x86_64.rpm
For OpenSuse: sudo zypper in ./Spotube-linux-x86_64.rpm |
| Linux (tarball) | |
| Macos - Homebrew | brew tap krtirtho/apps
brew install --cask spotube |
| Windows - Chocolatey | choco install spotube |
| Windows - Scoop | scoop bucket add extras
scoop install spotube |
| Windows - WinGet | winget install --id KRTirtho.Spotube |
π Nightly Builds
Grab the latest nightly builds of Spotube from the GitHub Releases.
π³οΈ Building from source
You can compile Spotube's source code by following these instructions.
π₯ The Spotube team
- Kingkor Roy Tirtho - The Founder, Maintainer and Lead Developer
- Owen Connor - The Cool Discord Moderator
- Piotr Rogowski - The MacOS Developer
- Rusty Apple - The Mysterious Unknown Guy
πΌ License
Spotube is open source and licensed under the BSD-4-Clause License.
If you are curious, you can read the reason of choosing this license.
<h2>`[Click to show]` π Services/Package/Plugin Credits</h2>Services
- Flutter - Flutter transforms the app development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase
- MPV - mpv is a free (as in freedom) media player for the command line. It supports a wide variety of media file formats, audio and video codecs, and subtitle types.
- Musicbrainz - MusicBrainz is a MetaBrainz project that aims to create a collaborative music database that is similar to the freedb project.
- Listenbrainz - ListenBrainz is a open-source project by the MetaBrainz Foundation that allows users to crowdsource and publicly store their digital music listening data.
- Piped - Piped is a privacy friendly alternative YouTube frontend, which is efficient and scalable by design.
- Invidious - Invidious is an open source alternative front-end to YouTube.
- yt-dlp - A feature-rich command-line audio/video downloader.
- NewPipeExtractor - NewPipe's core library for extracting data from streaming sites.
- YouTubeExplodeDart - A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
- LRCLib - A public synced lyric API.
- Linux - Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution
- AUR - AUR stands for Arch User Repository. It is a community-driven repository for Arch-based Linux distributions users
- Flatpak - Flatpak is a utility for software deployment and package management for Linux
- SponsorBlock - SponsorBlock is an open-source crowdsourced browser extension and open API for skipping sponsor segments in YouTube videos.
- Inno Setup - Inno Setup is a free installer for Windows programs by Jordan Russell and Martijn Laan
- F-Droid - F-Droid is an installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform. The client makes it easy to browse, install, and keep track of updates on your device
- LastFM - Last.fm is a music streaming and discovery platform that helps users discover and share new music. It tracks users' music listening habits across many devices and platforms.
Dependencies
- app_links - Android App Links, Deep Links, iOs Universal Links and Custom URL schemes handler for Flutter (desktop included).
- args - Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.
- audio_service - Flutter plugin to play audio in the background while the screen is off.
- audio_service_mpris - audio_service platform interface supporting Media Player Remote Interfacing Specification.
- audio_session - Sets the iOS audio session category and Android audio attributes for your app, and manages your app's audio focus, mixing and ducking behaviour.
- auto_route - AutoRoute is a declarative routing solution, where everything needed for navigation is automatically generated for you.
- auto_size_text - Flutter widget that automatically resizes text to fit perfectly within its bounds.
- bonsoir - A Zeroconf library that allows you to discover network services and to broadcast your own. Based on Apple Bonjour and Android NSD.
- cached_network_image - Flutter library to load and cache network images. Can also be used with placeholder and error widgets.
- connectivity_plus - Flutter plugin for discovering the state of the network (WiFi & mobile/cellular) connectivity on Android and iOS.
- device_info_plus - Flutter plugin providing detailed information about the device (make, model, etc.), and Android or iOS version the app is running on.
- dio - A powerful HTTP networking package,supports Interceptors,Aborting and canceling a request,Custom adapters, Transformers, etc.
- drift - Drift is a reactive library to store relational data in Dart and Flutter applications.
- duration - Utilities to make working with 'Duration's easier. Formats duration in human readable form and also parses duration in human readable form to Dart's Duration.
- encrypt - A set of high-level APIs over PointyCastle for two-way cryptography.
- envied - Explicitly reads environment variables into a dart file from a .env file for more security and faster start up times.
- file_picker - A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support.
- file_selector - Flutter plugin for opening and saving files, or selecting directories, using native file selection UI.
- fluentui_system_icons - Fluent UI System Icons are a collection of familiar, friendly and modern icons from Microsoft.
- flutter_cache_manager - Generic cache manager for flutter. Saves web files on the storages of the device and saves the cache info using sqflite.
- flutter_discord_rpc - Discord RPC support for Flutter desktop platforms
- flutter_displaymode - A Flutter plugin to set display mode (resolution, refresh rate) on Android platform. Allows to enable high refresh rate on supported devices.
- flutter_feather_icons - Feather is a collection of simply beautiful open source icons. Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency and usability.
- flutter_form_builder - This package helps in creation of forms in Flutter by removing the boilerplate code, reusing validation, react to changes, and collect final user input.
- flutter_hooks - A flutter implementation of React hooks. It adds a new kind of widget with enhanced code reuse.
- flutter_inappwebview - A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
- flutter_native_splash - Customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more.
- flutter_riverpod - A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
- flutter_sharing_intent - A flutter plugin that allow flutter apps to receive photos, videos, text, urls or any other file types from another app.
- flutter_undraw - Undraw.co Illustrations for Flutter with customization options
- form_builder_validators - Form Builder Validators set of validators for FlutterFormBuilder. Provides common validators and a way to make your own.
- freezed_annotation - Annotations for the freezed code-generator. This package does nothing without freezed too.
- fuzzywuzzy - An implementation of the popular fuzzywuzzy package in Dart, to suit all your fuzzy string matching/searching needs!
- home_widget - A plugin to provide a common interface for creating HomeScreen Widgets for Android and iOS.
- hooks_riverpod - A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
- html - APIs for parsing and manipulating HTML content outside the browser.
- html_unescape - A small library for un-escaping HTML. Supports all Named Character References, Decimal Character References and Hexadecimal Character References.
- http - A composable, multi-platform, Future-based API for HTTP requests.
- image_picker - Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera.
- intl - Contains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.
- local_notifier - This plugin allows Flutter desktop apps to displaying local notifications.
- logger - Small, easy to use and extensible logger which prints beautiful logs.
- logging - Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger.
- lrc - A Dart-only package that creates, parses, and handles LRC, which is a format that stores song lyrics.
- metadata_god - Plugin for retrieving and writing audio tags/metadata from audio files
- mime - Utilities for handling media (MIME) types, including determining a type from a file extension and file contents.
- open_file - A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html)
- package_info_plus - Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.
- palette_generator - Flutter package for generating palette colors from a source image.
- path - A string-based path manipulation library. All of the path operations you know and love, with solid support for Windows, POSIX (Linux and Mac OS X), and the web.
- path_provider - Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.
- permission_handler - Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
- riverpod - A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
- scroll_to_index - Scroll to a specific child of any scrollable widget in Flutter
- shadcn_flutter - Beautifully designed components from Shadcn/UI is now available for Flutter
- shared_preferences - Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- shelf - A model for web server middleware that encourages composition and easy reuse.
- shelf_router - A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations.
- shelf_web_socket - A shelf handler that wires up a listener for every connection.
- simple_icons - The Simple Icon pack available as Flutter Icons. Provides over 1500 Free SVG icons for popular brands.
- skeletonizer - Converts already built widgets into skeleton loaders with no extra effort.
- sliding_up_panel - A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
- sliver_tools - A set of useful sliver tools that are missing from the flutter framework
- smtc_windows - Windows
SystemMediaTransportControlsimplementation for Flutter giving access to Windows OS Media Control applet. - sqlite3 - Provides lightweight yet convenient bindings to SQLite by using dart:ffi
- sqlite3_flutter_libs - Flutter plugin to include native sqlite3 libraries with your app
- timezone - Time zone database and time zone aware DateTime.
- titlebar_buttons - A package which provides most of the titlebar buttons from windows, linux and macos.
- tray_manager - This plugin allows Flutter desktop apps to defines system tray.
- url_launcher - Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.
- uuid - RFC4122 (v1, v4, v5, v6, v7, v8) UUID Generator and Parser for Dart
- version - Provides a simple class for parsing and comparing semantic versions as defined by http://semver.org/
- very_good_infinite_list - A library for easily displaying paginated data, created by Very Good Ventures. Great for activity feeds, news feeds, and more.
- visibility_detector - A widget that detects the visibility of its child and notifies a callback.
- web_socket_channel - StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API, a cross-platform implementation of that API that communicates over an underlying StreamChannel.
- wikipedia_api - Wikipedia API for dart and flutter
- win32_registry - A package that provides a friendly Dart API for accessing the Windows Registry.
- window_manager - This plugin allows Flutter desktop apps to resizing and repositioning the window.
- youtube_explode_dart - A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
- http_parser - A platform-independent package for parsing and serializing HTTP formats.
- collection - Collections and utilities functions and classes related to collections.
- archive - Provides encoders and decoders for various archive and compression formats such as zip, tar, bzip2, gzip, and zlib.
- hetu_script - Hetu is a lightweight scripting language for embedding in Flutter apps.
- get_it - Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"
- flutter_markdown_plus - A Markdown renderer for Flutter. Create rich text output, including text styles, tables, links, and more, from plain text data formatted with simple Markdown tags.
- pub_semver - Versions and version constraints implementing pub's versioning policy. This is very similar to vanilla semver, with a few corner cases.
- change_case - An extension on String for the missing methods for camelCase, PascalCase, Capital Case, snake_case, param-case, CONSTANT_CASE and others.
- flutter_secure_storage - Flutter Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android.
- build_runner - A build system for Dart code generation and modular compilation.
- envied_generator - Generator for the Envied package. See https://pub.dev/packages/envied.
- flutter_gen_runner - The Flutter code generator for your assets, fonts, colors, β¦ β Get rid of all String-based APIs.
- flutter_launcher_icons - A package which simplifies the task of updating your Flutter app's launcher icon.
- flutter_lints - Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.
- json_serializable - Automatically generate code for converting to and from JSON by annotating Dart classes.
- freezed - Code generation for immutable classes that has a simple syntax/API without compromising on the features.
- process_run - Process run helpers for Linux/Win/Mac and which like feature for finding executables.
- pubspec_parse - Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting.
- pub_api_client - An API Client for Pub to interact with public package information.
- io - Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values.
- drift_dev - Dev-dependency for users of drift. Contains the generator and development tools.
- test - A full featured library for writing and running Dart tests across platforms.
- auto_route_generator - AutoRoute is a declarative routing solution, where everything needed for navigation is automatically generated for you.
- desktop_webview_window - Show a webview window on your flutter desktop application.
- disable_battery_optimization - Flutter plugin to check and disable battery optimizations. Also shows custom steps to disable the optimizations in devices like mi, xiaomi, samsung, oppo, huawei, oneplus etc
- draggable_scrollbar - A scrollbar that can be dragged for quickly navigation through a vertical list. Additional option is showing label next to scrollthumb with information about current item.
- flutter_broadcasts - A plugin for sending and receiving broadcasts with Android intents and iOS notifications.
- scrobblenaut - A deadly simple LastFM API Wrapper for Dart. So deadly simple that it's gonna hit the mark.
- yt_dlp_dart - A starting point for Dart libraries or applications.
- flutter_new_pipe_extractor - NewPipeExtractor binding for Flutter (Android only)
- hetu_std - A sample command-line application.
- hetu_otp_util - A sample command-line application.
- hetu_spotube_plugin - A new Flutter package project.
- media_kit - A cross-platform video player & audio player for Flutter & Dart. Performant, stable, feature-proof & modular.
- media_kit_libs_audio - package:media_kit audio (only) playback native libraries for all platforms.
File: cli/README.md
Spotube Configuration CLI
This is used for building the project for multiple platforms and having utilities specific for the project.
Written in Dart
File: ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with open ios/Runner.xcworkspace, selecting Runner/Assets.xcassets in the Project Navigator and dropping in the desired images.
File: website/src/content/docs/reference/libraries.mdx
layout: "layouts/DocLayout.astro" title: Libraries order: 1
- [
hetu_std][hetu_std] (built-in) - A standard library for hetu_script that provides standard set of functions and utilities. - [
hetu_spotube_plugin][hetu_spotube_plugin] (built-in) - Access to Spotube Plugin API, which provides functions to interact with Spotube. - [
hetu_otp_util][hetu_otp_util] - A pure hetu_script library for OTP utilities, such as generating and verifying OTPs.
{/* Links */}
[hetu_std]: https://github.com/hetu-community/hetu_std
[hetu_spotube_plugin]: https://github.com/KRTirtho/hetu_spotube_plugin
[hetu_otp_util]: https://github.com/hetu-community/hetu_otp_util
File: website/src/content/docs/reference/models.mdx
layout: "layouts/DocLayout.astro" title: Plugin Models order: 0
Image
Following is the structure of the SpotubeImageObject:
| Property | Type |
|---|---|
| width | int or null |
| height | int or null |
| url | string |
User
Structure of the SpotubeUserObject, which is used to represent a user in Spotube returned by Spotube Plugins.
| Property | Type |
|---|---|
| id | string |
| name | string |
| externalUri | string |
| images | List of SpotubeImageObject |
externalUriis a URL that points to the user's profile on the external service (e.g. Listenbrainz)
Artist
SpotubeSimpleArtistObject
Following is the structure of the SpotubeArtistObject:
| Property | Type |
|---|---|
| id | string |
| name | string |
| externalUri | string |
| images | List of SpotubeImageObject or null |
SpotubeFullArtistObject
Following is the structure of the SpotubeFullArtistObject:
| Property | Type |
|---|---|
| id | string |
| name | string |
| externalUri | string |
| images | List of SpotubeImageObject or |
| followers | number |
| genres | List of string or null |
Album
SpotubeSimpleAlbumObject
Following is the structure of the SpotubeAlbumObject:
| Property | Type |
|---|---|
| id | string |
| name | string |
| externalUri | string |
| images | List of SpotubeImageObject |
| albumType | album, single or compilation |
| artists | List of SpotubeSimpleArtistObject |
| releaseDate | string (YYYY-MM-DD format) or null |
SpotubeFullAlbumObject
Following is the structure of the SpotubeFullAlbumObject:
| Property | Type |
|---|---|
| id | string |
| name | string |
| externalUri | string |
| images | List of SpotubeImageObject |
| albumType | album, single or compilation |
| artists | List of SpotubeSimpleArtistObject |
| releaseDate | string (YYYY-MM-DD format) |
| totalTracks | number |
| recordLabel | string or null |
Track
Following is the structure of the SpotubeFullTrackObject:
| Property | Type |
|---|---|
| id | string |
| name | string |
| externalUri | string |
| artists | List of SpotubeSimpleArtistObject |
| album | SpotubeSimpleAlbumObject |
| durationMs (in milliseconds) | number |
| explicit | boolean |
| isrc | string |
isrcstands for International Standard Recording Code, which is a unique identifier for tracks.
It is used to identify recordings and is often used in music distribution and royalty collection. The format is typically a 12-character alphanumeric code.
Playlist
SpotubeSimplePlaylistObject
Following is the structure of the SpotubeSimplePlaylistObject:
| Property | Type |
|---|---|
| id | string |
| name | string |
| description | string |
| externalUri | string |
| images | List of SpotubeImageObject or null |
| owner | SpotubeUserObject |
SpotubeFullPlaylistObject
Following is the structure of the SpotubeFullPlaylistObject:
| Property | Type |
|---|---|
| id | string |
| name | string |
| description | string |
| externalUri | string |
| images | List of SpotubeImageObject or null |
| owner | SpotubeUserObject |
| collaborators | List of SpotubeUserObject or null |
| collaborative | boolean |
| public | boolean |
Search Response
Following is the structure of the SpotubeSearchResponseObject:
| Property | Type |
|---|---|
| albums | List of SpotubeSimpleAlbumObject |
| artists | List of SpotubeFullArtistObject |
| playlists | List of SpotubeSimplePlaylistObject |
| tracks | List of SpotubeFullTrackObject |
Browse Section
Following is the structure of SpotubeBrowseSectionObject:
| Property | Type |
|---|---|
| id | string |
| title | string |
| externalUri | string |
| browseMore | boolean |
| items | List of Object |
The items property array can contain multiple type of Object in it but it will always be
Pagination Response
SpotubePaginationResponseObject is generic model. The items property can contain any type of Object in it.
This is the structure of SpotubePaginationResponseObject:
| Property | Type |
|---|---|
| limit | number |
| nextOffset | number or null |
| total | number |
| hasMore | boolean |
| items | List of generic type T which extends Object |
File: website/src/content/docs/plugin-apis/forms.mdx
layout: "layouts/DocLayout.astro" title: Forms order: 1
Spotube provides a Forms API that allows plugin developers to create and manage forms within the Spotube application.
Usage
Following will show a form with 2 text fields and text in between them:
import "module:spotube_plugin" as spotube
spotube.SpotubeForm.show(
"The form page title",
[
{
objectType: "input",
id: "name",
variant: "text",
placeholder: "Enter your name",
required: true,
}.toJson(),
{
objectType: "input",
id: "password",
variant: "password", // This will obfuscate the input
placeholder: "Enter your password",
required: true,
}.toJson(),
{
objectType: "text",
text: "This is some text after the two fields.",
}.toJson(),
]
).then((result) {
// Handle the result
print(result)
})The method spotube.SpotubeForm.show takes a title and a list of form field declaration map. The map should be, well obviously a Map.
Following are field map properties:
| Property | Type | Description |
|---|---|---|
objectType |
text or input |
Type of the object, should be text for text fields and input for input fields. |
id |
String |
Unique identifier for the field. (input type only) |
variant |
String |
Variant of the field, can be text, password or number. (input type only) |
placeholder |
String |
Optional placeholder text for the field. (input type only) |
required |
Boolean |
Whether the field is required or not. (input type only) |
defaultValue |
String |
Optional default value for the field. (input type only) |
regex |
String |
Optional regex pattern to validate the input. (input type only) |
text |
String |
Optional text for text object type. (Only applicable for text type) |
The method spotube.SpotubeForm.show returns a following format:
[
{
"id": "name",
"value": "John Doe"
},
{
"id": "password",
"value": "12345678"
}
]File: website/src/content/docs/plugin-apis/localstorage.mdx
layout: "layouts/DocLayout.astro" title: LocalStorage order: 2
The LocalStorage API is a plain text key/value holding persistent storage for spotube plugins. It's similar to the localStorage API in web browsers.
The API is a 1:1 port of [shared_preferences][shared_preferences] package from pub.dev (Flutter package registry)
The only difference is that the LocalStorage API is 100% asynchronous. So every method returns a Future
Usage
Get values
Retrieve stored information by key:
import "module:spotube_plugin" as spotube
var LocalStorage = spotube.LocalStorage
// Get a string value by key
LocalStorage.getString("key").then((value) {
print("Value for 'key': $value")
})
// Get an integer value by key
LocalStorage.getInt("key").then((value) {
print("Value for 'key': $value")
})
// Get a double value by key
LocalStorage.getDouble("key").then((value) {
print("Value for 'key': $value")
})
// Get a boolean value by key
LocalStorage.getBool("key").then((value) {
print("Value for 'key': $value")
})
// Get a list of strings by key
LocalStorage.getStringList("key").then((value) {
for (var item in value) {
print("Item in list: $item")
}
})Set values
To set or store data in the local storage, you can use the following methods:
// Set a string value by key
LocalStorage.setString("key", "value")
// Set an integer value by key
LocalStorage.setInt("key", 42)
// Set a double value by key
LocalStorage.setDouble("key", 3.14)
// Set a boolean value by key
LocalStorage.setBool("key", true)
// Set a list of strings by key
LocalStorage.setStringList("key", ["item1", "item2", "item3"])Key operations
To remove a value from the local storage, you can use the remove method:
// Remove a value by key
LocalStorage.remove("key")To clear all values from the local storage, you can use the clear method:
// Clear all values from local storage
LocalStorage.clear()To check if a key exists in the local storage, you can use the containsKey method:
// Check if a key exists
LocalStorage.containsKey("key").then((exists) {
if (exists) {
print("Key 'key' exists in local storage")
} else {
print("Key 'key' does not exist in local storage")
}
}){/* Links */}
[shared_preferences]: https://pub.dev/packages/shared_preferences
File: website/src/content/docs/plugin-apis/timezone.mdx
layout: "layouts/DocLayout.astro" title: TimeZone order: 3
The TimeZone API provides access to the current time zone of the device running Spotube. This can be useful for plugins that need to display
or handle time-related information based on the user's local time zone.
Usage
To use the TimeZone API, you can import the spotube_plugin module and access the TimeZone class.
import "module:spotube_plugin" as spotube
var TimeZone = spotube.TimeZoneTo get current local time zone for the device, you can use the getLocalTimeZone method:
TimeZone.getLocalTimeZone().then((timeZone) {
print("Current local time zone: $timeZone") // e.g., "America/New_York"
})To get all available time zones, you can use the getAvailableTimeZones method:
TimeZone.getAvailableTimeZones().then((timeZones) {
for (var tz in timeZones) {
print("Available time zone: $tz") // e.g., "America/New_York", "Europe/London", etc.
}
})File: website/src/content/docs/plugin-apis/webview.mdx
layout: "layouts/DocLayout.astro" title: WebView order: 0
The [hetu_spotube_plugin][hetu_spotube_plugin] is a built-in module that plugin developers can use in their plugins.
import "module:spotube_plugin" as spotubeWebView API
The WebView API allows plugins to create and manage web views within the Spotube application.
Usage
First, an WebView instance needs to be created with uri.
import "module:spotube_plugin" as spotube
let webview = spotube.Webview(uri: "https://example.com")To open the webview, you can use the open method:
webview.open() // returns Future<void>To close the webview, you can use the close method:
webview.close() // returns Future<void>Listening to URL changes
You can listen to url change events by using the onUrlRequestStream method. It's emitted when the URL of the webview changes,
such as when the user navigates to a different page or clicks a link.
// Make sure to import the hetu_std and Stream
import "module:hetu_std" as std
var Stream = std.Stream
// ... created webview instance and other stuff
var subscription = webview.onUrlRequestStream().listen((url) {
// Handle the URL change
print("URL changed to: $url")
})
// Don't forget to cancel the subscription when it's no longer needed
subscription.cancel()Retrieving cookies
To get cookies from the webview, you can use the getCookies method:
webview.getCookies("https://example.com") // returns Future<List<Cookie>>You can find the [Cookie class][spotube_plugin_cookie] and all it's methods and properties in thehetu_spotube_plugin module source code
{/* Links */}
[hetu_spotube_plugin]: https://github.com/KRTirtho/hetu_spotube_plugin
[spotube_plugin_cookie]: https://github.com/KRTirtho/hetu_spotube_plugin/blob/main/lib/assets/hetu/webview.ht
File: website/src/content/docs/get-started/installing-plugins.mdx
layout: "layouts/DocLayout.astro" title: Installing plugins order: 1
Let's first learn how to install plugins in Spotube. It's pretty simple.
- Open Spotube (duh!)
- Go to Settings
- Then go to the top option, "Metadata provider plugins"
- You can see a list of all the plugins that are available to install
More ways to install new plugins
Usually, Spotube will list public repositories of plugins from github and codeberg in the Available plugins section.
This is a non curated list, so be careful when installing plugins. Always check the source before installing.
A malicious plugin given full access can easily steal your credentials. So be careful!
Try to use the Official tagged plugins all the time if you don't want to deal with potential security risks.
- Upload plugin from local file: You can also install plugins from local file (plugin.smplug) using the Orange Upload button on the top right beside the text field.
- Install plugin from URL: If you have a direct link to a plugin file, you can just paste the URL in the text field and use the gray download button beside it
If you're a developer, you can create your own plugins and share them with the community. Check out the Plugin Development Guide for more information.