Skip to content

Instantly share code, notes, and snippets.

@c-rotte
Last active January 22, 2021 12:57
Show Gist options
  • Save c-rotte/9f55c8b834adba1662de795197e95b6b to your computer and use it in GitHub Desktop.
Save c-rotte/9f55c8b834adba1662de795197e95b6b to your computer and use it in GitHub Desktop.

Dokumentation für https://streams.tum.de (inoffiziell)

Anmeldung

Set-Cookie: MediasiteAuth=<AuthCookie>; expires=<...>; path=/; secure; HttpOnly
Set-Cookie: MediasiteMostRecentLogin=<LastLogin>; expires=<...>; path=/; secure; HttpOnly

→ werden für weitere Anfragen benötigt (Request Headers):

Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>
  • Beispielaufruf (cURL):
curl 'https://streams.tum.de/Mediasite/Login/' \
--data-raw 'UserName=<username>&Password=<password>&RememberMe=true&RememberMe=false'

Id der Aufzeichnungsübersicht (Catalog)

Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>
  • Antwort: HTML der Livestreamseite; hier lässt sich die Id des Katalogs auslesen (wird für weitere Anfragen benötigt):
...
	var MediasiteCatalogRequest =
     {
         CatalogId: <catalogId>,
         ...
     };
...
  • Beispielaufruf (cURL):
curl 'https://streams.tum.de/Mediasite/Catalog/catalogs/<Name >' \
  -H 'Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>'

Informationen über den Katalog

Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>
Content-Type: application/json; charset=UTF-8
  • Body:
{
	"IsViewPage": true,
	"CatalogId": <catalogId>,
	"CurrentFolderId": <catalogId>,
	"Url": "null",
	"PreviewKey" :null,
	"AuthTicket" :null
}
  • Antwort:
{
	"CatalogDetails": {
		"Id": <catalogId>,
		...
		"Name": <Name der Vorlesung>,
		"Description": <...>,
		"Owner": <TUM-Kennung des Owners>,
		...
	},
	...
	"FriendlyUrl": <URL des Catalogs>,
	...
	"RssUrl": <RSS-Feed (oftmals nicht aktiviert)>,
	...
}
  • Beispielaufruf (cURL):
curl 'https://streams.tum.de/Mediasite/Catalog/Data/GetCatalogDetails' \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>' \
  --data-binary '{"IsViewPage":true,"CatalogId":<catalogId>,"CurrentFolderId":<catalogId>,"Url":"null","PreviewKey":null,"AuthTicket":null}'

Liste der Präsentationen

Content-Type: application/json; charset=UTF-8
Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>
  • Body:
{
	"IsViewPage": true,
	"IsNewFolder": true,
	"AuthTicket": null,
	"CatalogId": <catalogId>,
	"CurrentFolderId": <catalogId>,
	"RootDynamicFolderId": null,
	"ItemsPerPage": <Anzahl Präsentationen pro Seite>,
	"PageIndex": <Seitenindex>,
	"PermissionMask": "Execute",
	"CatalogSearchType": "SearchInFolder",
	"SortBy": <"Date" oder "Title">,
	"SortDirection": <"Descending" oder "Ascending">,
	"StartDate": null,
	"EndDate": null,
	"StatusFilterList": null,
	"PreviewKey": null,
	"Tags": []
}
  • Antwort:
{
	"TotalItems": <Anzahl Präsentationen>,
	"PageIndex": <Index der Seite>,
	"PresentationDetailsList": [
		{
			"Id": <presentationId>,
			"Name": <Name der Aufzeichnung>,
			...
			"AirDateDisplay": <...>,
			"AirTimeDisplay": <...>,
			"FullStartDate": <...>,
			"FullEndDate": <...>,
			...
			"PlayerUrl": <...>,
			...
			"StatusDisplay":
				<"On Demand" -> Aufzeichnung; "Live" -> Momentaner Livestream; "Scheduled" -> Zukünftiger Livestream>,
			...
			"Views": <Aufrufe>
	    },
	    ...
	],
	...
}
  • Beispielaufruf (cURL):
curl 'https://streams.tum.de/Mediasite/Catalog/Data/GetPresentationsForFolder' \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>' \
  --data-binary '{"IsViewPage":true,"IsNewFolder":true,"AuthTicket":null,"CatalogId":<catalogId>,"CurrentFolderId":<catalogId>,"RootDynamicFolderId":null,"ItemsPerPage":<Anzahl Präsentationen pro Seite>,"PageIndex":<Seitenindex>,"PermissionMask":"Execute","CatalogSearchType":"SearchInFolder","SortBy":<"Date" oder "Title">,"SortDirection":<"Descending" oder "Ascending">,"StartDate":null,"EndDate":null,"StatusFilterList":null,"PreviewKey":null,"Tags":[]}'

Videoquelle der Präsentationen

Content-Type: application/json; charset=UTF-8
Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>
  • Body:
{
	"getPlayerOptionsRequest":
		{
			"ResourceId":<presentationId>,
			"QueryString":"null",
			"UseScreenReader":false,
			"UrlReferrer":""
		}
}
  • Antwort:
{
  "d": {
    ...
    "Presentation": {
      ...
      "Streams": [
        {
          ...
          "VideoUrls": [
            {
              ...
              "Location": <url>,
              "MediaType": "SS",
              "MimeType": "video/x-mp4-fragmented",
              ...
              "SegmentLength": 2000,
              "ServerType": "IIS"
            },
            {
              ...
              "Location": <url>,
              "MediaType": "Dash",
              "MimeType": "video/x-mpeg-dash",
              ...
              "SegmentLength": 6000,
              "ServerType": "Deliver"
            },
            {
              ...
              "Location": <url>,
              "MediaType": "MP4",
              "MimeType": "video/mp4",
              ...
              "SegmentLength": 0,
              "ServerType": "IIS"
            }
          ]
        },
        {
          ...
          "VideoUrls": [
            {
              ...
              "Location": <url>,
              "MediaType": "SS",
              "MimeType": "video/x-mp4-fragmented",
              ...
              "SegmentLength": 2000,
              "ServerType": "IIS"
            },
            {
              ...
              "Location": <url>,
              "MediaType": "Dash",
              "MimeType": "video/x-mpeg-dash",
              ...
              "SegmentLength": 6000,
              "ServerType": "Deliver"
            },
            {
              ...
              "Location": <url>,
              "MediaType": "MP4",
              "MimeType": "video/mp4",
              ...
              "SegmentLength": 0,
              "ServerType": "IIS"
            }
          ]
        }
      ],
      ...
  }
}

→ Die Liste "Streams" enthält zwei Objekte; das erste ist meist die Aufnahme des Redners, das zweite die der Tafel / Folien.

  • Beispielaufruf (cURL):
curl 'https://streams.tum.de/Mediasite/PlayerService/PlayerService.svc/json/GetPlayerOptions' \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Cookie: MediasiteAuth=<AuthCookie>; MediasiteMostRecentLogin=<LastLogin>' \
  --data-binary '{"getPlayerOptionsRequest":{"ResourceId":<presentationId>,"QueryString":"null","UseScreenReader":false,"UrlReferrer":""}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment