forked from tgorgdotcom/locast2plex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplates.py
More file actions
89 lines (66 loc) · 1.81 KB
/
templates.py
File metadata and controls
89 lines (66 loc) · 1.81 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
templates = {
# HTTP Error
'htmlError': """<html>
<head></head>
<body>
<h2>{}</h2>
</body>
</html>""",
# XML DISCOVER
# with help from https://github.com/ZeWaren/python-upnp-ssdp-example
'xmlDiscover': """<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>
<friendlyName>Locast2Plex</friendlyName>
<manufacturer>Silicondust</manufacturer>
<modelName>{0}</modelName>
<modelNumber>{0}</modelNumber>
<serialNumber/>
<UDN>uuid:{1}</UDN>
</device>
<URLBase>http://{2}</URLBase>
</root>""",
'xmlLineupItem': """<Program>
<GuideNumber>{}</GuideNumber>
<GuideName>{}</GuideName>
<URL>http://{}</URL>
</Program>""",
# mostly pulled from tellytv
# NOTE: double curly brace escaped to prevent format from breaking
'jsonDiscover': """{{
"FriendlyName": "Locast2Plex",
"Manufacturer": "Silicondust",
"ModelNumber": "{0}",
"FirmwareName": "{1}",
"TunerCount": {2},
"FirmwareVersion": "{3}",
"DeviceID": "{4}",
"DeviceAuth": "locast2plex",
"BaseURL": "http://{5}",
"LineupURL": "http://{5}/lineup.json"
}}""",
# mostly pulled from tellytv
# Don't need curly braces to escape here
'jsonLineupStatus': """{
"ScanInProgress": true,
"Progress": 50,
"Found": 5
}""",
# mostly pulled from tellytv
# Don't need curly brece escape here
'jsonLineupComplete': """{
"ScanInProgress": false,
"ScanPossible": true,
"Source": "Antenna",
"SourceList": ["Antenna"]
}""",
'jsonLineupItem': """{{
"GuideNumber": "{}",
"GuideName": "{}",
"URL": "http://{}"
}}"""
}