Skip to content

codydafoxie/Syncram

Repository files navigation

      ,gg,                                                                                
     i8""8i                                                                               
     `8,,8'                                                                               
      `88'                                                                                
      dP"8,                                                                               
     dP' `8a  gg     gg   ,ggg,,ggg,     ,gggg,   ,gggggg,    ,gggg,gg   ,ggg,,ggg,,ggg,  
    dP'   `Yb I8     8I  ,8" "8P" "8,   dP"  "Yb  dP""""8I   dP"  "Y8I  ,8" "8P" "8P" "8, 
_ ,dP'     I8 I8,   ,8I  I8   8I   8I  i8'       ,8'    8I  i8'    ,8I  I8   8I   8I   8I 
"888,,____,dP,d8b, ,d8I ,dP   8I   Yb,,d8,_    _,dP     Y8,,d8,   ,d8b,,dP   8I   8I   Yb,
a8P"Y88888P" P""Y88P"8888P'   8I   `Y8P""Y8888PP8P      `Y8P"Y8888P"`Y88P'   8I   8I   `Y8
                   ,d8I'                                                                  
                 ,dP'8I                                                                   
                ,8"  8I                                                                   
                I8   8I                                                                   
                `8, ,8I                                                                   
                 `Y8P"      

Syncram

Python Telegram

Display what you are listening to on your Telegram profile.

alt text

How does it work?

Here is a simple flowchart that explains how Syncram works.

Flowchart

Setting everything up

Telegram API

Go to the Telegram API website and log in using your phone number.

Create a new application. You can leave the URL box empty.

Creating an application

Press "Create application" and you will be redirected to a site where you can see an API ID and an API hash. These two values will be useful later.

Get API ID and API hash.

LastFM API

Go to the LastFM API account setup page Enter an application name. Description, URL and homepage is not needed.

LastFM api account page

The API key and shared secret strings will be also useful later.

Syncram

Clone the repository and install the requirements using:

pip install -r requirements.txt

Now you can run the syncram.py file.

During first use of Syncram, a configuration wizard will appear.

Welcome to the Syncram configuration tool.

The setup has detected the lack of a configuration file (config.toml)
A configuration file must be created.

Do you wish to proceed (y/n)
>y

[TELEGRAM]
Enter your Telegram API ID: (API ID here)
Enter your Telegram API hash: (API hash here)

[LASTFM]
Enter your LastFM API key: (LastFM API key here)
Enter your LastFM API secret: (LastFM API secret here)
Enter your LastFM username: (your LastFM username here. This will be used to check your current track.)

You're all set up! Would you like to perform advanced configuration too? (y/n)
>n

This will generate the config.toml file.

[telegram]
api_id = "(API ID here)"
api_hash = "(API hash here)"

[lastfm]
api_key = "(LastFM API key here)"
api_secret = "(LastFM API secret here)"
username = "(LastFM username here)"

[config]
debug = false
cooldown = 0

Telethon will ask you for your phone number now. Log in and you're ready to go!

Troubleshooting

Invalid API key - You must be granted a valid key by last.fm

Your last.fm API key is wrong.

ERROR - monitorLastFM failed: AttributeError("'NoneType' object has no attribute 'artist'")

This can happen for no reason when pausing a track. This doesn't have any consequences, don't worry.

How can I support you?

Give me hugs.

About

Display what you are listening to on your Telegram profile.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages