mirror of
				https://github.com/chibicitiberiu/ytsm.git
				synced 2024-02-24 05:43:31 +00:00 
			
		
		
		
	Fixed user settings page.
This commit is contained in:
		| @@ -59,9 +59,9 @@ def __build_youtube_dl_params(video: Video): | ||||
|         'outtmpl': output_path, | ||||
|         'writethumbnail': True, | ||||
|         'writedescription': True, | ||||
|         'writesubtitles': user.preferences['subtitles_enabled'], | ||||
|         'writeautomaticsub': user.preferences['autogenerated_subtitles'], | ||||
|         'allsubtitles': user.preferences['all_subtitles'], | ||||
|         'writesubtitles': user.preferences['download_subtitles'], | ||||
|         'writeautomaticsub': user.preferences['download_autogenerated_subtitles'], | ||||
|         'allsubtitles': user.preferences['download_subtitles_all'], | ||||
|         'postprocessors': [ | ||||
|             { | ||||
|                 'key': 'FFmpegMetadata' | ||||
| @@ -69,12 +69,12 @@ def __build_youtube_dl_params(video: Video): | ||||
|         ] | ||||
|     } | ||||
|  | ||||
|     sub_langs = user.preferences['subtitles_langs'].split(',') | ||||
|     sub_langs = user.preferences['download_subtitles_langs'].split(',') | ||||
|     sub_langs = [i.strip() for i in sub_langs] | ||||
|     if len(sub_langs) > 0: | ||||
|         youtube_dl_params['subtitleslangs'] = sub_langs | ||||
|  | ||||
|     sub_format = user.preferences['subtitles_format'] | ||||
|     sub_format = user.preferences['download_subtitles_format'] | ||||
|     if len(sub_format) > 0: | ||||
|         youtube_dl_params['subtitlesformat'] = sub_format | ||||
|  | ||||
| @@ -93,7 +93,7 @@ def download_video(video: Video, attempt: int = 1): | ||||
|     _lock.acquire() | ||||
|  | ||||
|     try: | ||||
|         max_attempts = user.preferences['download_max_attempts'] | ||||
|         max_attempts = user.preferences['max_download_attempts'] | ||||
|  | ||||
|         youtube_dl_params, output_path = __build_youtube_dl_params(video) | ||||
|         with youtube_dl.YoutubeDL(youtube_dl_params) as yt: | ||||
|   | ||||
| @@ -73,7 +73,7 @@ def __detect_deleted(subscription: Subscription): | ||||
|             video.downloaded_path = None | ||||
|  | ||||
|             # Mark watched? | ||||
|             if user.preferences['MarkDeletedAsWatched']: | ||||
|             if user.preferences['mark_deleted_as_watched']: | ||||
|                 video.watched = True | ||||
|  | ||||
|             video.save() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user