Skip to content

Telegram plugin for Rhythmbox: Listen and download music from Telegram directly within Rhythmbox

License

Notifications You must be signed in to change notification settings

mervick/rhythmbox-telegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rhythmbox Telegram Music Plugin

Rhythmbox-Telegram is a plugin for Rhythmbox that allows you to listen to and download music from Telegram directly within Rhythmbox.

Telegram playlist in Rhythmbox More screenshots here

Key Features

  • Telegram Integration: Easily add Telegram channels and chats to Rhythmbox as playlists, consolidating your digital communication and music browsing in one convenient interface.

  • Browse Audio Files: Effortlessly browse through audio files shared in Telegram directly from within Rhythmbox, ensuring quick access to your desired tracks.

  • Listen to Music: Seamlessly stream audio content from Telegram through Rhythmbox, enabling uninterrupted music playback without the need to switch between applications.

  • Download to Library: Download audio files from Telegram directly to your Rhythmbox library, expanding your music collection with the content you enjoy.

With Rhythmbox-Telegram, enjoy the convenience of accessing your favorite Telegram audio content alongside your music library, revolutionizing the way you interact with both your digital communication platforms and your music collection.

Installation

To enable plugin, you need first install python-telegram - Telegram library for python backed by the official Telegram client - TDLib

pip3 install python-telegram==0.18.0

Next, if Rhythmbox player is open, please close it, then proceed to download the plugin from the repository and move it to the Rhythmbox plugins folder, and compile glib schemas

git clone https://github.com/mervick/rhythmbox-telegram ~/.local/share/rhythmbox/plugins/rhythmbox-telegram
glib-compile-schemas ~/.local/share/rhythmbox/plugins/rhythmbox-telegram

Activation

After installing the plugin, you need to:

  • Activate it in the Rhythmbox settings
  • Obtain a Telegram API ID
  • Authenticate the Telegram user

Obtaining Telegram API ID

In order to obtain an API id you need to do the following:

More detailed instructions can be found in the Telegram documentation

Authorization

After obtaining the API ID, in the plugin settings, input the received api_id and api_hash, along with your Telegram user's phone number. Then, press the 'Connect' button. Telegram will send you a code for authorization to any connected Telegram app.

Adding your music to Rhythmbox

After successfully connecting Telegram to Rhythmbox, in the plugin settings, you'll be able to add Telegram channels, groups and chats to listen to your favorite music.

Telegram API Usage and Operations

The plugin uses the Telegram API strictly for reading purposes. No write operations are performed.

The following actions are carried out:

  • Authorization process
  • Retrieving the contact list (necessary to fetch groups and channels)
  • Iterating over all messages in groups and channels selected as "Music Sources" in the plugin settings (only audio files are searched; messages and audio messages are ignored)
  • Downloading of audio files
  • Getting a public link to a message with an audio file

No other operations are conducted.

TDLib API Methods and Handlers Used

The plugin uses only the following methods and handlers:

  • setTdlibParameters
  • checkDatabaseEncryptionKey
  • getAuthorizationState
  • setAuthenticationPhoneNumber
  • checkAuthenticationPassword
  • checkAuthenticationCode
  • loadChats
  • getChats
  • getChat
  • getMessage
  • getChatHistory
  • downloadFile
  • getMessageLink
  • updateAuthorizationState
  • updateNewChat

Caching and Audio File Retrieval

The plugin caches information about retrieved audio files. The audio file list is initially fetched in small batches to stay within API quota limits. If the initial retrieval is incomplete, remaining tracks will be loaded later. The plugin automatically fetches new files and continues to load any remaining tracks with intervals of 5-10 minutes, both during initialization and while retrieving new content. This approach ensures efficient, quota-compliant, and timely updates of new content.

Data Encryption and Storage

We strive to protect your data by implementing various security measures:

Authentication Data

Authentication data is encrypted and stored within the GNOME Keyring. This ensures that sensitive information is securely protected within the GNOME environment, providing an additional layer of security against unauthorized access.

Data from Telegram

Data obtained from Telegram is encrypted using a user-provided encryption key and managed by the official Telegram client, TDLib.
The encrypted databases are stored at: ~/.local/share/rhythmbox/telegram/*/database

Temporary Audio Files

Temporary audio files are stored at ~/.local/share/rhythmbox/telegram/*/files/music
You can delete these files at any time. However, please note that deleting these files manually will not remove their entries from the database. For safe removal, you can delete audio files through the plugin settings, ensuring the database integrity is maintained.

Additional Data Storage

Audio Metadata: We store metadata of audio files in an unencrypted format. This includes data obtained from Telegram, such as the chat identifier, message identifier within the chat, publication date and time, file size, file name, audio tags and the file's location in the file system.

Chat Information: We store information about your chats, including chat names and identifiers, in an encrypted format to ensure privacy and security.

This data is stored within the database at: ~/.local/share/rhythmbox/telegram/*/data.sqlite

License

Rhythmbox-Telegram is an open-source plugin distributed under the GPL-3 license, ensuring that it remains freely accessible to all users and encouraging community collaboration and contribution.

Contribute

If you like our plugin you can support the ongoing development and maintenance of Rhythmbox-Telegram by spreading the word about the plugin or making contributions via PayPal or cryptocurrency donations, ensuring its continued improvement and availability for the community.

About

Telegram plugin for Rhythmbox: Listen and download music from Telegram directly within Rhythmbox

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published