diff options
author | James Taylor <28744867+user234683@users.noreply.github.com> | 2020-10-12 09:37:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 09:37:54 -0700 |
commit | 641af53e2ea0cb7ea398631d13c804d7ac1e0a8a (patch) | |
tree | 7dfecaadce3cc58ddcc86e2cd9d5ef762563e9ce /settings.py | |
parent | 2cfc6dec39ccdcc0c5fe2eea73f47b7040e51833 (diff) | |
parent | fd253d9e07fa34e2a22d28d445839147daca9ee0 (diff) | |
download | yt-local-641af53e2ea0cb7ea398631d13c804d7ac1e0a8a.tar.lz yt-local-641af53e2ea0cb7ea398631d13c804d7ac1e0a8a.tar.xz yt-local-641af53e2ea0cb7ea398631d13c804d7ac1e0a8a.zip |
Merge pull request #24 from zrose584/optional_proxy_images
settings.py: add 'proxy_images'
Diffstat (limited to 'settings.py')
-rw-r--r-- | settings.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/settings.py b/settings.py index fffe6f2..dfab369 100644 --- a/settings.py +++ b/settings.py @@ -128,6 +128,13 @@ For security reasons, enabling this is not recommended.''', 'comment': '', }), + ('proxy_images', { + 'label': 'proxy images', + 'type': bool, + 'default': True, + 'comment': '', + }), + ('use_comments_js', { 'label': 'Enable comments.js', 'type': bool, @@ -264,7 +271,7 @@ else: if type(node) != ast.Assign: log_ignored_line(node.lineno, "only assignments are allowed") continue - + if len(node.targets) > 1: log_ignored_line(node.lineno, "only simple single-variable assignments allowed") continue @@ -273,11 +280,11 @@ else: if type(target) != ast.Name: log_ignored_line(node.lineno, "only simple single-variable assignments allowed") continue - + if target.id not in acceptable_targets: log_ignored_line(node.lineno, target.id + " is not a valid setting") continue - + if type(node.value) not in attributes: log_ignored_line(node.lineno, "only literals allowed for values") continue @@ -305,6 +312,11 @@ else: globals().update(current_settings_dict) +if proxy_images: + img_prefix = "/" +else: + img_prefix = "" + if route_tor: |