Remove notifier Boxcar2.

This commit is contained in:
JackDandy 2025-01-20 23:55:24 +00:00
parent 9840765754
commit 986b470b2f
9 changed files with 5 additions and 268 deletions

View file

@ -16,6 +16,7 @@
* Update thefuzz 0.21.0 (0b49e4a) to 0.22.1 (83bea3d)
* Update tmdbsimple 2.9.1 (9da400a) to 2.9.2 (0b3359f)
* Update urllib3 2.2.2 (27e2a5c) to 2.3.0 (2f68c53)
* Remove notifier Boxcar2
### 3.33.1 (2025-01-20 14:50:00 UTC)

View file

@ -833,7 +833,6 @@
<div class="component-group bubblelist">
<div class="type bgcol">
<span class="list"><div class="item text">Bubble links:</div>
<div class="item"><a href="#boxcar2" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/boxcar2.png">Boxcar2</a></div>
#if 'PUSHALOT' in NotifierFactory().notifiers
<div class="item"><a href="#pushalot" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/pushalot.png">Pushalot</a></div>
#end if
@ -846,107 +845,6 @@
</div>
</div>
<div class="component-group">
<div class="component-group-desc">
<img class="notifier-icon" src="$sbRoot/images/notifiers/boxcar2.png" alt="" title="Boxcar2"/>
<h3><a name="boxcar2" href="<%= anon_url('https://boxcar.io/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Boxcar2</a></h3>
<p>Read messages where and when you want them.</p>
</div>
<fieldset class="component-group-list">
<div class="field-pair">
<label for="use-boxcar2">
<span class="component-title">Enable</span>
<span class="component-desc">
<input type="checkbox" class="enabler" name="use_boxcar2" id="use-boxcar2" #if $sickgear.USE_BOXCAR2 then 'checked="checked"' else ''#>
<p>should SickGear send Boxcar2 notifications ?</p>
</span>
</label>
</div>
<div id="content_use-boxcar2">
<div class="field-pair">
<label for="boxcar2-notify-onsnatch">
<span class="component-title">Notify on snatch</span>
<span class="component-desc">
<input type="checkbox" name="boxcar2_notify_onsnatch" id="boxcar2-notify-onsnatch" #if $sickgear.BOXCAR2_NOTIFY_ONSNATCH then 'checked="checked"' else ''#>
<p>send a notification when a download starts ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="boxcar2-notify-ondownload">
<span class="component-title">Notify on download</span>
<span class="component-desc">
<input type="checkbox" name="boxcar2_notify_ondownload" id="boxcar2-notify-ondownload" #if $sickgear.BOXCAR2_NOTIFY_ONDOWNLOAD then 'checked="checked"' else ''#>
<p>send a notification when a download finishes ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="boxcar2-notify-onsubtitledownload">
<span class="component-title">Notify on subtitle download</span>
<span class="component-desc">
<input type="checkbox" name="boxcar2_notify_onsubtitledownload" id="boxcar2-notify-onsubtitledownload" #if $sickgear.BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD then 'checked="checked"' else ''#>
<p>send a notification when subtitles are downloaded ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="boxcar2-access-token">
<span class="component-title">Boxcar2 access token</span>
<span class="component-desc">
<input type="text" name="boxcar2_access_token" id="boxcar2-access-token" value="<%= starify(sickgear.BOXCAR2_ACCESSTOKEN) %>" class="form-control input-sm input250">
</span>
</label>
</div>
<div class="field-pair">
<label for="boxcar2-sound">
<span class="component-title">Custom sound</span>
<span class="component-desc">
<select id="boxcar2-sound" name="boxcar2_sound" class="form-control input-sm">
<option value="default" #if $sickgear.BOXCAR2_SOUND == 'default' then 'selected="selected"' else ''#>Default (General)</option>
<option value="no-sound" #if $sickgear.BOXCAR2_SOUND == 'no-sound' then 'selected="selected"' else ''#>Silent</option>
<option value="beep-crisp" #if $sickgear.BOXCAR2_SOUND == 'beep-crisp' then 'selected="selected"' else ''#>Beep Crisp</option>
<option value="beep-soft" #if $sickgear.BOXCAR2_SOUND == 'beep-soft' then 'selected="selected"' else ''#>Beep Soft</option>
<option value="bell-modern" #if $sickgear.BOXCAR2_SOUND == 'bell-modern' then 'selected="selected"' else ''#>Bell Modern</option>
<option value="bell-one-tone" #if $sickgear.BOXCAR2_SOUND == 'bell-one-tone' then 'selected="selected"' else ''#>Bell One Tone</option>
<option value="bell-simple" #if $sickgear.BOXCAR2_SOUND == 'bell-simple' then 'selected="selected"' else ''#>Bell Simple</option>
<option value="bell-triple" #if $sickgear.BOXCAR2_SOUND == 'bell-triple' then 'selected="selected"' else ''#>Bell Triple</option>
<option value="bird-1" #if $sickgear.BOXCAR2_SOUND == 'bird-1' then 'selected="selected"' else ''#>Bird 1</option>
<option value="bird-2" #if $sickgear.BOXCAR2_SOUND == 'bird-2' then 'selected="selected"' else ''#>Bird 2</option>
<option value="boing" #if $sickgear.BOXCAR2_SOUND == 'boing' then 'selected="selected"' else ''#>Boing</option>
<option value="cash" #if $sickgear.BOXCAR2_SOUND == 'cash' then 'selected="selected"' else ''#>Cash</option>
<option value="clanging" #if $sickgear.BOXCAR2_SOUND == 'clanging' then 'selected="selected"' else ''#>Clanging</option>
<option value="detonator-charge" #if $sickgear.BOXCAR2_SOUND == 'detonator-charge' then 'selected="selected"' else ''#>Detonator Charge</option>
<option value="digital-alarm" #if $sickgear.BOXCAR2_SOUND == 'digital-alarm' then 'selected="selected"' else ''#>Digital Alarm</option>
<option value="done" #if $sickgear.BOXCAR2_SOUND == 'done' then 'selected="selected"' else ''#>Done</option>
<option value="echo" #if $sickgear.BOXCAR2_SOUND == 'echo' then 'selected="selected"' else ''#>Echo</option>
<option value="flourish" #if $sickgear.BOXCAR2_SOUND == 'flourish' then 'selected="selected"' else ''#>Flourish</option>
<option value="harp" #if $sickgear.BOXCAR2_SOUND == 'harp' then 'selected="selected"' else ''#>Harp</option>
<option value="light" #if $sickgear.BOXCAR2_SOUND == 'light' then 'selected="selected"' else ''#>Light</option>
<option value="magic-chime" #if $sickgear.BOXCAR2_SOUND == 'magic-chime' then 'selected="selected"' else ''#>Magic Chime</option>
<option value="magic-coin" #if $sickgear.BOXCAR2_SOUND == 'magic-coin' then 'selected="selected"' else ''#>Magic Coin 1</option>
<option value="notifier-1" #if $sickgear.BOXCAR2_SOUND == 'notifier-1' then 'selected="selected"' else ''#>Notifier 1</option>
<option value="notifier-2" #if $sickgear.BOXCAR2_SOUND == 'notifier-2' then 'selected="selected"' else ''#>Notifier 2</option>
<option value="notifier-3" #if $sickgear.BOXCAR2_SOUND == 'notifier-3' then 'selected="selected"' else ''#>Notifier 3</option>
<option value="orchestral-long" #if $sickgear.BOXCAR2_SOUND == 'orchestral-long' then 'selected="selected"' else ''#>Orchestral Long</option>
<option value="orchestral-short" #if $sickgear.BOXCAR2_SOUND == 'orchestral-short' then 'selected="selected"' else ''#>Orchestral Short</option>
<option value="score" #if $sickgear.BOXCAR2_SOUND == 'score' then 'selected="selected"' else ''#>Score</option>
<option value="success" #if $sickgear.BOXCAR2_SOUND == 'success' then 'selected="selected"' else ''#>Success</option>
<option value="up" #if $sickgear.BOXCAR2_SOUND == 'up' then 'selected="selected"' else ''#>Up</option>
</select>
<div class="clear-left">override the default sound selected for the general notification</div>
</span>
</label>
</div>
<div class="test-notification" id="test-boxcar2-result">Click below to test</div>
<input class="btn" type="button" value="Test Boxcar2" id="test-boxcar2">
<input type="submit" class="config_submitter btn" value="Save Changes">
</div><!-- /content_use-boxcar2 //-->
</fieldset>
</div><!-- /boxcar2 component-group //-->
#if 'PUSHALOT' in NotifierFactory().notifiers
<div class="component-group">

