Skip to content

Commit e83de5b

Browse files
committed
docs(api): write api documentation
1 parent be984eb commit e83de5b

2 files changed

Lines changed: 32 additions & 9 deletions

File tree

API.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,39 @@ For the time being, each user of the API must recieve a unique identifier in ord
99

1010
## Usage
1111

12+
### Normal Operation
13+
There is one fields that you need for all API operations:
14+
- unique_identifier: Identifies the origination of the request.
1215

13-
## Add inside
14-
requests.post("http://beethoven.csl.tjhsst.edu/api/add/", data={"unique_identifier":"test", "source":"198.38.15.46", "group":"198.38.15.77", "inside_request":"True"}).content
16+
For adding streams, you need two additional fields:
17+
- source: IP address of the stream's source
18+
- group: IP address of the stream's group
1519

20+
You can add streams like:
21+
```
22+
requests.post("https://menu.m2icast.net/api/add/", data={"unique_identifier":"<UID>", "source":"<SOURCE_IP>", "group":"<GROUP_IP>"}).content
23+
```
1624

17-
## Remove inside
18-
requests.post("http://beethoven.csl.tjhsst.edu/api/remove/", data={"unique_identifier":"test", "access_code":"8ZMXL14MLAh0pQ7NTcGYZOCBRrOhg3GaY9X0y4bW"}).content
25+
The ".content" at the end is important in order to capture the return value, which is a unique idenfier for the stream that has been added. This access code will be important to delete the stream later.
1926

20-
## Add API
21-
requests.post("http://beethoven.csl.tjhsst.edu/api/add/", data={"unique_identifier":"test", "source":"198.38.15.46", "group":"198.38.15.77"}).content
27+
For removing streams, you only need one additional field:
28+
- access_code: The stream's access code
2229

23-
## Remove API
24-
requests.post("http://beethoven.csl.tjhsst.edu/api/remove/", data={"unique_identifier":"test", "access_code":"8ZMXL14MLAh0pQ7NTcGYZOCBRrOhg3GaY9X0y4bW"}).content
30+
You can remove streams like:
31+
```
32+
requests.post("https://menu.m2icast.net/api/remove/", data={"unique_identifier":"<UID>", "access_code":"<STREAM_ACCESS_CODE>"}).content
33+
```
34+
35+
36+
### Inside Operation
37+
Multicast Menu actually allows users to upload their own files and have them translated from unicast to multicast using a translation server. If you would like your translation server to be one that Multicast Menu uses to translate these uploaded files, please start by contacting a site admin so that they can mark your translator correctly. Once that has been done, ensure that your code is responding to packets from the Multicast Menu server correctly. You can find sample code for that at [https://github.com/JNPRAutomate/unicast2multicast-translator](https://github.com/JNPRAutomate/unicast2multicast-translator). Generally, ensure that your "inside" API requests look like:
38+
39+
Adding a Stream:
40+
```
41+
requests.post("https://menu.m2icast.net/api/add/", data={"unique_identifier":"<UID>", "source":"<SOURCE_IP>", "group":"<GROUP_IP>", "inside_request":"True"}).content
42+
```
43+
44+
Removing a Stream:
45+
```
46+
requests.post("https://menu.m2icast.net/api/remove/", data={"unique_identifier":"<UID>", "access_code":"<STREAM_ACCESS_CODE>"}).content
47+
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Multicast Menu provides a collection of all the multicast video streams availabl
44

55

66
## Usage
7-
This site can be found at [https://multicastmenu.m2icast.net](https://multicastmenu.m2icast.net). In order for the streams that it links to to run properly on your machine, you will need [VLC 4.0 or later](https://nightlies.videolan.org/) installed.
7+
This site can be found at [https://menu.m2icast.net](https://menu.m2icast.net). In order for the streams that it links to to run properly on your machine, you will need [VLC 4.0 or later](https://nightlies.videolan.org/) installed.
88

99
To manually run the stream collection scripts used by this site, see the [multicast/stream_collection_scripts](https://github.com/Laur04/multicast-menu/tree/master/multicast/stream_collection_scripts) folder.
1010

0 commit comments

Comments
 (0)