Noob questions: does server need to be running at all times + deploying to a remote provider (EC2) vs running on my machine? #415
-
|
My use case is to scrobble from YT Music into Listenbrainz. I use it from both my computer and my cell phone. Questions:
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
For youtube music -> Listenbrainz, yes it would need to run continuously. This is because youtube doesn't record history with any timestamps so the only way for multi-scrobbler to know when a play took place is to continuously watch for when the history page changes. Yes, you can use a remote server like an aws ec2 instance. There is no additional config required, you don't even need persistent storage since it could be configured using environmental variables only. I don't have any recommendations on providers but I've heard ec2 is on the more expensive side, for compute. Maybe digitalocean droplets? Or any platform that can deploy single docker containers would work (and would probably be cheaper than full cloud VMs). But also, multi-scrobbler's resource requirements are very low. You could run it on a raspberry pi or equivalent, low-powered ARM computer, in your home. Those only need a couple watts of power and can run off of usb chargers, silently, in a corner of a shelf. As an alternative, you could do YT Music -> Last.fm -> Listenbrainz:
In this scenario you don't need to have multi-scrobbler on 24/7, as it can "backscrobble" up to 100 listens from Last.fm history, on startup. So you'd only need to start it up before you listen to more than 100 songs since the last time you started it up. After it finishes backscrobbling (a couple seconds, maybe a minute), you could exit it. |
Beta Was this translation helpful? Give feedback.
-
|
Gotcha, thank you so much @FoxxMD ! I was able to setup using Google Cloud Run, it looks like it may even be under the free tier limits (I can report back on that after 1 month of usage). It was easy to deploy since they take Docker containers and I did setup with env variables as you suggested. It's working well, thanks! For the record, on Google Cloud Run the only changes I had to do is to increase the service memory to 1GB, configure the env variables using secrets to not leave them exposed, and choose the port 9078 as per your instructions. I may next try adding authorization layer. Just one more question: I see from the logs that Ytmusic polling happen every 30s, and I get it being because of trying to get a more accurate timestamp for each song stream. In case this amount of pings goes over the free tier, and costs increase substantially, is there a way to throttle down the Ytmusic polling interval? I could be ok to have timestamps updated every 5 minutes instead if that saves on costs in detriment of accuracy |
Beta Was this translation helpful? Give feedback.
For youtube music -> Listenbrainz, yes it would need to run continuously. This is because youtube doesn't record history with any timestamps so the only way for multi-scrobbler to know when a play took place is to continuously watch for when the history page changes.
Yes, you can use a remote server like an aws ec2 instance. There is no additional config required, you don't even need persistent storage since it could be configured using environmental variables only.
I don't have any recommendations on providers but I've heard ec2 is on the more expensive side, for compute. Maybe digitalocean droplets? Or any platform that can deploy single docker containers would work (and would probably …