How to let mopidy backend reload audio url during the resume?

I work on an mopidy backend extension. I met an problem in the resume playing. More detailed information are listed below.

The music provider only give 10 min valid audio link via API. So, if pause long time, the mopidy won’t resume successful.

I have follow two ideas in my mind to solve this problem, but I do not know which one is better or how to do it.

  • Let GStreamer download full audio files.
  • Set a timer of pause time, if the timer expired, reload audio url.

Is someone could give me an example?

I know that the gmusic extension faces the same issue. Perhaps you could try to get in contact with someone working on that to see their plans. I’m not sure if Kaleb Elworthy is on here but the project is of course on github.