Fixes https requests and youtube

This commit is contained in:
nikolark committed 2016-03-22 14:07:18 +01:00
1 parent 9c6ae886ce
commit fac4fe66bf
2 files changed
+3 -2

No files matched your search

+1
View File
@@ -2,3 +2,4 @@ Twisted[tls]==16.0.0
lxml==3.6.0
mysqlclient==1.3.7
requests==2.9.1
ndg-httpsclient==0.4.0
+2 -2
View File
@@ -174,8 +174,8 @@ class IRCActions:
content_type = content_type.split(';')[0]
reply += "%d %s " % (req.status_code, content_type)
if req.status_code == 200 and content_type == "text/html":
# Read max 10240 bytes
partial_html = next(req.iter_content(chunk_size=10240))
# Read max 20480 bytes
partial_html = next(req.iter_content(chunk_size=20480))
reply += parse_title(partial_html)
self.bot.msgReply(nick, channel, reply)