View file

@ -177,25 +177,6 @@ $(document).ready(function(){
});
});
$('#test-boxcar2').click(function () {
var boxcarAccesstoken = $.trim($('#boxcar2-access-token').val());
var boxcarSound = $('#boxcar2-sound').val() || 'default';
if (!boxcarAccesstoken) {
$('#test-boxcar2-result').html('Please fill out the necessary fields above.');
$('#boxcar2-access-token').addClass('warning');
return;
}
$('#boxcar2-access-token').removeClass('warning');
$(this).prop('disabled', !0);
$('#test-boxcar2-result').html(loading);
$.get(sbRoot + '/home/test-boxcar2',
{access_token: boxcarAccesstoken, sound: boxcarSound})
.done(function (data) {
$('#test-boxcar2-result').html(data);
$('#test-boxcar2').prop('disabled', !1);
});
});
$('#test-pushover').click(function () {
var pushover$ = $('#pushover-userkey'), pushoverUserkey = $.trim(pushover$.val()),
pushoverApikey$ = $('#pushover-apikey'), pushoverApikey = $.trim(pushoverApikey$.val()),

View file

@ -68,7 +68,7 @@ Other features and worthy points;
* Known and user editable alternative numbered seasons and/or episodes can be searched
* Forward search results directly to clients like NZBGet, SABNZBd, qBitTorrent, Deluge and others
* Save search results to a "blackhole" folder, a place designated for clients to auto scan
* Built-in post processing of episodes, with renaming to custom folder and/or file names
* Built-in post-processing of episodes, with renaming to custom folder and/or file names
* Fetch metadata like fanart, poster and banner images, nfo's for clients like Kodi, Emby, Plex, Jellyfin and many more
* Native advanced automated handling of failed downloads to ensure a success after failure
* Overview of episodes, rating, version, airdate, episode status ([their meaning](https://github.com/SickGear/SickGear/wiki/Status-Modes))
@ -80,7 +80,7 @@ Other features and worthy points;
* Notification
* Home Theater/NAS (Emby, Kodi, Plex, Syno, Tivo, and more) can be notified to update their library
* Social notifiers (Trakt, Slack, Gitter, Discord, E-mail, and more)
* Device notifiers (Boxcar2, Growl, Prowl, and more)
* Device notifiers (Growl, Prowl, and more)
* Server friendly with minimal number of API calls using both active and passive search tech
* Automated alternative show names and episode numbering from XEM

View file

@ -405,13 +405,6 @@ PYTIVO_HOST = ''
PYTIVO_SHARE_NAME = ''
PYTIVO_TIVO_NAME = ''
USE_BOXCAR2 = False
BOXCAR2_NOTIFY_ONSNATCH = False
BOXCAR2_NOTIFY_ONDOWNLOAD = False
BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD = False
BOXCAR2_ACCESSTOKEN = None
BOXCAR2_SOUND = None
USE_PUSHBULLET = False
PUSHBULLET_NOTIFY_ONSNATCH = False
PUSHBULLET_NOTIFY_ONDOWNLOAD = False
@ -764,8 +757,6 @@ def init_stage_1(console_logging):
LIBNOTIFY_NOTIFY_ONSUBTITLEDOWNLOAD, \
USE_PUSHOVER, PUSHOVER_NOTIFY_ONSNATCH, PUSHOVER_NOTIFY_ONDOWNLOAD, PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD, \
PUSHOVER_USERKEY, PUSHOVER_APIKEY, PUSHOVER_PRIORITY, PUSHOVER_DEVICE, PUSHOVER_SOUND, \
USE_BOXCAR2, BOXCAR2_NOTIFY_ONSNATCH, BOXCAR2_NOTIFY_ONDOWNLOAD, BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD, \
BOXCAR2_ACCESSTOKEN, BOXCAR2_SOUND, \
USE_PUSHALOT, PUSHALOT_NOTIFY_ONSNATCH, PUSHALOT_NOTIFY_ONDOWNLOAD, \
PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHALOT_AUTHORIZATIONTOKEN, \
USE_PUSHBULLET, PUSHBULLET_NOTIFY_ONSNATCH, PUSHBULLET_NOTIFY_ONDOWNLOAD, \
@ -794,7 +785,7 @@ def init_stage_1(console_logging):
global UPDATES_TODO
for stanza in ('General', 'Blackhole', 'SABnzbd', 'NZBGet', 'Emby', 'Kodi', 'XBMC', 'PLEX',
'Growl', 'Prowl', 'Slack', 'Discord', 'Boxcar2', 'NMJ', 'NMJv2',
'Growl', 'Prowl', 'Slack', 'Discord', 'NMJ', 'NMJv2',
'Synology', 'SynologyNotifier',
'pyTivo', 'Pushalot', 'Pushbullet', 'Subtitles'):
check_section(CFG, stanza)
@ -1153,14 +1144,6 @@ def init_stage_1(console_logging):
PROWL_API = check_setting_str(CFG, 'Prowl', 'prowl_api', '')
PROWL_PRIORITY = check_setting_str(CFG, 'Prowl', 'prowl_priority', '0')
USE_BOXCAR2 = bool(check_setting_int(CFG, 'Boxcar2', 'use_boxcar2', 0))
BOXCAR2_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Boxcar2', 'boxcar2_notify_onsnatch', 0))
BOXCAR2_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Boxcar2', 'boxcar2_notify_ondownload', 0))
BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
check_setting_int(CFG, 'Boxcar2', 'boxcar2_notify_onsubtitledownload', 0))
BOXCAR2_ACCESSTOKEN = check_setting_str(CFG, 'Boxcar2', 'boxcar2_accesstoken', '')
BOXCAR2_SOUND = check_setting_str(CFG, 'Boxcar2', 'boxcar2_sound', 'default')
USE_PUSHOVER = bool(check_setting_int(CFG, 'Pushover', 'use_pushover', 0))
PUSHOVER_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Pushover', 'pushover_notify_onsnatch', 0))
PUSHOVER_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Pushover', 'pushover_notify_ondownload', 0))
@ -2238,11 +2221,6 @@ def _save_config(force=False, **kwargs):
('share_name', PYTIVO_SHARE_NAME),
('tivo_name', PYTIVO_TIVO_NAME),
]),
('Boxcar2', [
('use_%s', int(USE_BOXCAR2)),
('accesstoken', BOXCAR2_ACCESSTOKEN),
('sound', BOXCAR2_SOUND if 'default' != BOXCAR2_SOUND else None),
]),
('Pushbullet', [
('use_%s', int(USE_PUSHBULLET)),
('access_token', PUSHBULLET_ACCESS_TOKEN),
@ -2365,7 +2343,6 @@ def _save_config(force=False, **kwargs):
('SynologyNotifier', SYNOLOGYNOTIFIER_NOTIFY_ONSNATCH, SYNOLOGYNOTIFIER_NOTIFY_ONDOWNLOAD,
SYNOLOGYNOTIFIER_NOTIFY_ONSUBTITLEDOWNLOAD),
('Boxcar2', BOXCAR2_NOTIFY_ONSNATCH, BOXCAR2_NOTIFY_ONDOWNLOAD, BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD),
('Pushbullet', PUSHBULLET_NOTIFY_ONSNATCH, PUSHBULLET_NOTIFY_ONDOWNLOAD, PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD),
('Pushover', PUSHOVER_NOTIFY_ONSNATCH, PUSHOVER_NOTIFY_ONDOWNLOAD, PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD),
('Growl', GROWL_NOTIFY_ONSNATCH, GROWL_NOTIFY_ONDOWNLOAD, GROWL_NOTIFY_ONSUBTITLEDOWNLOAD),

View file

@ -20,7 +20,7 @@ import re
# import pushalot
# from lib import api_trakt
from . import emby, kodi, plex, xbmc, \
boxcar2, nmj, nmjv2, pushbullet, pushover, pytivo, synoindex, synologynotifier, \
nmj, nmjv2, pushbullet, pushover, pytivo, synoindex, synologynotifier, \
discord, emailnotify, gitter, libnotify, growl, prowl, slack, telegram, trakt
import sickgear
@ -42,7 +42,6 @@ class NotifierFactory(object):
PYTIVO=pytivo.PyTivoNotifier,
# devices,
BOXCAR2=boxcar2.Boxcar2Notifier,
# PUSHALOT=pushalot.PushalotNotifier,
PUSHBULLET=pushbullet.PushbulletNotifier,
PUSHOVER=pushover.PushoverNotifier,

View file

@ -1,99 +0,0 @@
# Author: Rafael Silva <rpluto@gmail.com>
# Author: Marvin Pinto <me@marvinp.ca>
# Author: Dennis Lutter <lad1337@gmail.com>
#
# This file is part of SickGear.
#
# SickGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SickGear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
from .generic import Notifier
import sickgear
from exceptions_helper import ex
from _23 import decode_bytes, decode_str, urlencode
# noinspection PyUnresolvedReferences
from six.moves import urllib
class Boxcar2Notifier(Notifier):
def __init__(self):
super(Boxcar2Notifier, self).__init__()
self.sg_logo_file = 'apple-touch-icon-60x60.png'
def _notify(self, title, body, access_token=None, sound=None, **kwargs):
"""
Sends a boxcar2 notification to the address provided
title: The title of the message
body: The message to send
access_token: To send to this device
sound: Sound profile to use
returns: True if the message succeeded, False otherwise
"""
access_token = self._choose(access_token, sickgear.BOXCAR2_ACCESSTOKEN)
sound = self._choose(sound, sickgear.BOXCAR2_SOUND)
# build up the URL and parameters
# more info goes here -
# https://boxcar.uservoice.com/knowledgebase/articles/306788-how-to-send-your-boxcar-account-a-notification
body = decode_str(body.strip())
data = urlencode({
'user_credentials': access_token,
'notification[title]': '%s - %s' % (title, body),
'notification[long_message]': body,
'notification[sound]': sound,
'notification[source_name]': 'SickGear',
'notification[icon_url]': self._sg_logo_url
})
# send the request to boxcar2
result = None
try:
req = urllib.request.Request('https://new.boxcar.io/api/notifications')
# PY2 http_response_obj has no `with` context manager
http_response_obj = urllib.request.urlopen(req, decode_bytes(data))
http_response_obj.close()
except urllib.error.HTTPError as e:
if not hasattr(e, 'code'):
self._log_error(f'Notification failed: {ex(e)}')
else:
result = 'Notification failed. Error code: %s' % e.code
self._log_error(result)
if 503 == e.code:
result = 'Server too busy to handle the request at this time'
self._log_warning(result)
else:
if 404 == e.code:
result = 'Access token is wrong/not associated to a device'
self._log_error(result)
elif 401 == e.code:
result = 'Access token not recognized'
self._log_error(result)
elif 400 == e.code:
result = 'Wrong data sent to Boxcar'
self._log_error(result)
except urllib.error.URLError as e:
self._log_error(f'Notification failed: ex(e)')
return self._choose((True, 'Failed to send notification: %s' % result)[bool(result)], not bool(result))
notifier = Boxcar2Notifier

View file

@ -715,7 +715,6 @@ class GenericProvider(object):
(sickgear.EMBY_APIKEY, 'emby_apikey'), (sickgear.KODI_PASSWORD, 'kodi_password'),
(sickgear.PLEX_PASSWORD, 'plex_password'), (sickgear.XBMC_PASSWORD, 'xbmc_password'),
(sickgear.EMAIL_PASSWORD, 'email_password'), (sickgear.ANIDB_PASSWORD, 'anidb_password'),
(sickgear.BOXCAR2_ACCESSTOKEN, 'boxcar2_accesstoken'),
(sickgear.DISCORD_ACCESS_TOKEN, 'discord_access_token'),
(sickgear.GITTER_ACCESS_TOKEN, 'gitter_access_token'),
(('', sickgear.GROWL_HOST[:sickgear.GROWL_HOST.find('@')])['@' in sickgear.GROWL_HOST], 'growl_host'),

View file

@ -1834,14 +1834,6 @@ class Home(MainHandler):
host = config.clean_host(host)
return notifiers.NotifierFactory().get('NMJV2').notify_settings(unquote_plus(host), dbloc, instance)
def test_boxcar2(self, access_token=None, sound=None):
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
if None is not access_token and starify(access_token, True):
access_token = sickgear.BOXCAR2_ACCESSTOKEN
return notifiers.NotifierFactory().get('BOXCAR2').test_notify(access_token, sound)
def test_pushbullet(self, access_token=None, device_iden=None):
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
@ -9667,8 +9659,6 @@ class ConfigNotifications(Config):
synologynotifier_notify_ondownload=None, synologynotifier_notify_onsubtitledownload=None,
use_pytivo=None, pytivo_host=None, pytivo_share_name=None, pytivo_tivo_name=None,
use_boxcar2=None, boxcar2_notify_onsnatch=None, boxcar2_notify_ondownload=None,
boxcar2_notify_onsubtitledownload=None, boxcar2_access_token=None, boxcar2_sound=None,
use_pushbullet=None, pushbullet_notify_onsnatch=None, pushbullet_notify_ondownload=None,
pushbullet_notify_onsubtitledownload=None, pushbullet_access_token=None, pushbullet_device_iden=None,
use_pushover=None, pushover_notify_onsnatch=None, pushover_notify_ondownload=None,
@ -9768,15 +9758,6 @@ class ConfigNotifications(Config):
sickgear.PROWL_API = key
sickgear.PROWL_PRIORITY = prowl_priority
sickgear.USE_BOXCAR2 = config.checkbox_to_value(use_boxcar2)
sickgear.BOXCAR2_NOTIFY_ONSNATCH = config.checkbox_to_value(boxcar2_notify_onsnatch)
sickgear.BOXCAR2_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(boxcar2_notify_ondownload)
sickgear.BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(boxcar2_notify_onsubtitledownload)
key = boxcar2_access_token.strip()
if not starify(key, True):
sickgear.BOXCAR2_ACCESSTOKEN = key
sickgear.BOXCAR2_SOUND = boxcar2_sound
sickgear.USE_PUSHOVER = config.checkbox_to_value(use_pushover)
sickgear.PUSHOVER_NOTIFY_ONSNATCH = config.checkbox_to_value(pushover_notify_onsnatch)
sickgear.PUSHOVER_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(pushover_notify_ondownload)