import requests
from bs4 import BeautifulSoup
class Bot():
def __init__ (self, username = 'user', password = 'password', user_agent = 'user_agent'):
self.username = username # ник
self.password = password # секрет 3:
self.user_agent = user_agent # можно взять тут: https://developers.whatismybrowser.com/useragents/explore/operating_system_name/
# вход в систему
def login (self):
data = {
'username': self.username,
'password': self.password,
'func': 'login',
'dopinfa': 'Mesa Intel(R) HD Graphics 610 (KBL GT1)',
'dopinfaw': '1920x972'
}
url = 'https://profitcentr.com/ajax/log_reg.php'
s = requests.Session()
res = s.post(url, data = data)
self.session = s
return res.status_code
# узнать кол-во выполненных заданий серфинга
def get_serfing (self):
url = 'https://profitcentr.com/members'
headers = {
'User-Agent': self.user_agent
}
res = self.session.get(url, headers=headers)
soup = BeautifulSoup(res.content, 'html.parser')
print(soup)
table = soup.findAll('table', class_ = 'referals')
print(table)
a = Bot(username = '', password = '', user_agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36')
a.login()
a.get_serfing()
@bot.command(pass_context=True)
async def music(ctx, channel):
url = ctx.message.content
url = url.strip('https://www.youtube.com/watch?v=naIKplXzxTY')
vc = await bot.connect()
vc.play(discord.FFmpegPCMAudio(url))
vc.is_playing()
vc.pause()
vc.resume()
vc.stop()
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'play'