aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authorzrose584 <57181548+zrose584@users.noreply.github.com>2020-10-18 17:58:16 +0200
committerzrose584 <57181548+zrose584@users.noreply.github.com>2020-10-18 18:48:52 +0200
commita8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2 (patch)
treec8da0b06304993904214b2018d8ea33355c0c02e /server.py
parentf7f2b9fa06fd2218179636c712e43f0c4d65bd9e (diff)
downloadyt-local-a8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2.tar.lz
yt-local-a8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2.tar.xz
yt-local-a8916b9308a4e2b7c1441a4d8d3c6d0b19c38fd2.zip
proxy 'sponsor.ajay.app'
Diffstat (limited to 'server.py')
-rw-r--r--server.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/server.py b/server.py
index acce420..319a140 100644
--- a/server.py
+++ b/server.py
@@ -66,7 +66,7 @@ def proxy_site(env, start_response, video=False):
# such as 8192 lest that causes the socket library to limit the
# TCP window size
# Might need fine-tuning, since this gives us 4*65536
- # The tradeoff is that larger values (such as 6 seconds) only
+ # The tradeoff is that larger values (such as 6 seconds) only
# allows video to buffer in those increments, meaning user must wait
# until the entire chunk is downloaded before video starts playing
content_part = response.read(32*8192)
@@ -85,6 +85,7 @@ site_handlers = {
'ytimg.com': proxy_site,
'yt3.ggpht.com': proxy_site,
'lh3.googleusercontent.com': proxy_site,
+ 'sponsor.ajay.app': proxy_site,
'googlevideo.com': proxy_video,
}
@@ -95,9 +96,9 @@ def split_url(url):
match = re.match(r'(?:https?://)?([\w-]+(?:\.[\w-]+)+?)(/.*|$)', url)
if match is None:
raise ValueError('Invalid or unsupported url: ' + url)
-
+
return match.group(1), match.group(2)
-
+
def error_code(code, start_response):