From 714ea10b55915b9adcfd0d44b65f82f9e08287b9 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Thu, 4 Nov 2021 11:20:21 +0100 Subject: [PATCH] Fix streamingcommunity per quando cambia url --- channels/streamingcommunity.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/channels/streamingcommunity.py b/channels/streamingcommunity.py index 56c5ca52..d268e911 100644 --- a/channels/streamingcommunity.py +++ b/channels/streamingcommunity.py @@ -24,6 +24,8 @@ def getHeaders(forced=False): try: headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'} response = session.get(host, headers=headers) + if not response.url.startswith(host): + host = support.config.get_channel_url(findhost, forceFindhost=True) csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14', 'content-type': 'application/json;charset=UTF-8',