Add syntax highlighting to readme

This commit is contained in:
Michael Shepanski 2015-06-04 11:26:42 -04:00
parent 05ef43bddc
commit d1ae065d68

View file

@ -26,8 +26,10 @@ network as the Plex Server (and you are not using Plex Users), you can
authenticate without a username and password. Getting a PlexServer
instance is as easy as the following:
```python
from plexapi.server import PlexServer
plex = PlexServer() # Defaults to localhost:32400
```
If you are running on a separate network or using Plex Users you need to log
into MyPlex to get a PlexServer instance. An example of this is below. NOTE:
@ -35,12 +37,15 @@ Servername below is the name of the server (not the hostname and port). If
logged into Plex Web you can see the server name in the top left above your
available libraries.
```python
from plexapi.myplex import MyPlexUser
user = MyPlexUser.signin('<USERNAME>', '<PASSWORD>')
plex = user.getServer('<SERVERNAME>').connect()
```
#### Usage Examples ####
```python
# Example 1: List all unwatched content in library.
for section in plex.library.sections():
print('Unwatched content in %s:' % section.title)
@ -73,6 +78,7 @@ available libraries.
the_last_one = plex.library.get('Friends').episodes()[-1]
for part in the_last_one.iter_parts():
print(part.file)
```
#### FAQs ####