Merge branch 'development' into halali
|
@ -45,7 +45,7 @@ If you need something that is not already part of Bazarr, feel free to create a
|
|||
|
||||
You can get more in the [screenshot](https://github.com/morpheus65535/bazarr/tree/master/screenshot) directory but it should look familiar:
|
||||
|
||||

|
||||

|
||||
|
||||
### License
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
|
|||
logging.debug('BAZARR ' + str(len(subtitles_list)) + " subtitles have been found for this file: " + path)
|
||||
if len(subtitles_list) > 0:
|
||||
try:
|
||||
pdownload_result = False
|
||||
download_result = False
|
||||
for subtitle in subtitles_list:
|
||||
download_result = p.download_subtitle(subtitle)
|
||||
if download_result == True:
|
||||
|
@ -130,7 +130,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
|
|||
downloaded_language = language_from_alpha3(result[0].language.alpha3)
|
||||
downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3)
|
||||
downloaded_language_code3 = result[0].language.alpha3
|
||||
downloaded_path = get_subtitle_path(path, language=language_set)
|
||||
downloaded_path = get_subtitle_path(path, downloaded_language_code2)
|
||||
logging.debug('BAZARR Subtitles file saved to disk: ' + downloaded_path)
|
||||
if used_sceneName == True:
|
||||
message = downloaded_language + " subtitles downloaded from " + downloaded_provider + " with a score of " + unicode(calculated_score) + "% using this scene name: " + sceneName
|
||||
|
@ -235,7 +235,7 @@ def manual_search(path, language, hi, providers, providers_auth, sceneName, medi
|
|||
if type(s) is LegendasTVSubtitle:
|
||||
# The pickle doesn't work very well with RAR (rarfile.RarFile) or ZIP (zipfile.ZipFile)
|
||||
s.archive.content = None
|
||||
subtitles_list.append(dict(score=round((compute_score(s, video, hearing_impaired=hi) / max_score * 100), 2), language=alpha2_from_alpha3(s.language.alpha3), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s), "base64").decode(), url=s.page_link, matches=list(matched), dont_matches=list(not_matched)))
|
||||
subtitles_list.append(dict(score=round((compute_score(s, video, hearing_impaired=hi) / max_score * 100), 2), language=alpha2_from_alpha3(s.language.alpha3), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s), "base64").decode(), url=s.page_link, matches=list(matched), dont_matches=list(not_matched)))
|
||||
subtitles_dict = {}
|
||||
subtitles_dict = sorted(subtitles_list, key=lambda x: x['score'], reverse=True)
|
||||
logging.debug('BAZARR ' + str(len(subtitles_dict)) + " subtitles have been found for this file: " + path)
|
||||
|
@ -299,7 +299,7 @@ def manual_download_subtitle(path, language, hi, subtitle, provider, providers_a
|
|||
downloaded_language = language_from_alpha3(result[0].language.alpha3)
|
||||
downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3)
|
||||
downloaded_language_code3 = result[0].language.alpha3
|
||||
downloaded_path = get_subtitle_path(path, language=lang_obj)
|
||||
downloaded_path = get_subtitle_path(path, downloaded_language_code2)
|
||||
logging.debug('BAZARR Subtitles file saved to disk: ' + downloaded_path)
|
||||
message = downloaded_language + " subtitles downloaded from " + downloaded_provider + " with a score of " + unicode(score) + "% using manual search."
|
||||
|
||||
|
|
|
@ -54,10 +54,10 @@ def store_subtitles(file):
|
|||
encoding = UnicodeDammit(text)
|
||||
try:
|
||||
text = text.decode(encoding.original_encoding)
|
||||
detected_language = langdetect.detect(text)
|
||||
except Exception as e:
|
||||
logging.exception('BAZARR Error trying to detect character encoding for this subtitles file: ' + path_replace(os.path.join(os.path.dirname(file), subtitle)) + ' You should try to delete this subtitles file manually and ask Bazarr to download it again.')
|
||||
else:
|
||||
detected_language = langdetect.detect(text)
|
||||
if len(detected_language) > 0:
|
||||
actual_subtitles.append([str(detected_language), path_replace_reverse(os.path.join(os.path.dirname(file), subtitle))])
|
||||
|
||||
|
@ -106,10 +106,10 @@ def store_subtitles_movie(file):
|
|||
encoding = UnicodeDammit(text)
|
||||
try:
|
||||
text = text.decode(encoding.original_encoding)
|
||||
detected_language = langdetect.detect(text)
|
||||
except Exception as e:
|
||||
logging.exception('BAZARR Error trying to detect character encoding for this subtitles file: ' + path_replace_movie(os.path.join(os.path.dirname(file), subtitle)) + ' You should try to delete this subtitles file manually and ask Bazarr to download it again.')
|
||||
else:
|
||||
detected_language = langdetect.detect(text)
|
||||
if len(detected_language) > 0:
|
||||
actual_subtitles.append([str(detected_language), path_replace_reverse_movie(os.path.join(os.path.dirname(file), subtitle))])
|
||||
|
||||
|
|
|
@ -1,19 +1,12 @@
|
|||
import os
|
||||
import sys
|
||||
import logging
|
||||
import re
|
||||
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
from get_argv import config_dir
|
||||
from get_settings import get_general_settings
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
debug = get_general_settings()[4]
|
||||
if debug is False:
|
||||
log_level = "INFO"
|
||||
else:
|
||||
log_level = "DEBUG"
|
||||
|
||||
class OneLineExceptionFormatter(logging.Formatter):
|
||||
def formatException(self, exc_info):
|
||||
|
@ -39,7 +32,12 @@ class NoExceptionFormatter(logging.Formatter):
|
|||
return ''
|
||||
|
||||
|
||||
def configure_logging():
|
||||
def configure_logging(debug=False):
|
||||
if not debug:
|
||||
log_level = "INFO"
|
||||
else:
|
||||
log_level = "DEBUG"
|
||||
|
||||
logger.handlers = []
|
||||
|
||||
logger.setLevel(log_level)
|
||||
|
@ -54,7 +52,7 @@ def configure_logging():
|
|||
# ch.addFilter(MyFilter())
|
||||
logger.addHandler(ch)
|
||||
|
||||
#File Logging
|
||||
# File Logging
|
||||
global fh
|
||||
fh = TimedRotatingFileHandler(os.path.join(config_dir, 'log/bazarr.log'), when="midnight", interval=1,
|
||||
backupCount=7)
|
||||
|
@ -64,7 +62,7 @@ def configure_logging():
|
|||
fh.addFilter(BlacklistFilter())
|
||||
fh.addFilter(PublicIPFilter())
|
||||
|
||||
if debug is True:
|
||||
if debug:
|
||||
logging.getLogger("apscheduler").setLevel(logging.DEBUG)
|
||||
logging.getLogger("subliminal").setLevel(logging.DEBUG)
|
||||
logging.getLogger("git").setLevel(logging.DEBUG)
|
||||
|
@ -145,13 +143,3 @@ class PublicIPFilter(logging.Filter):
|
|||
|
||||
def empty_log():
|
||||
fh.doRollover()
|
||||
|
||||
|
||||
def update_settings(debug):
|
||||
if debug == 'False':
|
||||
level = "INFO"
|
||||
else:
|
||||
level = "DEBUG"
|
||||
logger.setLevel(level)
|
||||
for handler in logger.handlers:
|
||||
handler.setLevel(level)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
bazarr_version = '0.6.7.1'
|
||||
bazarr_version = '0.6.8'
|
||||
|
||||
import gc
|
||||
gc.enable()
|
||||
|
@ -23,8 +23,9 @@ update_notifier()
|
|||
|
||||
from get_settings import get_general_settings, get_proxy_settings
|
||||
import logging
|
||||
from logger import configure_logging, empty_log, update_settings
|
||||
configure_logging()
|
||||
from logger import configure_logging, empty_log
|
||||
|
||||
configure_logging(get_general_settings()[4])
|
||||
|
||||
import requests
|
||||
if get_proxy_settings()[0] != 'None':
|
||||
|
@ -469,6 +470,7 @@ def image_proxy_movies(url):
|
|||
|
||||
|
||||
@route(base_url)
|
||||
@route(base_url.rstrip('/'))
|
||||
@custom_auth_basic(check_credentials)
|
||||
def redirect_root():
|
||||
authorize()
|
||||
|
@ -1129,8 +1131,6 @@ def save_settings():
|
|||
cfg.set('general', 'use_embedded_subs', text_type(settings_general_embedded))
|
||||
cfg.set('general', 'only_monitored', text_type(settings_general_only_monitored))
|
||||
cfg.set('general', 'adaptive_searching', text_type(settings_general_adaptive_searching))
|
||||
|
||||
update_settings(settings_general_debug)
|
||||
|
||||
if after != before:
|
||||
configured()
|
||||
|
@ -1301,6 +1301,8 @@ def save_settings():
|
|||
with open(config_file, 'wb') as f:
|
||||
cfg.write(f)
|
||||
|
||||
configure_logging(get_general_settings()[4])
|
||||
|
||||
notifiers = c.execute("SELECT * FROM table_settings_notifier ORDER BY name").fetchall()
|
||||
for notifier in notifiers:
|
||||
enabled = request.forms.get('settings_notifier_' + notifier[0] + '_enabled')
|
||||
|
|
BIN
screenshot/0-wizard/wizard-1- general.png
Normal file
After Width: | Height: | Size: 153 KiB |
BIN
screenshot/0-wizard/wizard-2-subliminal.png
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
screenshot/0-wizard/wizard-3-sonarr.png
Normal file
After Width: | Height: | Size: 100 KiB |
BIN
screenshot/0-wizard/wizard-4-radarr.png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
screenshot/1-series/series-1-list.png
Normal file
After Width: | Height: | Size: 300 KiB |
BIN
screenshot/1-series/series-2-episodes.png
Normal file
After Width: | Height: | Size: 2.8 MiB |
BIN
screenshot/1-series/series-3-manual.png
Normal file
After Width: | Height: | Size: 504 KiB |
BIN
screenshot/1-series/series-4-config.png
Normal file
After Width: | Height: | Size: 656 KiB |
BIN
screenshot/2-movies/movies-1-list.png
Normal file
After Width: | Height: | Size: 300 KiB |
BIN
screenshot/2-movies/movies-2-movie.png
Normal file
After Width: | Height: | Size: 278 KiB |
BIN
screenshot/2-movies/movies-3-manual.png
Normal file
After Width: | Height: | Size: 155 KiB |
BIN
screenshot/2-movies/movies-4-config.png
Normal file
After Width: | Height: | Size: 285 KiB |
BIN
screenshot/3-history/history-1-series.png
Normal file
After Width: | Height: | Size: 374 KiB |
BIN
screenshot/3-history/history-2-movies.png
Normal file
After Width: | Height: | Size: 347 KiB |
BIN
screenshot/4-wanted/wanted-1-series.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
screenshot/4-wanted/wanted-2-movies.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
screenshot/5-settings/settings-1-general.png
Normal file
After Width: | Height: | Size: 344 KiB |
BIN
screenshot/5-settings/settings-2-sonarr.png
Normal file
After Width: | Height: | Size: 128 KiB |
BIN
screenshot/5-settings/settings-3-radarr.png
Normal file
After Width: | Height: | Size: 129 KiB |
BIN
screenshot/5-settings/settings-4-subliminal.png
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
screenshot/5-settings/settings-5-notifications.png
Normal file
After Width: | Height: | Size: 237 KiB |
BIN
screenshot/6-system/system-1-tasks.png
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
screenshot/6-system/system-2-logs.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
screenshot/6-system/system-3-releases.png
Normal file
After Width: | Height: | Size: 437 KiB |
Before Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 107 KiB |
|
@ -1059,9 +1059,6 @@
|
|||
</div>
|
||||
<div class="ui dividing header">Subtitles providers</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui orange message">
|
||||
<p>Be aware that the more providers you enable, the longer it will take everytime you search for a subtitles.</p>
|
||||
</div>
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
|
|
|
@ -337,9 +337,6 @@
|
|||
</div>
|
||||
<div class="ui dividing header">Subtitles providers</div>
|
||||
<div class="twelve wide column">
|
||||
<div class="ui orange message">
|
||||
<p>Be aware that the more providers you enable, the longer it will take everytime you search for a subtitles.</p>
|
||||
</div>
|
||||
<div class="ui grid">
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
|
|