diff options
author | Jesús <heckyel@hyperbola.info> | 2021-06-10 16:41:45 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-06-10 16:41:45 -0500 |
commit | 7fd2c3474fa71cfb36f64e7f5c4d89fb21c38334 (patch) | |
tree | 69802416f43f6ef8eff03716933094997bc41b34 /youtube | |
parent | d35188178b947d0f3c0c3dbaa0fbfe47d7bdf20a (diff) | |
download | yt-local-7fd2c3474fa71cfb36f64e7f5c4d89fb21c38334.tar.lz yt-local-7fd2c3474fa71cfb36f64e7f5c4d89fb21c38334.tar.xz yt-local-7fd2c3474fa71cfb36f64e7f5c4d89fb21c38334.zip |
Capitalize name app
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/__init__.py | 4 | ||||
-rw-r--r-- | youtube/comments.py | 2 | ||||
-rw-r--r-- | youtube/opensearch.xml | 2 | ||||
-rw-r--r-- | youtube/subscriptions.py | 6 | ||||
-rw-r--r-- | youtube/templates/base.html | 2 | ||||
-rw-r--r-- | youtube/util.py | 2 | ||||
-rw-r--r-- | youtube/watch.py | 2 | ||||
-rw-r--r-- | youtube/yt_data_extract/common.py | 2 | ||||
-rw-r--r-- | youtube/yt_data_extract/watch_extraction.py | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/youtube/__init__.py b/youtube/__init__.py index 3c85d47..0a00ebb 100644 --- a/youtube/__init__.py +++ b/youtube/__init__.py @@ -18,7 +18,7 @@ yt_app.add_url_rule('/settings', 'settings_page', settings.settings_page, method @yt_app.route('/') def homepage(): - return flask.render_template('home.html', title="Youtube local") + return flask.render_template('home.html', title="YouTube local") @yt_app.route('/licenses') @@ -100,7 +100,7 @@ def error_page(e): and exc_info()[1].code == '429' and settings.route_tor ): - error_message = ('Error: Youtube blocked the request because the Tor' + error_message = ('Error: YouTube blocked the request because the Tor' ' exit node is overutilized. Try getting a new exit node by' ' using the New Identity button in the Tor Browser.') if exc_info()[1].error_message: diff --git a/youtube/comments.py b/youtube/comments.py index 208c161..68456bd 100644 --- a/youtube/comments.py +++ b/youtube/comments.py @@ -187,7 +187,7 @@ def video_comments(video_id, sort=0, offset=0, lc='', secret_key=''): return {} except util.FetchError as e: if e.code == '429' and settings.route_tor: - comments_info['error'] = 'Error: Youtube blocked the request because the Tor exit node is overutilized.' + comments_info['error'] = 'Error: YouTube blocked the request because the Tor exit node is overutilized.' if e.error_message: comments_info['error'] += '\n\n' + e.error_message comments_info['error'] += '\n\nExit node IP address: %s' % e.ip diff --git a/youtube/opensearch.xml b/youtube/opensearch.xml index 9f035a6..aacc9cf 100644 --- a/youtube/opensearch.xml +++ b/youtube/opensearch.xml @@ -1,5 +1,5 @@ <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> -<ShortName>Youtube local</ShortName> +<ShortName>YouTube local</ShortName> <Description>no CIA shit in the background</Description> <InputEncoding>UTF-8</InputEncoding> <Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEACAAlAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAexJREFUOI2lkzFPmlEUhp/73fshtCUCRtvQkJoKMrDQJvoHnBzUhc3EH0DUQf+As6tujo4M6mTiIDp0kGiMTRojTRNSW6o12iD4YYXv3g7Qr4O0ScM7npz7vOe+J0fk83lDF7K6eQygwkdHhI+P0bYNxmBXq5RmZui5vGQgn0f7fKi7O4oLC1gPD48BP9JpnpRKJFZXcQMB3m1u4vr9NHp76d/bo39/n4/z84ROThBa4/r91OJxMKb9BSn5mskAIOt1eq6uEFpjVyrEcjk+T0+TXlzkbTZLuFDAur9/nIFRipuREQCe7+zgBgK8mZvj/fIylVTKa/6UzXKbSnnuHkA0GnwbH/cA0a0takND3IyOEiwWAXBiMYTWjzLwtvB9bAyAwMUF8ZUVPiwtYTWbHqA6PIxoNv8OMLbN3eBga9TZWYQxaKX+AJJJhOv+AyAlT0slAG6TSX5n8+zszJugkzxA4PzcK9YSCQCk42DXaq1aGwqgfT5ebG9jpMQyUjKwu8vrtbWWqxC83NjAd31NsO2uleJnX58HCJ6eEjk8BGNQAA+RCOXJScpTU2AMwnUxlkXk4ACA+2iUSKGArNeRjkMsl6M8MYHQGtHpmIxSvFpfRzoORinQGqvZBCEwQoAxfMlkaIRCnQH/o66v8Re19MavaDNLfgAAAABJRU5ErkJggg==</Image> diff --git a/youtube/subscriptions.py b/youtube/subscriptions.py index f540e35..503f3fa 100644 --- a/youtube/subscriptions.py +++ b/youtube/subscriptions.py @@ -464,7 +464,7 @@ def _get_channel_tab(channel_id, channel_status_name): except util.FetchError as e: if e.code == '429' and settings.route_tor: error_message = ('Error checking channel ' + channel_status_name - + ': Youtube blocked the request because the' + + ': YouTube blocked the request because the' + ' Tor exit node is overutilized. Try getting a new exit node' + ' by using the New Identity button in the Tor Browser.') if e.ip: @@ -562,7 +562,7 @@ def _get_upstream_videos(channel_id): average_upload_period = int((time.time() - videos[4]['time_published'])/5) # equivalent to averaging the time between videos for the last 5 videos # calculate when to check next for auto checking - # add some quantization and randomness to make pattern analysis by Youtube slightly harder + # add some quantization and randomness to make pattern analysis by YouTube slightly harder quantized_upload_period = average_upload_period - (average_upload_period % (4*3600)) + 4*3600 # round up to nearest 4 hours randomized_upload_period = quantized_upload_period*(1 + secrets.randbelow(50)/50*0.5) # randomly between 1x and 1.5x next_check_delay = randomized_upload_period/10 # check at 10x the channel posting rate. might want to fine tune this number @@ -725,7 +725,7 @@ def import_subscriptions(): except (AssertionError, IndexError, defusedxml.ElementTree.ParseError) as e: return '400 Bad Request: Unable to read opml xml file, or the file is not the expected format', 400 else: - return '400 Bad Request: Unsupported file format: ' + mime_type + '. Only subscription.json files (from Google Takeouts) and XML OPML files exported from Youtube\'s subscription manager page are supported', 400 + return '400 Bad Request: Unsupported file format: ' + mime_type + '. Only subscription.json files (from Google Takeouts) and XML OPML files exported from YouTube\'s subscription manager page are supported', 400 _subscribe(channels) diff --git a/youtube/templates/base.html b/youtube/templates/base.html index 7b32d76..4c11ce0 100644 --- a/youtube/templates/base.html +++ b/youtube/templates/base.html @@ -5,7 +5,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"/> <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval'; media-src 'self' https://*.googlevideo.com; {{ "img-src 'self' https://*.googleusercontent.com https://*.ggpht.com https://*.ytimg.com;" if not settings.proxy_images else "" }}"/> <title>{{ page_title }}</title> - <link title="Youtube local" href="/youtube.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml"/> + <link title="YouTube local" href="/youtube.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml"/> <link href="/youtube.com/static/favicon.ico" type="image/x-icon" rel="icon"/> <link href="/youtube.com/static/normalize.css" rel="stylesheet"/> <link href="{{ theme_path }}" rel="stylesheet"/> diff --git a/youtube/util.py b/youtube/util.py index 8f359ba..18c7ca1 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -311,7 +311,7 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None, if not use_tor: raise FetchError('429', reason=response.reason, ip=ip) - print('Error: Youtube blocked the request because the Tor exit node is overutilized. Exit node IP address: %s' % ip) + print('Error: YouTube blocked the request because the Tor exit node is overutilized. Exit node IP address: %s' % ip) # get new identity error = tor_manager.new_identity(start_time) diff --git a/youtube/watch.py b/youtube/watch.py index 3aaac13..14d5fcd 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -82,7 +82,7 @@ def lang_eq(lang1, lang2): def equiv_lang_in(lang, sequence): '''Extracts a language in sequence which is equivalent to lang. e.g. if lang is en, extracts en-GB from sequence. - Necessary because if only a specific variant like en-GB is available, can't ask Youtube for simply en. Need to get the available variant.''' + Necessary because if only a specific variant like en-GB is available, can't ask YouTube for simply en. Need to get the available variant.''' lang = lang[0:2] for l in sequence: if l[0:2] == lang: diff --git a/youtube/yt_data_extract/common.py b/youtube/yt_data_extract/common.py index b1cf31c..d03bd89 100644 --- a/youtube/yt_data_extract/common.py +++ b/youtube/yt_data_extract/common.py @@ -116,7 +116,7 @@ def _recover_urls(runs): run['text'] = url # youtube truncates the url text, use actual url instead def extract_str(node, default=None, recover_urls=False): - '''default is the value returned if the extraction fails. If recover_urls is true, will attempt to fix Youtube's truncation of url text (most prominently seen in descriptions)''' + '''default is the value returned if the extraction fails. If recover_urls is true, will attempt to fix YouTube's truncation of url text (most prominently seen in descriptions)''' if isinstance(node, str): return node diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py index db53581..daa1e89 100644 --- a/youtube/yt_data_extract/watch_extraction.py +++ b/youtube/yt_data_extract/watch_extraction.py @@ -373,7 +373,7 @@ def _extract_formats(info, player_response): # update with information from big table hardcoded_itag_info = _formats.get(str(itag), {}) for key, value in hardcoded_itag_info.items(): - conservative_update(fmt, key, value) # prefer info from Youtube + conservative_update(fmt, key, value) # prefer info from YouTube fmt['quality'] = hardcoded_itag_info.get('height') info['formats'].append(fmt) |