File: test_livestream.py

package info (click to toggle)
streamlink 8.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 5,608 kB
  • sloc: python: 51,763; sh: 184; makefile: 152
file content (62 lines) | stat: -rw-r--r-- 2,162 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from streamlink.plugins.livestream import Livestream
from tests.plugins import PluginCanHandleUrl


class TestPluginCanHandleUrlLivestream(PluginCanHandleUrl):
    __plugin__ = Livestream

    should_match_groups = [
        # no event/video
        (
            "https://livestream.com/accounts/12182108/",
            {"account": "12182108"},
        ),
        (
            "https://livestream.com/accounts/1538473/eaglecam",
            {"account": "1538473"},
        ),
        (
            "https://www.livestream.com/accounts/12182108/",
            {"subdomain": "www.", "account": "12182108"},
        ),
        # no event/video via API URL
        (
            "https://api.new.livestream.com/accounts/12182108/",
            {"subdomain": "api.new.", "account": "12182108"},
        ),
        # event
        (
            "https://livestream.com/accounts/12182108/events/4004765",
            {"account": "12182108", "event": "4004765"},
        ),
        (
            "https://www.livestream.com/accounts/12182108/events/4004765",
            {"subdomain": "www.", "account": "12182108", "event": "4004765"},
        ),
        # event via API URL
        (
            "https://api.new.livestream.com/accounts/12182108/events/4004765",
            {"subdomain": "api.new.", "account": "12182108", "event": "4004765"},
        ),
        # video without event
        (
            "https://livestream.com/accounts/4175709/neelix/videos/119637915",
            {"account": "4175709", "video": "119637915"},
        ),
        # video with event
        (
            "https://livestream.com/accounts/844142/events/5602516/videos/216545361",
            {"account": "844142", "event": "5602516", "video": "216545361"},
        ),
        # video with event via API URL
        (
            "https://api.new.livestream.com/accounts/844142/events/5602516/videos/216545361",
            {"subdomain": "api.new.", "account": "844142", "event": "5602516", "video": "216545361"},
        ),
    ]

    should_not_match = [
        "https://livestream.com/",
        "https://www.livestream.com/",
        "https://api.new.livestream.com/",
    ]