working a bit more
This commit is contained in:
parent
8a3ded3673
commit
8f9e7d0bd6
12
main.py
12
main.py
@ -65,16 +65,20 @@ for i in guilds:
|
||||
from html.parser import HTMLParser
|
||||
|
||||
class TokenFinder(HTMLParser):
|
||||
def __init__(self):
|
||||
self.token=None
|
||||
def __init__(self, admin_url):
|
||||
self.token = None
|
||||
self.delete_links = []
|
||||
self.admin_url = admin_url
|
||||
super().__init__()
|
||||
|
||||
def handle_starttag(self, tag, attrs_tuple):
|
||||
if tag != 'input':
|
||||
if tag != 'input' and tag != 'a':
|
||||
return
|
||||
attrs = dict(attrs_tuple)
|
||||
if tag == 'input' and 'type' in attrs and attrs['type'] == 'hidden' and 'name' in attrs and attrs['name'] == 'control' and 'value' in attrs:
|
||||
if tag == 'input' and 'type' in attrs and attrs['type'] == 'hidden' and 'name' in attrs and attrs['name'] == 'control' and 'value' in attrs :
|
||||
self.token = attrs['value']
|
||||
elif tag == 'a' and 'href' in attrs and attrs['href'].startswith(self.admin_url + '/action/delete_column/') :
|
||||
self.delete_links.append(attrs['href'])
|
||||
|
||||
|
||||
def create_framavote (guild, names):
|
||||
|
Loading…
Reference in New Issue
Block a user