Changing server ip address according to connected wifi

I need some help changing the ip of the media center according to location either local or remote based on wifi connected using tasker and the yatse api

This is not possible via the API as could open the door to password stealing.

does this have any other workaround via tasker or other app ?

Depends on the need. You can use DNS views, VPN, tunnels, …

Or add 2 hosts and use the API to switch between them.

can the 2 hosts share the same offline media ?

the case here being : caching the media locally on my lan
and when connecting through any other wifi it keeps real-time syng of the watch status only

They do share yes. But no need to dup for this.

Yatse will have instant proper state and will push to the server as soon as connected back.

sadly this is not the case
when it starts sync it pulls watch status from the server and redownloads the watched episodes

Then open issue with logs and I’ll check next week after holidays.