logging.debug('BAZARR '+str(len(subtitles_list))+" subtitles have been found for this file: "+path)
logging.debug(
'BAZARR '+str(len(subtitles_list))+" subtitles have been found for this file: "+path)
iflen(subtitles_list)>0:
try:
pdownload_result=False
forsubtitleinsubtitles_list:
download_result=p.download_subtitle(subtitle)
ifdownload_result==True:
logging.debug('BAZARR Subtitles file downloaded from '+str(subtitle.provider_name)+' for this file: '+path)
logging.debug('BAZARR Subtitles file downloaded from '+str(
subtitle.provider_name)+' for this file: '+path)
break
else:
logging.warning('BAZARR Subtitles file skipped from '+str(subtitle.provider_name)+' for this file: '+path+' because no content was returned by the provider (probably throttled).')
logging.warning('BAZARR Subtitles file skipped from '+str(
subtitle.provider_name)+' for this file: '+path+' because no content was returned by the provider (probably throttled).')
continue
ifdownload_result==False:
logging.error('BAZARR Tried to download a subtitles for file: '+path+" but we weren't able to do it this time (probably being throttled). Going to retry on next search.")
logging.error(
'BAZARR Tried to download a subtitles for file: '+path+" but we weren't able to do it this time (probably being throttled). Going to retry on next search.")
returnNone
exceptExceptionase:
logging.exception('BAZARR Error downloading subtitles for this file '+path)
logging.debug('BAZARR Subtitles file saved to disk: '+downloaded_path)
ifused_sceneName==True:
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(calculated_score)+"% using this scene name: "+sceneName
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(
calculated_score)+"% using this scene name: "+sceneName
else:
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(calculated_score)+"% using filename guessing."
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(
logging.error('BAZARR Post-processing result for file '+path+' : Nothing returned from command execution')
logging.error(
'BAZARR Post-processing result for file '+path+' : Nothing returned from command execution')
else:
logging.error('BAZARR Post-processing result for file '+path+' : '+out)
else:
ifout=="":
logging.info('BAZARR Post-processing result for file '+path+' : Nothing returned from command execution')
logging.info(
'BAZARR Post-processing result for file '+path+' : Nothing returned from command execution')
else:
logging.info('BAZARR Post-processing result for file '+path+' : '+out)
returnmessage
else:
logging.error('BAZARR Tried to manually download a subtitles for file: '+path+" but we weren't able to do (probably throttled by ' + str(subtitle.provider_name) + '. Please retry later or select a subtitles from another provider.")
logging.error(
'BAZARR Tried to manually download a subtitles for file: '+path+" but we weren't able to do (probably throttled by ' + str(subtitle.provider_name) + '. Please retry later or select a subtitles from another provider.")
returnNone
logging.debug('BAZARR Ended manually downloading subtitles for file: '+path)
defseries_download_subtitles(no):
ifget_general_settings()[24]isTrue:
monitored_only_query_string=' AND monitored = "True"'
episodes_details=c_db.execute('SELECT path, missing_subtitles, sonarrEpisodeId, scene_name FROM table_episodes WHERE sonarrSeriesId = ? AND missing_subtitles != "[]"'+monitored_only_query_string,(no,)).fetchall()
episodes_details=c_db.execute(
'SELECT path, missing_subtitles, sonarrEpisodeId, scene_name FROM table_episodes WHERE sonarrSeriesId = ? AND missing_subtitles != "[]"'+monitored_only_query_string,
(no,)).fetchall()
series_details=c_db.execute("SELECT hearing_impaired FROM table_shows WHERE sonarrSeriesId = ?",(no,)).fetchone()
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.')
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.')
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.')
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.')
misfire_grace_time=15,id='update_all_movies',name='Update all movies subtitles from disk',
replace_existing=True)
misfire_grace_time=15,id='update_all_movies',
name='Update all movies subtitles from disk',
replace_existing=True)
defexecute_now(taskid):
@ -61,25 +68,32 @@ if str(get_localzone()) == "local":
else:
scheduler=BackgroundScheduler()
ifno_update isFalse:
ifnotargs.no_update:
ifautomaticisTrue:
scheduler.add_job(check_and_apply_update,IntervalTrigger(hours=6),max_instances=1,coalesce=True,misfire_grace_time=15,id='update_bazarr',name='Update bazarr from source on Github')
scheduler.add_job(update_series,IntervalTrigger(minutes=1),max_instances=1,coalesce=True,misfire_grace_time=15,id='update_series',name='Update series list from Sonarr')
scheduler.add_job(sync_episodes,IntervalTrigger(minutes=5),max_instances=1,coalesce=True,misfire_grace_time=15,id='sync_episodes',name='Sync episodes with Sonarr')
id='sync_episodes',name='Sync episodes with Sonarr')
ifintegration[13]isTrue:
scheduler.add_job(update_movies,IntervalTrigger(minutes=5),max_instances=1,coalesce=True,misfire_grace_time=15,id='update_movies',name='Update movies list from Radarr')
id='update_movies',name='Update movies list from Radarr')
ifintegration[12]isTrueorintegration[13]isTrue:
scheduler.add_job(wanted_search_missing_subtitles,IntervalTrigger(hours=3),max_instances=1,coalesce=True,misfire_grace_time=15,id='wanted_search_missing_subtitles',name='Search for wanted subtitles')