I was wondering how to import and apply a style from an URL to a layer with PyQGIS.
My first thought was to do this but it didn't workout :
import urllib
from urllib import request
vlayer = iface.activeLayer()
fp = urllib.request.urlopen('https://raw.githubusercontent.com/xxxxx/xxxxxx/main/layers_styles/my_layer_style.qml')
mybytes = fp.read()
test = mybytes.decode("utf8")
print(test)
vlayer.loadNamedStyle(test)
vlayer.triggerRepaint()