Compare commits
24 Commits
v2.1.34
...
v2.1.35-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5fd8cfeb80 | ||
![]() |
b295566a4e | ||
![]() |
e0943a2d55 | ||
![]() |
3015740c3e | ||
![]() |
ec9ff2f803 | ||
![]() |
ec8aae9122 | ||
![]() |
52e608cc43 | ||
![]() |
8213f270e5 | ||
![]() |
7085042b0d | ||
![]() |
6a411d2458 | ||
![]() |
38e2fbabb8 | ||
![]() |
85709f754a | ||
![]() |
623a1e8a91 | ||
![]() |
de69945ebe | ||
![]() |
7095fa6ac6 | ||
![]() |
a59e8298fd | ||
![]() |
2737d52279 | ||
![]() |
0ac1ad4386 | ||
![]() |
2db328ac31 | ||
![]() |
b6de4ad054 | ||
![]() |
cfea7164b7 | ||
![]() |
7e7e5a6be4 | ||
![]() |
df57f4c009 | ||
![]() |
c2185c4ce5 |
4
API.md
4
API.md
@@ -507,7 +507,9 @@ Returns:
|
|||||||
"stream_video_language": "",
|
"stream_video_language": "",
|
||||||
"stream_video_language_code": "",
|
"stream_video_language_code": "",
|
||||||
"stream_video_ref_frames": "4",
|
"stream_video_ref_frames": "4",
|
||||||
|
"stream_video_full_resolution": "1080p",
|
||||||
"stream_video_resolution": "1080",
|
"stream_video_resolution": "1080",
|
||||||
|
"stream_video_scan_type": "progressive",
|
||||||
"stream_video_width": "1920",
|
"stream_video_width": "1920",
|
||||||
"studio": "HBO",
|
"studio": "HBO",
|
||||||
"subtitle_codec": "",
|
"subtitle_codec": "",
|
||||||
@@ -560,12 +562,14 @@ Returns:
|
|||||||
"video_decision": "direct play",
|
"video_decision": "direct play",
|
||||||
"video_frame_rate": "23.976",
|
"video_frame_rate": "23.976",
|
||||||
"video_framerate": "24p",
|
"video_framerate": "24p",
|
||||||
|
"video_full_resolution": "1080p",
|
||||||
"video_height": "1078",
|
"video_height": "1078",
|
||||||
"video_language": "",
|
"video_language": "",
|
||||||
"video_language_code": "",
|
"video_language_code": "",
|
||||||
"video_profile": "high",
|
"video_profile": "high",
|
||||||
"video_ref_frames": "4",
|
"video_ref_frames": "4",
|
||||||
"video_resolution": "1080",
|
"video_resolution": "1080",
|
||||||
|
"video_scan_type": "progressive",
|
||||||
"video_width": "1920",
|
"video_width": "1920",
|
||||||
"view_offset": "1000",
|
"view_offset": "1000",
|
||||||
"width": "1920",
|
"width": "1920",
|
||||||
|
18
CHANGELOG.md
18
CHANGELOG.md
@@ -1,5 +1,23 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v2.1.35-beta (2019-09-24)
|
||||||
|
|
||||||
|
* Monitoring:
|
||||||
|
* Fix: Audio shown as blank on activity cards when changing audio tracks during direct play.
|
||||||
|
* Fix: Display correct interlaced or progressive video scan type on activity cards.
|
||||||
|
* New: Added flag for Nvidia hardware decoding on activity cards.
|
||||||
|
* Notifications:
|
||||||
|
* Fix: Notification parameter prefix and suffix were not substituted correctly.
|
||||||
|
* Fix: Release Date notification parameter was incorrectly casted to an integer instead of a string.
|
||||||
|
* New: Added video scan type and full resolution notification parameters.
|
||||||
|
* UI:
|
||||||
|
* Fix: Movies with the same title but different year being grouped on the homepage stats cards.
|
||||||
|
* API:
|
||||||
|
* New: Added video scan type and full resolution values to get_activity command.
|
||||||
|
* Other:
|
||||||
|
* Fix: Tautulli logging out every time after saving settings and restarting.
|
||||||
|
|
||||||
|
|
||||||
## v2.1.34 (2019-09-03)
|
## v2.1.34 (2019-09-03)
|
||||||
|
|
||||||
* History:
|
* History:
|
||||||
|
@@ -232,11 +232,11 @@ DOCUMENTATION :: END
|
|||||||
hw_d = ' (HW)' if data['transcode_hw_decoding'] else ''
|
hw_d = ' (HW)' if data['transcode_hw_decoding'] else ''
|
||||||
hw_e = ' (HW)' if data['transcode_hw_encoding'] else ''
|
hw_e = ' (HW)' if data['transcode_hw_encoding'] else ''
|
||||||
%>
|
%>
|
||||||
Transcode (${data['video_codec'].upper()}${hw_d} ${VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])} <i class="fa fa-long-arrow-right"></i> ${data['stream_video_codec'].upper()}${hw_e} ${VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])})
|
Transcode (${data['video_codec'].upper()}${hw_d} ${data['video_full_resolution']} <i class="fa fa-long-arrow-right"></i> ${data['stream_video_codec'].upper()}${hw_e} ${data['stream_video_full_resolution']})
|
||||||
% elif data['stream_video_decision'] == 'copy':
|
% elif data['stream_video_decision'] == 'copy':
|
||||||
Direct Stream (${data['stream_video_codec'].upper()} ${VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])})
|
Direct Stream (${data['stream_video_codec'].upper()} ${data['stream_video_full_resolution']})
|
||||||
% else:
|
% else:
|
||||||
Direct Play (${data['stream_video_codec'].upper()} ${VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])})
|
Direct Play (${data['stream_video_codec'].upper()} ${data['stream_video_full_resolution']})
|
||||||
% endif
|
% endif
|
||||||
% elif data['media_type'] == 'photo':
|
% elif data['media_type'] == 'photo':
|
||||||
Direct Play (${data['width']}x${data['height']})
|
Direct Play (${data['width']}x${data['height']})
|
||||||
|
@@ -445,7 +445,7 @@
|
|||||||
v_res = '4k';
|
v_res = '4k';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
v_res = s.video_resolution + 'p'
|
v_res = s.video_full_resolution;
|
||||||
}
|
}
|
||||||
var sv_res = '';
|
var sv_res = '';
|
||||||
switch (s.stream_video_resolution.toLowerCase()) {
|
switch (s.stream_video_resolution.toLowerCase()) {
|
||||||
@@ -456,7 +456,7 @@
|
|||||||
sv_res = '4k';
|
sv_res = '4k';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sv_res = s.stream_video_resolution + 'p'
|
sv_res = s.stream_video_full_resolution;
|
||||||
}
|
}
|
||||||
if (s.stream_video_decision === 'transcode') {
|
if (s.stream_video_decision === 'transcode') {
|
||||||
var hw_d = (s.transcode_hw_decoding === 1) ? ' (HW)' : '';
|
var hw_d = (s.transcode_hw_decoding === 1) ? ' (HW)' : '';
|
||||||
|
@@ -17,13 +17,13 @@ import threading
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import plexpy
|
import plexpy
|
||||||
|
import activity_handler
|
||||||
import activity_processor
|
import activity_processor
|
||||||
import database
|
import database
|
||||||
import helpers
|
import helpers
|
||||||
import libraries
|
import libraries
|
||||||
import logger
|
import logger
|
||||||
import notification_handler
|
import notification_handler
|
||||||
import notifiers
|
|
||||||
import plextv
|
import plextv
|
||||||
import pmsconnect
|
import pmsconnect
|
||||||
import web_socket
|
import web_socket
|
||||||
@@ -37,17 +37,23 @@ int_ping_count = 0
|
|||||||
def check_active_sessions(ws_request=False):
|
def check_active_sessions(ws_request=False):
|
||||||
|
|
||||||
with monitor_lock:
|
with monitor_lock:
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
|
||||||
session_list = pms_connect.get_current_activity()
|
|
||||||
monitor_db = database.MonitorDatabase()
|
monitor_db = database.MonitorDatabase()
|
||||||
monitor_process = activity_processor.ActivityProcessor()
|
monitor_process = activity_processor.ActivityProcessor()
|
||||||
|
db_streams = monitor_process.get_sessions()
|
||||||
|
|
||||||
|
# Clear the metadata cache
|
||||||
|
for stream in db_streams:
|
||||||
|
activity_handler.delete_metadata_cache(stream['session_key'])
|
||||||
|
|
||||||
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
|
session_list = pms_connect.get_current_activity()
|
||||||
|
|
||||||
logger.debug(u"Tautulli Monitor :: Checking for active streams.")
|
logger.debug(u"Tautulli Monitor :: Checking for active streams.")
|
||||||
|
|
||||||
if session_list:
|
if session_list:
|
||||||
media_container = session_list['sessions']
|
media_container = session_list['sessions']
|
||||||
|
|
||||||
# Check our temp table for what we must do with the new streams
|
# Check our temp table for what we must do with the new streams
|
||||||
db_streams = monitor_process.get_sessions()
|
|
||||||
for stream in db_streams:
|
for stream in db_streams:
|
||||||
if any(d['session_key'] == str(stream['session_key']) and d['rating_key'] == str(stream['rating_key'])
|
if any(d['session_key'] == str(stream['session_key']) and d['rating_key'] == str(stream['rating_key'])
|
||||||
for d in media_container):
|
for d in media_container):
|
||||||
|
@@ -119,11 +119,6 @@ AUDIO_CODEC_OVERRIDES = {
|
|||||||
|
|
||||||
VIDEO_RESOLUTION_OVERRIDES = {
|
VIDEO_RESOLUTION_OVERRIDES = {
|
||||||
'sd': 'SD',
|
'sd': 'SD',
|
||||||
'480': '480p',
|
|
||||||
'540': '540p',
|
|
||||||
'576': '576p',
|
|
||||||
'720': '720p',
|
|
||||||
'1080': '1080p',
|
|
||||||
'4k': '4k'
|
'4k': '4k'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,11 +163,11 @@ HW_DECODERS = [
|
|||||||
'dxva2',
|
'dxva2',
|
||||||
'videotoolbox',
|
'videotoolbox',
|
||||||
'mediacodecndk',
|
'mediacodecndk',
|
||||||
'vaapi'
|
'vaapi',
|
||||||
|
'nvdec'
|
||||||
]
|
]
|
||||||
HW_ENCODERS = [
|
HW_ENCODERS = [
|
||||||
'qsv',
|
'qsv',
|
||||||
'nvenc',
|
|
||||||
'mf',
|
'mf',
|
||||||
'videotoolbox',
|
'videotoolbox',
|
||||||
'mediacodecndk',
|
'mediacodecndk',
|
||||||
@@ -366,8 +361,10 @@ NOTIFICATION_PARAMETERS = [
|
|||||||
{'name': 'Stream Video Bitrate', 'type': 'int', 'value': 'stream_video_bitrate', 'description': 'The video bitrate (in kbps) of the stream.'},
|
{'name': 'Stream Video Bitrate', 'type': 'int', 'value': 'stream_video_bitrate', 'description': 'The video bitrate (in kbps) of the stream.'},
|
||||||
{'name': 'Stream Video Bit Depth', 'type': 'int', 'value': 'stream_video_bit_depth', 'description': 'The video bit depth of the stream.'},
|
{'name': 'Stream Video Bit Depth', 'type': 'int', 'value': 'stream_video_bit_depth', 'description': 'The video bit depth of the stream.'},
|
||||||
{'name': 'Stream Video Framerate', 'type': 'str', 'value': 'stream_video_framerate', 'description': 'The video framerate of the stream.'},
|
{'name': 'Stream Video Framerate', 'type': 'str', 'value': 'stream_video_framerate', 'description': 'The video framerate of the stream.'},
|
||||||
|
{'name': 'Stream Video Full Resolution', 'type': 'str', 'value': 'stream_video_full_resolution', 'description': 'The video resolution of the stream with scan type.'},
|
||||||
{'name': 'Stream Video Ref Frames', 'type': 'int', 'value': 'stream_video_ref_frames', 'description': 'The video reference frames of the stream.'},
|
{'name': 'Stream Video Ref Frames', 'type': 'int', 'value': 'stream_video_ref_frames', 'description': 'The video reference frames of the stream.'},
|
||||||
{'name': 'Stream Video Resolution', 'type': 'str', 'value': 'stream_video_resolution', 'description': 'The video resolution of the stream.'},
|
{'name': 'Stream Video Resolution', 'type': 'str', 'value': 'stream_video_resolution', 'description': 'The video resolution of the stream.'},
|
||||||
|
{'name': 'Stream Video Scan Type', 'type': 'str', 'value': 'stream_video_scan_type', 'description': 'The video scan type of the stream.'},
|
||||||
{'name': 'Stream Video Height', 'type': 'int', 'value': 'stream_video_height', 'description': 'The video height of the stream.'},
|
{'name': 'Stream Video Height', 'type': 'int', 'value': 'stream_video_height', 'description': 'The video height of the stream.'},
|
||||||
{'name': 'Stream Video Width', 'type': 'int', 'value': 'stream_video_width', 'description': 'The video width of the stream.'},
|
{'name': 'Stream Video Width', 'type': 'int', 'value': 'stream_video_width', 'description': 'The video width of the stream.'},
|
||||||
{'name': 'Stream Video Language', 'type': 'str', 'value': 'stream_video_language', 'description': 'The video language of the stream.'},
|
{'name': 'Stream Video Language', 'type': 'str', 'value': 'stream_video_language', 'description': 'The video language of the stream.'},
|
||||||
@@ -430,7 +427,7 @@ NOTIFICATION_PARAMETERS = [
|
|||||||
{'name': 'Album Count', 'type': 'int', 'value': 'album_count', 'description': 'The number of albums.'},
|
{'name': 'Album Count', 'type': 'int', 'value': 'album_count', 'description': 'The number of albums.'},
|
||||||
{'name': 'Track Count', 'type': 'int', 'value': 'track_count', 'description': 'The number of tracks.'},
|
{'name': 'Track Count', 'type': 'int', 'value': 'track_count', 'description': 'The number of tracks.'},
|
||||||
{'name': 'Year', 'type': 'int', 'value': 'year', 'description': 'The release year for the item.'},
|
{'name': 'Year', 'type': 'int', 'value': 'year', 'description': 'The release year for the item.'},
|
||||||
{'name': 'Release Date', 'type': 'int', 'value': 'release_date', 'description': 'The release date (in date format) for the item.'},
|
{'name': 'Release Date', 'type': 'str', 'value': 'release_date', 'description': 'The release date (in date format) for the item.'},
|
||||||
{'name': 'Air Date', 'type': 'str', 'value': 'air_date', 'description': 'The air date (in date format) for the item.'},
|
{'name': 'Air Date', 'type': 'str', 'value': 'air_date', 'description': 'The air date (in date format) for the item.'},
|
||||||
{'name': 'Added Date', 'type': 'str', 'value': 'added_date', 'description': 'The date (in date format) the item was added to Plex.'},
|
{'name': 'Added Date', 'type': 'str', 'value': 'added_date', 'description': 'The date (in date format) the item was added to Plex.'},
|
||||||
{'name': 'Updated Date', 'type': 'str', 'value': 'updated_date', 'description': 'The date (in date format) the item was updated on Plex.'},
|
{'name': 'Updated Date', 'type': 'str', 'value': 'updated_date', 'description': 'The date (in date format) the item was updated on Plex.'},
|
||||||
@@ -469,8 +466,10 @@ NOTIFICATION_PARAMETERS = [
|
|||||||
{'name': 'Video Bitrate', 'type': 'int', 'value': 'video_bitrate', 'description': 'The video bitrate of the original media.'},
|
{'name': 'Video Bitrate', 'type': 'int', 'value': 'video_bitrate', 'description': 'The video bitrate of the original media.'},
|
||||||
{'name': 'Video Bit Depth', 'type': 'int', 'value': 'video_bit_depth', 'description': 'The video bit depth of the original media.'},
|
{'name': 'Video Bit Depth', 'type': 'int', 'value': 'video_bit_depth', 'description': 'The video bit depth of the original media.'},
|
||||||
{'name': 'Video Framerate', 'type': 'str', 'value': 'video_framerate', 'description': 'The video framerate of the original media.'},
|
{'name': 'Video Framerate', 'type': 'str', 'value': 'video_framerate', 'description': 'The video framerate of the original media.'},
|
||||||
|
{'name': 'Video Full Resolution', 'type': 'str', 'value': 'video_full_resolution', 'description': 'The video resolution of the original media with scan type.'},
|
||||||
{'name': 'Video Ref Frames', 'type': 'int', 'value': 'video_ref_frames', 'description': 'The video reference frames of the original media.'},
|
{'name': 'Video Ref Frames', 'type': 'int', 'value': 'video_ref_frames', 'description': 'The video reference frames of the original media.'},
|
||||||
{'name': 'Video Resolution', 'type': 'str', 'value': 'video_resolution', 'description': 'The video resolution of the original media.'},
|
{'name': 'Video Resolution', 'type': 'str', 'value': 'video_resolution', 'description': 'The video resolution of the original media.'},
|
||||||
|
{'name': 'Video Scan Tpye', 'type': 'str', 'value': 'video_scan_type', 'description': 'The video scan type of the original media.'},
|
||||||
{'name': 'Video Height', 'type': 'int', 'value': 'video_height', 'description': 'The video height of the original media.'},
|
{'name': 'Video Height', 'type': 'int', 'value': 'video_height', 'description': 'The video height of the original media.'},
|
||||||
{'name': 'Video Width', 'type': 'int', 'value': 'video_width', 'description': 'The video width of the original media.'},
|
{'name': 'Video Width', 'type': 'int', 'value': 'video_width', 'description': 'The video width of the original media.'},
|
||||||
{'name': 'Video Language', 'type': 'str', 'value': 'video_language', 'description': 'The video language of the original media.'},
|
{'name': 'Video Language', 'type': 'str', 'value': 'video_language', 'description': 'The video language of the original media.'},
|
||||||
|
@@ -297,7 +297,7 @@ class DataFactory(object):
|
|||||||
' >= datetime("now", "-%s days", "localtime") ' \
|
' >= datetime("now", "-%s days", "localtime") ' \
|
||||||
' AND session_history.media_type = "movie" ' \
|
' AND session_history.media_type = "movie" ' \
|
||||||
' GROUP BY %s) AS t ' \
|
' GROUP BY %s) AS t ' \
|
||||||
'GROUP BY t.full_title ' \
|
'GROUP BY t.full_title, t.year ' \
|
||||||
'ORDER BY %s DESC, started DESC ' \
|
'ORDER BY %s DESC, started DESC ' \
|
||||||
'LIMIT %s ' % (time_range, group_by, sort_type, stats_count)
|
'LIMIT %s ' % (time_range, group_by, sort_type, stats_count)
|
||||||
result = monitor_db.select(query)
|
result = monitor_db.select(query)
|
||||||
@@ -348,7 +348,7 @@ class DataFactory(object):
|
|||||||
' >= datetime("now", "-%s days", "localtime") ' \
|
' >= datetime("now", "-%s days", "localtime") ' \
|
||||||
' AND session_history.media_type = "movie" ' \
|
' AND session_history.media_type = "movie" ' \
|
||||||
' GROUP BY %s) AS t ' \
|
' GROUP BY %s) AS t ' \
|
||||||
'GROUP BY t.full_title ' \
|
'GROUP BY t.full_title, t.year ' \
|
||||||
'ORDER BY users_watched DESC, %s DESC, started DESC ' \
|
'ORDER BY users_watched DESC, %s DESC, started DESC ' \
|
||||||
'LIMIT %s ' % (time_range, group_by, sort_type, stats_count)
|
'LIMIT %s ' % (time_range, group_by, sort_type, stats_count)
|
||||||
result = monitor_db.select(query)
|
result = monitor_db.select(query)
|
||||||
|
@@ -784,8 +784,10 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m
|
|||||||
'stream_video_bitrate': notify_params['stream_video_bitrate'],
|
'stream_video_bitrate': notify_params['stream_video_bitrate'],
|
||||||
'stream_video_bit_depth': notify_params['stream_video_bit_depth'],
|
'stream_video_bit_depth': notify_params['stream_video_bit_depth'],
|
||||||
'stream_video_framerate': notify_params['stream_video_framerate'],
|
'stream_video_framerate': notify_params['stream_video_framerate'],
|
||||||
|
'stream_video_full_resolution': notify_params['stream_video_full_resolution'],
|
||||||
'stream_video_ref_frames': notify_params['stream_video_ref_frames'],
|
'stream_video_ref_frames': notify_params['stream_video_ref_frames'],
|
||||||
'stream_video_resolution': notify_params['stream_video_resolution'],
|
'stream_video_resolution': notify_params['stream_video_resolution'],
|
||||||
|
'stream_video_scan_type': notify_params['stream_video_scan_type'],
|
||||||
'stream_video_height': notify_params['stream_video_height'],
|
'stream_video_height': notify_params['stream_video_height'],
|
||||||
'stream_video_width': notify_params['stream_video_width'],
|
'stream_video_width': notify_params['stream_video_width'],
|
||||||
'stream_video_language': notify_params['stream_video_language'],
|
'stream_video_language': notify_params['stream_video_language'],
|
||||||
@@ -890,8 +892,10 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m
|
|||||||
'video_bitrate': notify_params['video_bitrate'],
|
'video_bitrate': notify_params['video_bitrate'],
|
||||||
'video_bit_depth': notify_params['video_bit_depth'],
|
'video_bit_depth': notify_params['video_bit_depth'],
|
||||||
'video_framerate': notify_params['video_framerate'],
|
'video_framerate': notify_params['video_framerate'],
|
||||||
|
'video_full_resolution': notify_params['video_full_resolution'],
|
||||||
'video_ref_frames': notify_params['video_ref_frames'],
|
'video_ref_frames': notify_params['video_ref_frames'],
|
||||||
'video_resolution': notify_params['video_resolution'],
|
'video_resolution': notify_params['video_resolution'],
|
||||||
|
'video_scan_type': notify_params['video_scan_type'],
|
||||||
'video_height': notify_params['height'],
|
'video_height': notify_params['height'],
|
||||||
'video_width': notify_params['width'],
|
'video_width': notify_params['width'],
|
||||||
'video_language': notify_params['video_language'],
|
'video_language': notify_params['video_language'],
|
||||||
@@ -1101,6 +1105,8 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None,
|
|||||||
|
|
||||||
|
|
||||||
def strip_tag(data, agent_id=None):
|
def strip_tag(data, agent_id=None):
|
||||||
|
# Substitute temporary tokens for < and > in parameter prefix and suffix
|
||||||
|
data = re.sub(r'{.+?}', lambda m: m.group().replace('<', '%temp_lt_token%').replace('>', '%temp_gt_token%'), data)
|
||||||
|
|
||||||
if agent_id == 7:
|
if agent_id == 7:
|
||||||
# Allow tags b, i, u, a[href], font[color] for Pushover
|
# Allow tags b, i, u, a[href], font[color] for Pushover
|
||||||
@@ -1109,11 +1115,11 @@ def strip_tag(data, agent_id=None):
|
|||||||
'u': [],
|
'u': [],
|
||||||
'a': ['href'],
|
'a': ['href'],
|
||||||
'font': ['color']}
|
'font': ['color']}
|
||||||
return bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
||||||
|
|
||||||
elif agent_id in (10, 14, 20):
|
elif agent_id in (10, 14, 20):
|
||||||
# Don't remove tags for Email, Slack, and Discord
|
# Don't remove tags for Email, Slack, and Discord
|
||||||
return data
|
pass
|
||||||
|
|
||||||
elif agent_id == 13:
|
elif agent_id == 13:
|
||||||
# Allow tags b, i, code, pre, a[href] for Telegram
|
# Allow tags b, i, code, pre, a[href] for Telegram
|
||||||
@@ -1122,11 +1128,14 @@ def strip_tag(data, agent_id=None):
|
|||||||
'code': [],
|
'code': [],
|
||||||
'pre': [],
|
'pre': [],
|
||||||
'a': ['href']}
|
'a': ['href']}
|
||||||
return bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
whitelist = {}
|
whitelist = {}
|
||||||
return bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
||||||
|
|
||||||
|
# Resubstitute temporary tokens for < and > in parameter prefix and suffix
|
||||||
|
return data.replace('%temp_lt_token%', '<').replace('%temp_gt_token%', '>')
|
||||||
|
|
||||||
|
|
||||||
def format_group_index(group_keys):
|
def format_group_index(group_keys):
|
||||||
|
@@ -1242,6 +1242,7 @@ class PmsConnect(object):
|
|||||||
'video_language': helpers.get_xml_attr(stream, 'language'),
|
'video_language': helpers.get_xml_attr(stream, 'language'),
|
||||||
'video_language_code': helpers.get_xml_attr(stream, 'languageCode'),
|
'video_language_code': helpers.get_xml_attr(stream, 'languageCode'),
|
||||||
'video_profile': helpers.get_xml_attr(stream, 'profile'),
|
'video_profile': helpers.get_xml_attr(stream, 'profile'),
|
||||||
|
'video_scan_type': helpers.get_xml_attr(stream, 'scanType'),
|
||||||
'selected': int(helpers.get_xml_attr(stream, 'selected') == '1')
|
'selected': int(helpers.get_xml_attr(stream, 'selected') == '1')
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1290,7 +1291,7 @@ class PmsConnect(object):
|
|||||||
'width': helpers.get_xml_attr(media, 'width'),
|
'width': helpers.get_xml_attr(media, 'width'),
|
||||||
'aspect_ratio': helpers.get_xml_attr(media, 'aspectRatio'),
|
'aspect_ratio': helpers.get_xml_attr(media, 'aspectRatio'),
|
||||||
'video_codec': helpers.get_xml_attr(media, 'videoCodec'),
|
'video_codec': helpers.get_xml_attr(media, 'videoCodec'),
|
||||||
'video_resolution': helpers.get_xml_attr(media, 'videoResolution'),
|
'video_resolution': helpers.get_xml_attr(media, 'videoResolution').lower(),
|
||||||
'video_framerate': helpers.get_xml_attr(media, 'videoFrameRate'),
|
'video_framerate': helpers.get_xml_attr(media, 'videoFrameRate'),
|
||||||
'video_profile': helpers.get_xml_attr(media, 'videoProfile'),
|
'video_profile': helpers.get_xml_attr(media, 'videoProfile'),
|
||||||
'audio_codec': helpers.get_xml_attr(media, 'audioCodec'),
|
'audio_codec': helpers.get_xml_attr(media, 'audioCodec'),
|
||||||
@@ -1644,13 +1645,16 @@ class PmsConnect(object):
|
|||||||
video_stream_info = audio_stream_info = subtitle_stream_info = None
|
video_stream_info = audio_stream_info = subtitle_stream_info = None
|
||||||
for stream in stream_media_parts_info.getElementsByTagName('Stream'):
|
for stream in stream_media_parts_info.getElementsByTagName('Stream'):
|
||||||
if helpers.get_xml_attr(stream, 'streamType') == '1':
|
if helpers.get_xml_attr(stream, 'streamType') == '1':
|
||||||
video_stream_info = stream
|
if video_stream_info is None or helpers.get_xml_attr(stream, 'selected') == '1':
|
||||||
|
video_stream_info = stream
|
||||||
|
|
||||||
elif helpers.get_xml_attr(stream, 'streamType') == '2' and helpers.get_xml_attr(stream, 'selected') == '1':
|
elif helpers.get_xml_attr(stream, 'streamType') == '2':
|
||||||
audio_stream_info = stream
|
if audio_stream_info is None or helpers.get_xml_attr(stream, 'selected') == '1':
|
||||||
|
audio_stream_info = stream
|
||||||
|
|
||||||
elif helpers.get_xml_attr(stream, 'streamType') == '3' and helpers.get_xml_attr(stream, 'selected') == '1':
|
elif helpers.get_xml_attr(stream, 'streamType') == '3':
|
||||||
subtitle_stream_info = stream
|
if subtitle_stream_info is None or helpers.get_xml_attr(stream, 'selected') == '1':
|
||||||
|
subtitle_stream_info = stream
|
||||||
|
|
||||||
video_id = audio_id = subtitle_id = None
|
video_id = audio_id = subtitle_id = None
|
||||||
if video_stream_info:
|
if video_stream_info:
|
||||||
@@ -1661,6 +1665,7 @@ class PmsConnect(object):
|
|||||||
'stream_video_ref_frames': helpers.get_xml_attr(video_stream_info, 'refFrames'),
|
'stream_video_ref_frames': helpers.get_xml_attr(video_stream_info, 'refFrames'),
|
||||||
'stream_video_language': helpers.get_xml_attr(video_stream_info, 'language'),
|
'stream_video_language': helpers.get_xml_attr(video_stream_info, 'language'),
|
||||||
'stream_video_language_code': helpers.get_xml_attr(video_stream_info, 'languageCode'),
|
'stream_video_language_code': helpers.get_xml_attr(video_stream_info, 'languageCode'),
|
||||||
|
'stream_video_scan_type': helpers.get_xml_attr(video_stream_info, 'scanType'),
|
||||||
'stream_video_decision': helpers.get_xml_attr(video_stream_info, 'decision') or 'direct play'
|
'stream_video_decision': helpers.get_xml_attr(video_stream_info, 'decision') or 'direct play'
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
@@ -1670,6 +1675,7 @@ class PmsConnect(object):
|
|||||||
'stream_video_ref_frames': '',
|
'stream_video_ref_frames': '',
|
||||||
'stream_video_language': '',
|
'stream_video_language': '',
|
||||||
'stream_video_language_code': '',
|
'stream_video_language_code': '',
|
||||||
|
'stream_video_scan_type': '',
|
||||||
'stream_video_decision': ''
|
'stream_video_decision': ''
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1730,7 +1736,7 @@ class PmsConnect(object):
|
|||||||
if helpers.cast_to_int(stream_video_width) >= 3840:
|
if helpers.cast_to_int(stream_video_width) >= 3840:
|
||||||
stream_video_resolution = '4k'
|
stream_video_resolution = '4k'
|
||||||
else:
|
else:
|
||||||
stream_video_resolution = helpers.get_xml_attr(stream_media_info, 'videoResolution').rstrip('p')
|
stream_video_resolution = helpers.get_xml_attr(stream_media_info, 'videoResolution').rstrip('p').lower()
|
||||||
|
|
||||||
stream_audio_channels = helpers.get_xml_attr(stream_media_info, 'audioChannels')
|
stream_audio_channels = helpers.get_xml_attr(stream_media_info, 'audioChannels')
|
||||||
|
|
||||||
@@ -1810,7 +1816,7 @@ class PmsConnect(object):
|
|||||||
'height': helpers.get_xml_attr(stream_media_info, 'height'),
|
'height': helpers.get_xml_attr(stream_media_info, 'height'),
|
||||||
'width': helpers.get_xml_attr(stream_media_info, 'width'),
|
'width': helpers.get_xml_attr(stream_media_info, 'width'),
|
||||||
'video_codec': helpers.get_xml_attr(stream_media_info, 'videoCodec'),
|
'video_codec': helpers.get_xml_attr(stream_media_info, 'videoCodec'),
|
||||||
'video_resolution': helpers.get_xml_attr(stream_media_info, 'videoResolution'),
|
'video_resolution': helpers.get_xml_attr(stream_media_info, 'videoResolution').lower(),
|
||||||
'audio_codec': helpers.get_xml_attr(stream_media_info, 'audioCodec'),
|
'audio_codec': helpers.get_xml_attr(stream_media_info, 'audioCodec'),
|
||||||
'audio_channels': audio_channels,
|
'audio_channels': audio_channels,
|
||||||
'audio_channel_layout': common.AUDIO_CHANNELS.get(audio_channels, audio_channels),
|
'audio_channel_layout': common.AUDIO_CHANNELS.get(audio_channels, audio_channels),
|
||||||
@@ -1849,6 +1855,7 @@ class PmsConnect(object):
|
|||||||
'video_width': '',
|
'video_width': '',
|
||||||
'video_language': '',
|
'video_language': '',
|
||||||
'video_language_code': '',
|
'video_language_code': '',
|
||||||
|
'video_scan_type': '',
|
||||||
'video_profile': ''
|
'video_profile': ''
|
||||||
}
|
}
|
||||||
source_audio_details = {'id': '',
|
source_audio_details = {'id': '',
|
||||||
@@ -1919,6 +1926,15 @@ class PmsConnect(object):
|
|||||||
if transcode_details['transcode_video_codec'] == '*':
|
if transcode_details['transcode_video_codec'] == '*':
|
||||||
transcode_details['transcode_video_codec'] = source_video_details['video_codec']
|
transcode_details['transcode_video_codec'] = source_video_details['video_codec']
|
||||||
|
|
||||||
|
# Set the full resolution by combining video_resolution and video_scan_type
|
||||||
|
source_media_details['video_full_resolution'] = plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(
|
||||||
|
source_media_details['video_resolution'],
|
||||||
|
source_media_details['video_resolution'] + (source_video_details['video_scan_type'][:1] or 'p'))
|
||||||
|
# Set the full resolution by combining stream_video_resolution and stream_video_scan_type
|
||||||
|
stream_details['stream_video_full_resolution'] = plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(
|
||||||
|
stream_details['stream_video_resolution'],
|
||||||
|
stream_details['stream_video_resolution'] + (video_details['stream_video_scan_type'][:1] or 'p'))
|
||||||
|
|
||||||
# Get the quality profile
|
# Get the quality profile
|
||||||
if media_type in ('movie', 'episode', 'clip') and 'stream_bitrate' in stream_details:
|
if media_type in ('movie', 'episode', 'clip') and 'stream_bitrate' in stream_details:
|
||||||
if sync_id:
|
if sync_id:
|
||||||
@@ -1945,8 +1961,7 @@ class PmsConnect(object):
|
|||||||
if stream_details['optimized_version']:
|
if stream_details['optimized_version']:
|
||||||
source_bitrate = helpers.cast_to_int(source_media_details.get('bitrate'))
|
source_bitrate = helpers.cast_to_int(source_media_details.get('bitrate'))
|
||||||
optimized_version_profile = '{} Mbps {}'.format(round(source_bitrate / 1000.0, 1),
|
optimized_version_profile = '{} Mbps {}'.format(round(source_bitrate / 1000.0, 1),
|
||||||
plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(source_media_details['video_resolution'],
|
source_media_details['video_full_resolution'])
|
||||||
source_media_details['video_resolution']))
|
|
||||||
else:
|
else:
|
||||||
optimized_version_profile = ''
|
optimized_version_profile = ''
|
||||||
|
|
||||||
@@ -2467,7 +2482,7 @@ class PmsConnect(object):
|
|||||||
media_info = {'container': helpers.get_xml_attr(media, 'container'),
|
media_info = {'container': helpers.get_xml_attr(media, 'container'),
|
||||||
'bitrate': helpers.get_xml_attr(media, 'bitrate'),
|
'bitrate': helpers.get_xml_attr(media, 'bitrate'),
|
||||||
'video_codec': helpers.get_xml_attr(media, 'videoCodec'),
|
'video_codec': helpers.get_xml_attr(media, 'videoCodec'),
|
||||||
'video_resolution': helpers.get_xml_attr(media, 'videoResolution'),
|
'video_resolution': helpers.get_xml_attr(media, 'videoResolution').lower(),
|
||||||
'video_framerate': helpers.get_xml_attr(media, 'videoFrameRate'),
|
'video_framerate': helpers.get_xml_attr(media, 'videoFrameRate'),
|
||||||
'audio_codec': helpers.get_xml_attr(media, 'audioCodec'),
|
'audio_codec': helpers.get_xml_attr(media, 'audioCodec'),
|
||||||
'audio_channels': helpers.get_xml_attr(media, 'audioChannels'),
|
'audio_channels': helpers.get_xml_attr(media, 'audioChannels'),
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
PLEXPY_BRANCH = "master"
|
PLEXPY_BRANCH = "beta"
|
||||||
PLEXPY_RELEASE_VERSION = "v2.1.34"
|
PLEXPY_RELEASE_VERSION = "v2.1.35-beta"
|
||||||
|
@@ -2857,9 +2857,6 @@ class WebInterface(object):
|
|||||||
else:
|
else:
|
||||||
kwargs['http_password'] = plexpy.CONFIG.HTTP_PASSWORD
|
kwargs['http_password'] = plexpy.CONFIG.HTTP_PASSWORD
|
||||||
|
|
||||||
# Flag to refresh JWT uuid to log out clients
|
|
||||||
kwargs['jwt_update_secret'] = True
|
|
||||||
|
|
||||||
elif kwargs['http_password'] and kwargs.get('http_hash_password'):
|
elif kwargs['http_password'] and kwargs.get('http_hash_password'):
|
||||||
kwargs['http_password'] = make_hash(kwargs['http_password'])
|
kwargs['http_password'] = make_hash(kwargs['http_password'])
|
||||||
kwargs['http_hashed_password'] = 1
|
kwargs['http_hashed_password'] = 1
|
||||||
@@ -2869,6 +2866,10 @@ class WebInterface(object):
|
|||||||
|
|
||||||
elif not kwargs.get('http_hash_password'):
|
elif not kwargs.get('http_hash_password'):
|
||||||
kwargs['http_hashed_password'] = 0
|
kwargs['http_hashed_password'] = 0
|
||||||
|
|
||||||
|
# Flag to refresh JWT uuid to log out clients
|
||||||
|
kwargs['jwt_update_secret'] = True
|
||||||
|
|
||||||
else:
|
else:
|
||||||
kwargs['http_hashed_password'] = 0
|
kwargs['http_hashed_password'] = 0
|
||||||
|
|
||||||
@@ -5041,7 +5042,9 @@ class WebInterface(object):
|
|||||||
"stream_video_language": "",
|
"stream_video_language": "",
|
||||||
"stream_video_language_code": "",
|
"stream_video_language_code": "",
|
||||||
"stream_video_ref_frames": "4",
|
"stream_video_ref_frames": "4",
|
||||||
|
"stream_video_full_resolution": "1080p",
|
||||||
"stream_video_resolution": "1080",
|
"stream_video_resolution": "1080",
|
||||||
|
"stream_video_scan_type": "progressive",
|
||||||
"stream_video_width": "1920",
|
"stream_video_width": "1920",
|
||||||
"studio": "HBO",
|
"studio": "HBO",
|
||||||
"subtitle_codec": "",
|
"subtitle_codec": "",
|
||||||
@@ -5094,12 +5097,14 @@ class WebInterface(object):
|
|||||||
"video_decision": "direct play",
|
"video_decision": "direct play",
|
||||||
"video_frame_rate": "23.976",
|
"video_frame_rate": "23.976",
|
||||||
"video_framerate": "24p",
|
"video_framerate": "24p",
|
||||||
|
"video_full_resolution": "1080p",
|
||||||
"video_height": "1078",
|
"video_height": "1078",
|
||||||
"video_language": "",
|
"video_language": "",
|
||||||
"video_language_code": "",
|
"video_language_code": "",
|
||||||
"video_profile": "high",
|
"video_profile": "high",
|
||||||
"video_ref_frames": "4",
|
"video_ref_frames": "4",
|
||||||
"video_resolution": "1080",
|
"video_resolution": "1080",
|
||||||
|
"video_scan_type": "progressive",
|
||||||
"video_width": "1920",
|
"video_width": "1920",
|
||||||
"view_offset": "1000",
|
"view_offset": "1000",
|
||||||
"width": "1920",
|
"width": "1920",
|
||||||
|
Reference in New Issue
Block a user