Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes the streamlabspolly error:
Error occurred calling Streamlabs Polly
Description
Summary of Change and Issue Fixed:
This update modifies the
streamlabs_polly.py
file within the Text-to-Speech (TTS) module to address issues related to HTTP request headers not being properly set for requests to the Streamlabs service. The issue arises due to Streamlabs' API requiring a "Referer" header for requests, which was previously not included, leading to failed API calls.Context:
The
streamlabs_polly.py
script is used to interact with Streamlabs for converting text to speech. Recent changes or restrictions imposed by Streamlabs necessitate the inclusion of a "Referer" header in API requests to ensure successful communication with their service.Dependencies Required:
requests
: This Python library is used for making HTTP requests. Ensure that you have this library installed in your project environment.Detailed Instructions:
Locate the
streamlabs_polly.py
File:streamlabs_polly.py
file.Open the File:
streamlabs_polly.py
in a text editor or IDE of your choice that supports Python syntax, such as Visual Studio Code, PyCharm, or Sublime Text.Modify the Code:
Save the Changes:
CTRL+S
(orCmd+S
on macOS) or using your text editor's save function.Test the Changes:
main.py
or the relevant script that utilizes the modifiedstreamlabs_polly.py
to verify that the issue has been resolved and the TTS functionality is working as expected.By following these instructions, you will have adjusted the
streamlabs_polly.py
file to include the required "Referer" header in requests to Streamlabs, addressing the compatibility issue and ensuring the smooth operation of the TTS feature in your project.Issue Fixes
Issue Fix Summary:
Modified
streamlabs_polly.py
to include "Referer" headers in requests, fixing the "Error occurred calling Streamlabs Polly" issue by ensuring compliance with Streamlabs API requirements.headers = {"Referer": "https://streamlabs.com/"}
before API requests.response = requests.post(self.url, headers=headers, data=body)
.Result: Eliminated the error and restored functionality to Streamlabs Polly requests in the TTS module.
None
Checklist:
Any other information (e.g how to test the changes)
None