Skip to content

Commit a4443db

Browse files
committed
add opt out. untested so dont merge.
1 parent b385b76 commit a4443db

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

plexapi/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,11 @@ def iterParts(self):
488488
for part in item.parts:
489489
yield part
490490

491+
def split(self):
492+
"""Split a duplicate."""
493+
key = '%s/split' % self.key
494+
return self._server.query(key)
495+
491496
def play(self, client):
492497
""" Start playback on the specified client.
493498

plexapi/myplex.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,22 @@ def webhooks(self):
361361
self._webhooks = self.listAttrs(data, 'url', etag='webhook')
362362
return self._webhooks
363363

364+
def opt(self, playback=None, library=None):
365+
"""Opt in or out of sharing stuff with plex. See
366+
367+
https://www.plex.tv/about/privacy-legal/
368+
369+
"""
370+
params = {}
371+
if playback is not None:
372+
params['optOutPlayback'] = int(playback)
373+
if library is not None:
374+
params['optOutLibraryStats'] = int(library)
375+
376+
url = 'https://plex.tv/api/v2/user/privacy'
377+
378+
return self.query(url, method=self._session.put, **dict(params=params))
379+
364380

365381
class MyPlexUser(PlexObject):
366382
""" This object represents non-signed in users such as friends and linked

0 commit comments

Comments
 (0)