TVCatchup.com Plugin #775

Merged
merged 5 commits into from Mar 7, 2015

Conversation

Projects
None yet
3 participants
@blxd
Contributor

blxd commented Mar 4, 2015

A new plugin to support www.tvcatchup.com streams - might be geo-restricted to the UK.

src/livestreamer/plugins/tvcatchup.py
+
+ @classmethod
+ def can_handle_url(self, url):
+ print "hi!", url

This comment has been minimized.

@vadmium

vadmium Mar 4, 2015

Is this meant to be here? It’s not Python 3 syntax anyway.

@vadmium

vadmium Mar 4, 2015

Is this meant to be here? It’s not Python 3 syntax anyway.

This comment has been minimized.

@blxd

blxd Mar 4, 2015

Contributor

No, it's not meant to be there at all... My bad, was testing it before - crappy debug method.

@blxd

blxd Mar 4, 2015

Contributor

No, it's not meant to be there at all... My bad, was testing it before - crappy debug method.

docs/plugin_matrix.rst
@@ -66,6 +66,7 @@ tga - star.plu.cn Yes No
- star.tga.plu.cn
tv4play - tv4play.se Yes Yes Streams may be geo-restricted to Sweden.
Only non-premium streams currently supported.
+tvcatchup - tvcatchup.com Yes No Streams may be geo-restricted to Great Britain.
- fotbollskanalen.se

This comment has been minimized.

@chrippa

chrippa Mar 5, 2015

Owner

You are breaking up the tv4play entry here, the fotbollskanalen.se line should be directly under the tv4play lines.

@chrippa

chrippa Mar 5, 2015

Owner

You are breaking up the tv4play entry here, the fotbollskanalen.se line should be directly under the tv4play lines.

src/livestreamer/plugins/tvcatchup.py
+ def _get_streams(self):
+ res = http.get(STREAM_URL_FORMAT.format(self.channel_id))
+
+ stream_url = res.status_code in SUCCESS_HTTP_CODES and res.json().get('url')

This comment has been minimized.

@chrippa

chrippa Mar 5, 2015

Owner

There is no need to check status codes, a PluginError will be raised if it's not 200. Also, please use the http.json function, it wraps the errors in a PluginError.

@chrippa

chrippa Mar 5, 2015

Owner

There is no need to check status codes, a PluginError will be raised if it's not 200. Also, please use the http.json function, it wraps the errors in a PluginError.

src/livestreamer/plugins/tvcatchup.py
+ stream_url = res.status_code in SUCCESS_HTTP_CODES and res.json().get('url')
+
+ if not stream_url:
+ raise PluginError("The program is not available, please try again later")

This comment has been minimized.

@chrippa

chrippa Mar 5, 2015

Owner

You should just return here instead of raising an error, PluginError should be used for actual errors not "no streams were found currently".

@chrippa

chrippa Mar 5, 2015

Owner

You should just return here instead of raising an error, PluginError should be used for actual errors not "no streams were found currently".

@blxd

This comment has been minimized.

Show comment
Hide comment
@blxd

blxd Mar 5, 2015

Contributor

Cool, I will correct these on this branch and on the other pull request.
Good to see a response from you too, I plan to submit a couple of other plugins - mainly for live TV, so it's good to have some feedback. It took a bit of poking around to see how the plugins are written, but it is fairly straightforward.

Contributor

blxd commented Mar 5, 2015

Cool, I will correct these on this branch and on the other pull request.
Good to see a response from you too, I plan to submit a couple of other plugins - mainly for live TV, so it's good to have some feedback. It took a bit of poking around to see how the plugins are written, but it is fairly straightforward.

chrippa added a commit that referenced this pull request Mar 7, 2015

@chrippa chrippa merged commit cb0f103 into chrippa:develop Mar 7, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@chrippa

This comment has been minimized.

Show comment
Hide comment
@chrippa

chrippa Mar 7, 2015

Owner

Thanks!

Owner

chrippa commented Mar 7, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment