diff --git a/extractors/channel.py b/extractors/channel.py index 39475d9..454a4e5 100644 --- a/extractors/channel.py +++ b/extractors/channel.py @@ -29,11 +29,6 @@ def extract_channel(ucid): "error": alert_text, "identifier": "NOT_FOUND" } - elif alert_text.startswith("This account has been terminated"): - return { - "error": alert_text, - "identifier": "ACCOUNT_TERMINATED" - } else: print("Seen alert text '{}'".format(alert_text)) diff --git a/index.py b/index.py index 91cdcfd..ffc35c7 100644 --- a/index.py +++ b/index.py @@ -123,17 +123,17 @@ class NewLeaf(object): @cherrypy.expose def vi(self, id, file): - with requests.get("https://i.ytimg.com/vi/{}/{}".format(id, file), stream=True) as r: + with requests.get("https://i.ytimg.com/vi/{}/{}".format(id, file)) as r: r.raise_for_status() cherrypy.response.headers["content-type"] = r.headers["content-type"] - return next(r.iter_content(chunk_size=None)) + return r # no idea if this is a good way to do it, but it definitely works! :D @cherrypy.expose def ggpht(self, *path): - with requests.get("https://yt3.ggpht.com/{}".format("/".join(path)), stream=True) as r: + with requests.get("https://yt3.ggpht.com/{}".format("/".join(path))) as r: r.raise_for_status() cherrypy.response.headers["content-type"] = r.headers["content-type"] - return next(r.iter_content(chunk_size=None)) + return r bind_port = getattr(configuration, "bind_port", 3000) bind_host = getattr(configuration, "bind_host", "0.0.0.0")