-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugins.twitch: fix call_subdomain #2958
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2958 +/- ##
==========================================
- Coverage 52.61% 52.59% -0.03%
==========================================
Files 251 251
Lines 15756 15762 +6
==========================================
Hits 8290 8290
- Misses 7466 7472 +6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time finding the issue.
Ideally the whole call_subdomain method should get removed, as the API hostname could also be set as a parameter in the regular call method, which would be way more clear, but that's not important now. A simple try/finally block is enough.
src/streamlink/plugins/twitch.py
Outdated
try: | ||
response = self.call(path, format=format, schema=schema, **extra_params) | ||
except PluginError: | ||
self.subdomain = subdomain_buffer | ||
raise | ||
self.subdomain = subdomain_buffer | ||
return response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try: | |
response = self.call(path, format=format, schema=schema, **extra_params) | |
except PluginError: | |
self.subdomain = subdomain_buffer | |
raise | |
self.subdomain = subdomain_buffer | |
return response | |
try: | |
return self.call(path, format=format, schema=schema, **extra_params) | |
finally: | |
self.subdomain = subdomain_buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not the diff I suggested. You are writing duplicate code.
Oh, you about removing call_subdomain at all? |
|
OK, I got it, sorry. |
fixes #2751