Youtube parsing
This commit is contained in:
parent
110e580911
commit
d2c623e8de
5
bot.py
5
bot.py
|
@ -7,7 +7,10 @@ PUBLIC_COMMANDS = ["sotd","listsotd"]
|
|||
SOTDS = datastore.DataStore("sotd.json")
|
||||
|
||||
def get_title(link):
|
||||
return str(urlopen(link).read()).split("<title>", 1)[1].split("</title>", 1)[0];
|
||||
title = str(urlopen(link).read()).split("<title>", 1)[1].split("</title>", 1)[0]
|
||||
if "YouTube" in title:
|
||||
return title.split(" - Youtube", 1)[0]
|
||||
return title
|
||||
|
||||
class SOTDBot(teambot.Handler,teambot.CommandHandlerMixin):
|
||||
def __init__(self,*args):
|
||||
|
|
Reference in New Issue