mirror of https://github.com/streamlink/streamlink
plugins.vkplay: update matcher and API URL
This commit is contained in:
parent
33879e284c
commit
f87bbd59f5
|
@ -1,6 +1,6 @@
|
|||
"""
|
||||
$description Russian live-streaming platform for gaming and esports, owned by VKontakte.
|
||||
$url vkplay.live
|
||||
$url live.vkplay.ru
|
||||
$type live
|
||||
$metadata id
|
||||
$metadata author
|
||||
|
@ -20,13 +20,13 @@ log = logging.getLogger(__name__)
|
|||
|
||||
|
||||
@pluginmatcher(re.compile(
|
||||
r"https?://vkplay\.live/(?P<channel_name>\w+)/?$",
|
||||
r"https?://(?:live\.vkplay\.ru|vkplay\.live)/(?P<channel_name>\w+)/?$",
|
||||
))
|
||||
class VKplay(Plugin):
|
||||
API_URL = "https://api.vkplay.live/v1"
|
||||
API_URL = "https://api.live.vkplay.ru/v1"
|
||||
|
||||
def _get_streams(self):
|
||||
self.author = self.match.group("channel_name")
|
||||
self.author = self.match["channel_name"]
|
||||
log.debug(f"Channel name: {self.author}")
|
||||
|
||||
data = self.session.http.get(
|
||||
|
|
|
@ -6,10 +6,12 @@ class TestPluginCanHandleUrlVKplay(PluginCanHandleUrl):
|
|||
__plugin__ = VKplay
|
||||
|
||||
should_match = [
|
||||
"https://vkplay.live/Channel_Name_123",
|
||||
"https://live.vkplay.ru/CHANNEL",
|
||||
"https://vkplay.live/CHANNEL",
|
||||
]
|
||||
|
||||
should_not_match = [
|
||||
"https://live.vkplay.ru/",
|
||||
"https://vkplay.live/",
|
||||
"https://support.vkplay.ru/vkp_live",
|
||||
"https://vkplay.live/app/settings/edit",
|
||||
|
|
Loading…
Reference in New Issue