mirror of
https://github.com/streamlink/streamlink
synced 2024-08-18 10:15:04 +02:00
![Beardypig](/assets/img/avatar_default.png)
* tvplayer: send the user-agent header when making the intial request, so that platform is correctly populated * tvplayer: update the url matching and include some tests
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
import unittest
|
|
|
|
from streamlink.plugins.tvplayer import TVPlayer
|
|
|
|
|
|
class TestPluginTVPlayer(unittest.TestCase):
|
|
def test_can_handle_url(self):
|
|
# should match
|
|
self.assertTrue(TVPlayer.can_handle_url("http://tvplayer.com/watch/"))
|
|
self.assertTrue(TVPlayer.can_handle_url("http://www.tvplayer.com/watch/"))
|
|
self.assertTrue(TVPlayer.can_handle_url("http://tvplayer.com/watch"))
|
|
self.assertTrue(TVPlayer.can_handle_url("http://www.tvplayer.com/watch"))
|
|
self.assertTrue(TVPlayer.can_handle_url("http://tvplayer.com/watch/dave"))
|
|
self.assertTrue(TVPlayer.can_handle_url("http://www.tvplayer.com/watch/itv"))
|
|
self.assertTrue(TVPlayer.can_handle_url("https://www.tvplayer.com/watch/itv"))
|
|
self.assertTrue(TVPlayer.can_handle_url("https://tvplayer.com/watch/itv"))
|
|
|
|
# shouldn't match
|
|
self.assertFalse(TVPlayer.can_handle_url("http://www.tvplayer.com/"))
|
|
self.assertFalse(TVPlayer.can_handle_url("http://www.tvcatchup.com/"))
|
|
self.assertFalse(TVPlayer.can_handle_url("http://www.youtube.com/"))
|