Change Plex transcoding profile to Android
This commit is contained in:
parent
a4627ae1cb
commit
56400e54da
2 changed files with 17 additions and 20 deletions
|
@ -2258,37 +2258,37 @@ class API():
|
||||||
return url
|
return url
|
||||||
|
|
||||||
# For Transcoding
|
# For Transcoding
|
||||||
|
headers = {
|
||||||
|
'X-Plex-Platform': 'Android',
|
||||||
|
'X-Plex-Platform-Version': '7.0',
|
||||||
|
'X-Plex-Product': 'Plex for Android',
|
||||||
|
'X-Plex-Version': '5.8.0.475'
|
||||||
|
}
|
||||||
# Path/key to VIDEO item of xml PMS response is needed, not part
|
# Path/key to VIDEO item of xml PMS response is needed, not part
|
||||||
path = self.item.attrib['key']
|
path = self.item.attrib['key']
|
||||||
transcodePath = self.server + \
|
transcodePath = self.server + \
|
||||||
'/video/:/transcode/universal/start.m3u8?'
|
'/video/:/transcode/universal/start.m3u8?'
|
||||||
args = {
|
args = {
|
||||||
|
'audioBoost': settings('audioBoost'),
|
||||||
|
'autoAdjustQuality': 0,
|
||||||
|
'directPlay': 0,
|
||||||
|
'directStream': 1,
|
||||||
'protocol': 'hls', # seen in the wild: 'dash', 'http', 'hls'
|
'protocol': 'hls', # seen in the wild: 'dash', 'http', 'hls'
|
||||||
'session': window('plex_client_Id'),
|
'session': window('plex_client_Id'),
|
||||||
'fastSeek': 1,
|
'fastSeek': 1,
|
||||||
'path': path,
|
'path': path,
|
||||||
'mediaIndex': self.mediastream,
|
'mediaIndex': self.mediastream,
|
||||||
'partIndex': self.part,
|
'partIndex': self.part,
|
||||||
|
'hasMDE': 1,
|
||||||
|
'location': 'lan',
|
||||||
|
'mediaBufferSize': '16384',
|
||||||
# 'copyts': 1,
|
# 'copyts': 1,
|
||||||
# 'offset': 0, # Resume point
|
# 'offset': 0, # Resume point
|
||||||
}
|
}
|
||||||
# Seem like PHT to let the PMS use the transcoding profile
|
# Look like Android to let the PMS use the transcoding profile
|
||||||
xargs['X-Plex-Device'] = 'Plex Home Theater'
|
xargs.update(headers)
|
||||||
# Currently not used!
|
log.debug("Setting transcode quality to: %s" % quality)
|
||||||
if action == "DirectStream":
|
args.update(quality)
|
||||||
argsUpdate = {
|
|
||||||
'directPlay': '0',
|
|
||||||
'directStream': '1',
|
|
||||||
}
|
|
||||||
args.update(argsUpdate)
|
|
||||||
elif action == 'Transcode':
|
|
||||||
argsUpdate = {
|
|
||||||
'directPlay': '0',
|
|
||||||
'directStream': '0'
|
|
||||||
}
|
|
||||||
log.debug("Setting transcode quality to: %s" % quality)
|
|
||||||
args.update(quality)
|
|
||||||
args.update(argsUpdate)
|
|
||||||
url = transcodePath + urlencode(xargs) + '&' + urlencode(args)
|
url = transcodePath + urlencode(xargs) + '&' + urlencode(args)
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
|
@ -343,9 +343,6 @@ class PlayUtils():
|
||||||
# There's only one audiotrack.
|
# There's only one audiotrack.
|
||||||
playurlprefs['audioStreamID'] = audioStreamsList[0]
|
playurlprefs['audioStreamID'] = audioStreamsList[0]
|
||||||
|
|
||||||
# Add audio boost
|
|
||||||
playurlprefs['audioBoost'] = settings('audioBoost')
|
|
||||||
|
|
||||||
selectSubsIndex = None
|
selectSubsIndex = None
|
||||||
if subNum > 1:
|
if subNum > 1:
|
||||||
if (settings('pickPlexSubtitles') == 'true' and
|
if (settings('pickPlexSubtitles') == 'true' and
|
||||||
|
|
Loading…
Reference in a new issue