So, now to the final problem. This method no longer works:
def subscribe(self):
headers = {"Client-ID": self.client_id}
data = {
"hub.mode": "subscribe",
"hub.topic": f"{self.twitch_api_base}/users/follows?first=1&to_id={self.user_id}",
"hub.callback": self.public_uri,
"hub.lease_seconds": str(24 * 60 * 60)
}
result = requests.post(self.webhooks_url, json=data, headers=headers)
if result.status_code == requests.codes.accepted:
self.logger.debug("Our subscription request was accepted by Twitch")
else:
self.logger.debug("Failed to subscribe to follower notifications")
self.logger.debug(f"result.status_code = {result.status_code}")
self.logger.debug(f"result.text = {result.text}")
The error message is
2020-06-09 16:41:23.927247: twitch_follow_server.py: 161: DEBUG : Failed to subscribe to follower notifications
2020-06-09 16:41:23.927360: twitch_follow_server.py: 162: DEBUG : result.status_code = 401
2020-06-09 16:41:23.927427: twitch_follow_server.py: 163: DEBUG : result.text = {"error":"Unauthorized","status":401,"message":"OAuth token is missing"}
Now, if you’ve been paying close attention, you’ll notice this is my original problem and the title of the question.
I don’t know how to get the OAuth token here.