-
Notifications
You must be signed in to change notification settings - Fork 14
PlexServer API
Chewbaka edited this page Mar 7, 2018
·
1 revision
http://{URL_SERVER:PORT}/library/sections?X-Plex-Token={YOURTOKEN}
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="3" allowSync="0" identifier="com.plexapp.plugins.library" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1513172439" title1="Plex Library">
<Directory allowSync="0" art="/:/resources/movie-fanart.jpg" composite="/library/sections/1/composite/1520384733" filters="1" refreshing="0" thumb="/:/resources/movie.png" key="1" type="movie" title="Films" agent="com.plexapp.agents.themoviedb" scanner="Plex Video Files Scanner" language="fr" uuid="da4c3c00-d088-4741-a654-6d52a6475097" updatedAt="1508519768" createdAt="1485377336">
<Location id="1" path="/mnt/raid5/Film" />
</Directory>
</MediaContainer>
You can see on the tag Directory:
<Directory ... key="6" ...>
The key is the id of your library, we reuse it to find the content of library
http://{URL_SERVER:PORT}/library/sections/1/all?X-Plex-Token={YOURTOKEN}
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="338" allowSync="1" art="/:/resources/movie-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="1" librarySectionTitle="Films" librarySectionUUID="da4c3c00-d088-4741-a654-6d52a6475097" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1513172439" thumb="/:/resources/movie.png" title1="Films" title2="All Films" viewGroup="movie" viewMode="65592">
<Video ratingKey="1" key="/library/metadata/1" studio="STUDIO TEST" type="movie" title="FILM TEST" originalTitle="TEST FILM" contentRating="fr/12" summary="Synopsis blablabla..." rating="7.3" year="2018" thumb="/library/metadata/1/thumb/1519839564" art="/library/metadata/1/art/1519839564" duration="8669661" originallyAvailableAt="2018-01-13" addedAt="" updatedAt="" chapterSource="agent" hasPremiumExtras="1" hasPremiumPrimaryExtra="1" ratingImage="imdb://image.rating">
<Media videoResolution="sd" id="1" duration="8669661" bitrate="1369" width="720" height="300" aspectRatio="2.35" audioChannels="2" audioCodec="mp3" videoCodec="mpeg4" container="avi" videoFrameRate="24p" videoProfile="simple">
<Part id="1" key="/library/parts/1/1484510585/file.avi" duration="8669661" file="/mnt/raid5/Film/test.film.avi" size="1483386892" container="avi" videoProfile="simple" />
</Media>
<Genre tag="Action" />
<Genre tag="Drama" />
<Director tag="Michael Jackson" />
<Writer tag="Boby" />
<Country tag="MT" />
<Role tag="Michael Jackson" />
<Role tag="Michael Jackson" />
<Role tag="Michael Jackson" />
</Video>
You can get all information about your media. And in the Video tag, the key attribut will be use to stream the media
<Video ratingKey="1" key="/library/metadata/1" studio="STUDIO TEST" type="movie" title="FILM TEST" originalTitle="TEST FILM" contentRating="fr/12" summary="Synopsis blablabla..." rating="7.3" year="2018" thumb="/library/metadata/1/thumb/1519839564" art="/library/metadata/1/art/1519839564" duration="8669661" originallyAvailableAt="2018-01-13" addedAt="" updatedAt="" chapterSource="agent" hasPremiumExtras="1" hasPremiumPrimaryExtra="1" ratingImage="imdb://image.rating">